[5ec3a0b] | 1 | <html xmlns="http://www.w3.org/1999/xhtml" |
---|
| 2 | xml:lang="en" |
---|
| 3 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
---|
| 4 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
---|
| 5 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
---|
| 6 | i18n:domain="OpenWorkouts" |
---|
| 7 | metal:use-macro="load: base.pt" |
---|
| 8 | tal:attributes="lang request.locale_name"> |
---|
| 9 | |
---|
| 10 | <metal:head-title metal:fill-slot="head-title"> |
---|
| 11 | <tal:t i18n:translate="">Workout details</tal:t>: |
---|
| 12 | <tal:c tal:content="context.title"></tal:c> |
---|
| 13 | </metal:head-title> |
---|
| 14 | |
---|
| 15 | <metal:css metal:fill-slot="css"> |
---|
| 16 | <link rel="stylesheet" tal:condition="context.has_gpx" |
---|
| 17 | href="${request.static_url('ow:static/components/Leaflet/leaflet.css')}" /> |
---|
[a0085a2] | 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')}" /> |
---|
[5ec3a0b] | 20 | </metal:css> |
---|
| 21 | |
---|
| 22 | <metal:title metal:fill-slot="title"> |
---|
| 23 | <tal:t i18n:translate="">Workout details</tal:t> |
---|
| 24 | </metal:title> |
---|
| 25 | |
---|
| 26 | <metal:content metal:fill-slot="content"> |
---|
| 27 | |
---|
[10c8e6e] | 28 | |
---|
| 29 | <div class="workout-detail" id="workout"> |
---|
| 30 | <div class="workout-detail-resume"> |
---|
| 31 | <h3 tal:content="context.title"></h3> |
---|
| 32 | <div id="" tal:content="context.notes" |
---|
| 33 | tal:attributes="id 'workout-' + context.workout_id + '-notes'"> |
---|
| 34 | </div> |
---|
| 35 | <ul class="workout-options"> |
---|
| 36 | <li> |
---|
| 37 | <a href="" i18n:translate="" |
---|
| 38 | tal:attributes="href request.resource_url(context, 'edit')"> |
---|
| 39 | edit workout |
---|
| 40 | </a> |
---|
| 41 | </li> |
---|
| 42 | <li> |
---|
| 43 | <a href="" i18n:translate="" |
---|
| 44 | tal:attributes="href request.resource_url(context, 'update-from-file')"> |
---|
| 45 | update with tracking file |
---|
| 46 | </a> |
---|
| 47 | </li> |
---|
| 48 | <li class="owo-del"><a href="" i18n:translate="" |
---|
| 49 | tal:attributes="href request.resource_url(context, 'delete')"> |
---|
| 50 | delete |
---|
| 51 | </a> |
---|
| 52 | </li> |
---|
| 53 | </ul> |
---|
| 54 | </div> |
---|
| 55 | <div class="workout-detail-info"> |
---|
| 56 | <ul id="" tal:attributes="id 'workout-' + context.workout_id + '-details'" |
---|
| 57 | tal:define="hr context.hr; cad context.cad; atemp context.atemp; timezone context.owner.timezone"> |
---|
[bf01534] | 58 | <li class="important" tal:condition="context.distance"> |
---|
[10c8e6e] | 59 | <span><tal:t i18n:translate="">Distance</tal:t></span> |
---|
| 60 | <tal:c tal:content="context.rounded_distance"></tal:c> km |
---|
| 61 | </li> |
---|
[bf01534] | 62 | <li class="important"> |
---|
[10c8e6e] | 63 | <span><tal:t i18n:translate="">Duration</tal:t></span> |
---|
| 64 | <!--! use the properly formatted duration instead of the timedelta object --> |
---|
| 65 | <tal:c tal:content="context._duration"></tal:c> |
---|
| 66 | </li> |
---|
[bf01534] | 67 | <li class="important"> |
---|
| 68 | <span><tal:t i18n:translate="">Start</tal:t></span> |
---|
| 69 | <tal:c tal:content="context.start_in_timezone(timezone)"></tal:c> |
---|
| 70 | </li> |
---|
[10c8e6e] | 71 | <li tal:condition="context.speed"> |
---|
| 72 | <span><tal:t i18n:translate="">Speed</tal:t></span> |
---|
[bf01534] | 73 | <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> |
---|
| 75 | <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> |
---|
[10c8e6e] | 77 | </li> |
---|
| 78 | <li tal:condition="hr"> |
---|
| 79 | <span><tal:t i18n:translate="">Heart Rate</tal:t></span> |
---|
[bf01534] | 80 | <span class="avg"><tal:t i18n:translate="">Avg.</tal:t> |
---|
| 81 | <tal:c tal:content="hr['avg']"></tal:c>bpm</span> |
---|
| 82 | <span class="max"><tal:t i18n:translate="">Max.</tal:t> |
---|
| 83 | <tal:c tal:content="hr['max']"></tal:c> bpm</span> |
---|
[10c8e6e] | 84 | </li> |
---|
| 85 | <li tal:condition="cad"> |
---|
| 86 | <span><tal:t i18n:translate="">Cadence</tal:t></span> |
---|
[bf01534] | 87 | <span class="avg"><tal:t i18n:translate="">Avg.</tal:t> |
---|
| 88 | <tal:c tal:content="cad['avg']"></tal:c></span> |
---|
| 89 | <span class="max"><tal:t i18n:translate="">Max.</tal:t> |
---|
| 90 | <tal:c tal:content="cad['max']"></tal:c></span> |
---|
[10c8e6e] | 91 | </li> |
---|
| 92 | <li tal:condition="atemp"> |
---|
| 93 | <span><tal:t i18n:translate="">Temperature</tal:t></span> |
---|
[bf01534] | 94 | <span class="min"><tal:t i18n:translate="">Min.</tal:t> |
---|
| 95 | <tal:c tal:content="atemp['min']"></tal:c>℃</span> |
---|
| 96 | <span class="avg"><tal:t i18n:translate="">Avg.</tal:t> |
---|
| 97 | <tal:c tal:content="atemp['avg']"></tal:c>℃</span> |
---|
| 98 | <span class="max"><tal:t i18n:translate="">Max.</tal:t> |
---|
| 99 | <tal:c tal:content="atemp['max']"></tal:c>℃</span> |
---|
[10c8e6e] | 100 | </li> |
---|
| 101 | </ul> |
---|
| 102 | </div> |
---|
| 103 | </div> |
---|
[5ec3a0b] | 104 | <!--! Track map --> |
---|
| 105 | <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 workout |
---|
| 113 | details, based on which data this workout has |
---|
| 114 | --> |
---|
| 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 | </metal:content> |
---|
| 129 | |
---|
| 130 | <metal:body-js metal:fill-slot="body-js"> |
---|
| 131 | |
---|
[4554843] | 132 | |
---|
[5ec3a0b] | 133 | <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script> |
---|
[4554843] | 134 | <!-- |
---|
[5ec3a0b] | 135 | <script src="${request.static_url('ow:static/d3/d3.min.js')}" |
---|
| 136 | tal:condition="context.has_gpx"></script> |
---|
| 137 | --> |
---|
| 138 | |
---|
| 139 | <script src="${request.static_url('ow:static/components/Leaflet/leaflet.js')}" |
---|
| 140 | tal:condition="context.has_gpx"></script> |
---|
| 141 | |
---|
[a0085a2] | 142 | <script src="${request.static_url('ow:static/components/leaflet-gpx/gpx.js')}" |
---|
| 143 | tal:condition="context.has_gpx"></script> |
---|
| 144 | |
---|
| 145 | <script src="${request.static_url('ow:static/components/Leaflet.Elevation/dist/leaflet.elevation-0.0.4.min.js')}" |
---|
[5ec3a0b] | 146 | tal:condition="context.has_gpx"></script> |
---|
| 147 | |
---|
| 148 | <script src="${request.static_url('ow:static/js/ow.js')}" |
---|
| 149 | tal:condition="context.has_gpx"></script> |
---|
| 150 | |
---|
| 151 | <script type="text/javascript" tal:condition="context.has_gpx"> |
---|
[4554843] | 152 | var workout_map = owjs.map({ |
---|
[d33326a] | 153 | map_id: 'map', |
---|
[4554843] | 154 | latitude: ${start_point['latitude']}, |
---|
| 155 | longitude: ${start_point['longitude']}, |
---|
| 156 | zoom: 11, |
---|
| 157 | gpx_url: '${request.resource_url(context, 'gpx')}', |
---|
[0c18869] | 158 | start_icon: '${request.static_url('ow:static/components/leaflet-gpx/pin-icon-start.png')}', |
---|
| 159 | end_icon: '${request.static_url('ow:static/components/leaflet-gpx/pin-icon-end.png')}', |
---|
| 160 | shadow: '${request.static_url('ow:static/components/leaflet-gpx/pin-shadow.png')}', |
---|
[d1c4782] | 161 | elevation: true, |
---|
| 162 | zoom_control: true |
---|
[4554843] | 163 | }); |
---|
| 164 | workout_map.render(); |
---|
[5ec3a0b] | 165 | </script> |
---|
| 166 | </metal:body-js> |
---|
| 167 | |
---|
| 168 | </html> |
---|