Changes in / [cf12619:0b6c6fc] in OpenWorkouts-current
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
bin/js_deps
- Property mode changed from 100644 to 100755
rcf12619 r0b6c6fc 179 179 180 180 leaflet_elevation() { 181 NAME=" Leaflet.Elevation"182 VERSION=" master"183 URL=https://github.com/ MrMufflon/${NAME}/archive/${VERSION}.tar.gz181 NAME="leaflet-elevation" 182 VERSION="0.0.8" 183 URL=https://github.com/Raruto/${NAME}/archive/${VERSION}.tar.gz 184 184 check_cache ${NAME} ${VERSION} 185 185 in_cache=$? -
bin/screenshot_map
- Property mode changed from 100644 to 100755
-
ow/static/js/ow.js
rcf12619 r0b6c6fc 35 35 var gpx; 36 36 var elevation; 37 var ow_charts;38 37 39 38 var create_map = function create_map(latitude, longitude, zoom) { … … 52 51 This has to be called *after* create_map and *before* load_gpx. 53 52 */ 53 54 54 elevation = L.control.elevation({ 55 55 position: "bottomright", 56 theme: "steelblue-theme", //default: lime-theme 57 width: 600, 58 height: 125, 59 margins: { 60 top: 10, 61 right: 20, 62 bottom: 30, 63 left: 50 64 }, 56 theme: "openworkouts-theme", 65 57 useHeightIndicator: true, //if false a marker is drawn at map position 66 interpolation: "linear", //see https://github.com/mbostock/d3/wiki/SVG-Shapes#wiki-area_interpolate 67 hoverNumber: { 68 decimalsX: 3, //decimals on distance (always in km) 69 decimalsY: 0, //deciamls on height (always in m) 70 formatter: undefined //custom formatter function may be injected 71 }, 72 xTicks: undefined, //number of ticks in x axis, calculated by default according to width 73 yTicks: undefined, //number of ticks on y axis, calculated by default according to height 74 collapsed: false //collapsed mode, show chart on click or mouseover 75 }); 76 77 var ele_container = elevation.addTo(map); 78 /* document.getElementById('ow-analysis').appendChild( 79 ele_container._container); */ 58 interpolation: d3.curveLinear, 59 elevationDiv: "#elevation", 60 detachedView: true, 61 responsiveView: true, 62 gpxOptions: { 63 async: true, 64 marker_options: { 65 startIconUrl: null, 66 endIconUrl: null, 67 shadowUrl: null, 68 }, 69 polyline_options: { 70 color: '#EE4056', 71 opacity: 0.75, 72 weight: 5, 73 lineCap: 'round' 74 }, 75 }, 76 }); 77 elevation.loadGPX(map, gpx_url); 78 // var ele_container = elevation.addTo(map); 80 79 }; 81 80 … … 92 91 shadowUrl: shadow, 93 92 }, 93 polyline_options: { 94 color: '#EE4056', 95 opacity: 0.75, 96 weight: 5, 97 lineCap: 'round' 98 }, 94 99 }); 95 100 … … 101 106 gpx.on("addline",function(e){ 102 107 elevation.addData(e.line); 103 // ow_charts.addData(e.line);104 108 }); 105 109 }; … … 109 113 110 114 var render = function render() { 111 // create the map, add elevation, load gpx 115 // create the map, add elevation, load gpx (only if needed, as the 116 // elevation plugin already loads the gpx data) 112 117 create_map(latitude, longitude, zoom); 113 118 if (elevation) { 114 119 add_elevation_chart(); 115 120 } 116 // add_ow_charts(); 117 load_gpx(gpx_url); 121 else { 122 load_gpx(gpx_url); 123 } 118 124 }; 119 125 -
ow/templates/workout.pt
rcf12619 r0b6c6fc 17 17 href="${request.static_url('ow:static/components/Leaflet/leaflet.css')}" /> 18 18 <link rel="stylesheet" tal:condition="context.has_gpx" 19 href="${request.static_url('ow:static/components/Leaflet.Elevation/dist/leaflet.elevation-0.0.4.css')}" /> 19 href="${request.static_url('ow:static/components/leaflet-elevation/leaflet-elevation.css')}" /> 20 <link rel="stylesheet" 21 href="${request.static_url('ow:static/css/leaflet-elevation.css')}" /> 20 22 </metal:css> 21 23 … … 30 32 <div class="workout-detail-resume"> 31 33 <h3 tal:content="context.title"></h3> 32 <div id="" tal:content="context.notes" 33 tal:attributes="id 'workout-' + context.workout_id + '-notes'"> 34 <div id="" tal:attributes="id 'workout-' + context.workout_id + '-notes'"> 35 <p tal:repeat="paragraph context.notes.split('\n')" 36 tal:content="paragraph"></p> 34 37 </div> 35 38 <ul class="workout-options"> 36 39 <li> 37 40 <a href="" i18n:translate="" 38 tal:attributes="href request.resource_url(context, 'edit')">39 edit workout41 tal:attributes="href request.resource_url(context, 'edit')"> 42 edit workout 40 43 </a> 41 44 </li> 42 45 <li> 43 46 <a href="" i18n:translate="" 44 tal:attributes="href request.resource_url(context, 'update-from-file')">45 update with tracking file47 tal:attributes="href request.resource_url(context, 'update-from-file')"> 48 update with tracking file 46 49 </a> 47 50 </li> 48 51 <li class="owo-del"><a href="" i18n:translate="" 49 tal:attributes="href request.resource_url(context, 'delete')">52 tal:attributes="href request.resource_url(context, 'delete')"> 50 53 delete 51 54 </a> 52 55 </li> 53 56 </ul> … … 72 75 <span><tal:t i18n:translate="">Speed</tal:t></span> 73 76 <span class="avg"><tal:t i18n:translate="">Avg.</tal:t> 74 <tal:c tal:content="round(context.speed['avg'], 1)"></tal:c>km/h</span>77 <tal:c tal:content="round(context.speed['avg'], 1)"></tal:c>km/h</span> 75 78 <span class="max"><tal:t i18n:translate="">Max.</tal:t> 76 <tal:c tal:content="round(context.speed['max'], 1)"></tal:c>km/h</span>79 <tal:c tal:content="round(context.speed['max'], 1)"></tal:c>km/h</span> 77 80 </li> 78 81 <li tal:condition="hr"> 79 82 <span><tal:t i18n:translate="">Heart Rate</tal:t></span> 80 83 <span class="avg"><tal:t i18n:translate="">Avg.</tal:t> 81 <tal:c tal:content="hr['avg']"></tal:c>bpm</span>84 <tal:c tal:content="hr['avg']"></tal:c>bpm</span> 82 85 <span class="max"><tal:t i18n:translate="">Max.</tal:t> 83 <tal:c tal:content="hr['max']"></tal:c> bpm</span>86 <tal:c tal:content="hr['max']"></tal:c> bpm</span> 84 87 </li> 85 88 <li tal:condition="cad"> 86 89 <span><tal:t i18n:translate="">Cadence</tal:t></span> 87 90 <span class="avg"><tal:t i18n:translate="">Avg.</tal:t> 88 <tal:c tal:content="cad['avg']"></tal:c></span>91 <tal:c tal:content="cad['avg']"></tal:c></span> 89 92 <span class="max"><tal:t i18n:translate="">Max.</tal:t> 90 <tal:c tal:content="cad['max']"></tal:c></span>93 <tal:c tal:content="cad['max']"></tal:c></span> 91 94 </li> 92 95 <li tal:condition="atemp"> 93 96 <span><tal:t i18n:translate="">Temperature</tal:t></span> 94 97 <span class="min"><tal:t i18n:translate="">Min.</tal:t> 95 <tal:c tal:content="atemp['min']"></tal:c>℃</span>98 <tal:c tal:content="atemp['min']"></tal:c>℃</span> 96 99 <span class="avg"><tal:t i18n:translate="">Avg.</tal:t> 97 <tal:c tal:content="atemp['avg']"></tal:c>℃</span>100 <tal:c tal:content="atemp['avg']"></tal:c>℃</span> 98 101 <span class="max"><tal:t i18n:translate="">Max.</tal:t> 99 <tal:c tal:content="atemp['max']"></tal:c>℃</span>102 <tal:c tal:content="atemp['max']"></tal:c>℃</span> 100 103 </li> 101 104 </ul> 105 <div id="elevation"></div> 102 106 </div> 103 107 </div> 108 104 109 <!--! Track map --> 105 110 <div id="map" tal:condition="context.has_gpx"></div> 106 107 <!--! Additional map controls -->108 109 <div id="ow-analysis">110 111 <!--!112 FIXME: the list of available charts should come from the workout113 details, based on which data this workout has114 -->115 <!--! All those ids are needed for the leaflet openworkouts plugin -->116 <tal:r tal:repeat="chart ['elevation', 'heartrate', 'cadence', 'temperature']">117 <div id="ow-" tal:attributes="id 'ow-' + chart">118 <div class="ow-average" id=""119 tal:attributes="id 'ow-' + chart + '-average'"></div>120 <div class="ow-chart" id=""121 tal:attributes="id 'ow-' + chart + '-chart'"></div>122 <div class="ow-current" id=""123 tal:attributes="id 'ow-' + chart + '-current'"></div>124 </div>125 </tal:r>126 127 </div>128 111 </metal:content> 129 112 130 113 <metal:body-js metal:fill-slot="body-js"> 131 114 132 133 <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script> 134 <!-- 135 <script src="${request.static_url('ow:static/d3/d3.min.js')}" 115 <script src="${request.static_url('ow:static/components/d3/d3.min.js')}" 136 116 tal:condition="context.has_gpx"></script> 137 -->138 117 139 118 <script src="${request.static_url('ow:static/components/Leaflet/leaflet.js')}" … … 143 122 tal:condition="context.has_gpx"></script> 144 123 145 <script src="${request.static_url('ow:static/components/ Leaflet.Elevation/dist/leaflet.elevation-0.0.4.min.js')}"124 <script src="${request.static_url('ow:static/components/leaflet-elevation/leaflet-elevation.js')}" 146 125 tal:condition="context.has_gpx"></script> 147 126
Note: See TracChangeset
for help on using the changeset viewer.