[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"> |
---|
| 58 | <li tal:condition="context.distance"> |
---|
| 59 | <span><tal:t i18n:translate="">Distance</tal:t></span> |
---|
| 60 | <tal:c tal:content="context.rounded_distance"></tal:c> km |
---|
| 61 | </li> |
---|
| 62 | <li> |
---|
| 63 | <span><tal:t i18n:translate="">Start</tal:t></span> |
---|
| 64 | <tal:c tal:content="context.start_in_timezone(timezone)"></tal:c> |
---|
| 65 | </li> |
---|
| 66 | <li> |
---|
| 67 | <span><tal:t i18n:translate="">End</tal:t></span> |
---|
| 68 | <tal:c tal:content="context.end_in_timezone(timezone)"></tal:c> |
---|
| 69 | </li> |
---|
| 70 | <li> |
---|
| 71 | <span><tal:t i18n:translate="">Duration</tal:t></span> |
---|
| 72 | <!--! use the properly formatted duration instead of the timedelta object --> |
---|
| 73 | <tal:c tal:content="context._duration"></tal:c> |
---|
| 74 | </li> |
---|
| 75 | <li tal:condition="context.speed"> |
---|
| 76 | <span><tal:t i18n:translate="">Speed</tal:t></span> |
---|
| 77 | <tal:t i18n:translate="">Avg.</tal:t> |
---|
| 78 | <tal:c tal:content="round(context.speed['avg'], 1)"></tal:c> km/h | |
---|
| 79 | <tal:t i18n:translate="">Max.</tal:t> |
---|
| 80 | <tal:c tal:content="round(context.speed['max'], 1)"></tal:c> km/h |
---|
| 81 | </li> |
---|
| 82 | <li tal:condition="hr"> |
---|
| 83 | <span><tal:t i18n:translate="">Heart Rate</tal:t></span> |
---|
| 84 | <tal:t i18n:translate="">Min.</tal:t> |
---|
| 85 | <tal:c tal:content="hr['min']"></tal:c> bpm | |
---|
| 86 | <tal:t i18n:translate="">Avg.</tal:t> |
---|
| 87 | <tal:c tal:content="hr['avg']"></tal:c> bpm | |
---|
| 88 | <tal:t i18n:translate="">Max.</tal:t> |
---|
| 89 | <tal:c tal:content="hr['max']"></tal:c> bpm |
---|
| 90 | </li> |
---|
| 91 | <li tal:condition="cad"> |
---|
| 92 | <span><tal:t i18n:translate="">Cadence</tal:t></span> |
---|
| 93 | <tal:t i18n:translate="">Min.</tal:t> |
---|
| 94 | <tal:c tal:content="cad['min']"></tal:c> | |
---|
| 95 | <tal:t i18n:translate="">Avg.</tal:t> |
---|
| 96 | <tal:c tal:content="cad['avg']"></tal:c> | |
---|
| 97 | <tal:t i18n:translate="">Max.</tal:t> |
---|
| 98 | <tal:c tal:content="cad['max']"></tal:c> |
---|
| 99 | </li> |
---|
| 100 | <li tal:condition="atemp"> |
---|
| 101 | <span><tal:t i18n:translate="">Temperature</tal:t></span> |
---|
| 102 | <tal:t i18n:translate="">Min.</tal:t> |
---|
| 103 | <tal:c tal:content="atemp['min']"></tal:c> | |
---|
| 104 | <tal:t i18n:translate="">Avg.</tal:t> |
---|
| 105 | <tal:c tal:content="atemp['avg']"></tal:c> | |
---|
| 106 | <tal:t i18n:translate="">Max.</tal:t> |
---|
| 107 | <tal:c tal:content="atemp['max']"></tal:c> |
---|
| 108 | </li> |
---|
| 109 | </ul> |
---|
| 110 | </div> |
---|
| 111 | </div> |
---|
[5ec3a0b] | 112 | <!--! Track map --> |
---|
| 113 | <div id="map" tal:condition="context.has_gpx"></div> |
---|
| 114 | |
---|
| 115 | <!--! Additional map controls --> |
---|
| 116 | |
---|
| 117 | <div id="ow-analysis"> |
---|
| 118 | |
---|
| 119 | <!--! |
---|
| 120 | FIXME: the list of available charts should come from the workout |
---|
| 121 | details, based on which data this workout has |
---|
| 122 | --> |
---|
| 123 | <!--! All those ids are needed for the leaflet openworkouts plugin --> |
---|
| 124 | <tal:r tal:repeat="chart ['elevation', 'heartrate', 'cadence', 'temperature']"> |
---|
| 125 | <div id="ow-" tal:attributes="id 'ow-' + chart"> |
---|
| 126 | <div class="ow-average" id="" |
---|
| 127 | tal:attributes="id 'ow-' + chart + '-average'"></div> |
---|
| 128 | <div class="ow-chart" id="" |
---|
| 129 | tal:attributes="id 'ow-' + chart + '-chart'"></div> |
---|
| 130 | <div class="ow-current" id="" |
---|
| 131 | tal:attributes="id 'ow-' + chart + '-current'"></div> |
---|
| 132 | </div> |
---|
| 133 | </tal:r> |
---|
| 134 | |
---|
| 135 | </div> |
---|
| 136 | </metal:content> |
---|
| 137 | |
---|
| 138 | <metal:body-js metal:fill-slot="body-js"> |
---|
| 139 | |
---|
[4554843] | 140 | |
---|
[5ec3a0b] | 141 | <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script> |
---|
[4554843] | 142 | <!-- |
---|
[5ec3a0b] | 143 | <script src="${request.static_url('ow:static/d3/d3.min.js')}" |
---|
| 144 | tal:condition="context.has_gpx"></script> |
---|
| 145 | --> |
---|
| 146 | |
---|
| 147 | <script src="${request.static_url('ow:static/components/Leaflet/leaflet.js')}" |
---|
| 148 | tal:condition="context.has_gpx"></script> |
---|
| 149 | |
---|
[a0085a2] | 150 | <script src="${request.static_url('ow:static/components/leaflet-gpx/gpx.js')}" |
---|
| 151 | tal:condition="context.has_gpx"></script> |
---|
| 152 | |
---|
| 153 | <script src="${request.static_url('ow:static/components/Leaflet.Elevation/dist/leaflet.elevation-0.0.4.min.js')}" |
---|
[5ec3a0b] | 154 | tal:condition="context.has_gpx"></script> |
---|
| 155 | |
---|
| 156 | <script src="${request.static_url('ow:static/js/ow.js')}" |
---|
| 157 | tal:condition="context.has_gpx"></script> |
---|
| 158 | |
---|
| 159 | <script type="text/javascript" tal:condition="context.has_gpx"> |
---|
[4554843] | 160 | var workout_map = owjs.map({ |
---|
[d33326a] | 161 | map_id: 'map', |
---|
[4554843] | 162 | latitude: ${start_point['latitude']}, |
---|
| 163 | longitude: ${start_point['longitude']}, |
---|
| 164 | zoom: 11, |
---|
| 165 | gpx_url: '${request.resource_url(context, 'gpx')}', |
---|
[0c18869] | 166 | start_icon: '${request.static_url('ow:static/components/leaflet-gpx/pin-icon-start.png')}', |
---|
| 167 | end_icon: '${request.static_url('ow:static/components/leaflet-gpx/pin-icon-end.png')}', |
---|
| 168 | shadow: '${request.static_url('ow:static/components/leaflet-gpx/pin-shadow.png')}', |
---|
[d1c4782] | 169 | elevation: true, |
---|
| 170 | zoom_control: true |
---|
[4554843] | 171 | }); |
---|
| 172 | workout_map.render(); |
---|
[5ec3a0b] | 173 | </script> |
---|
| 174 | </metal:body-js> |
---|
| 175 | |
---|
| 176 | </html> |
---|