[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="">My dashboard</tal:t> |
---|
| 12 | </metal:head-title> |
---|
| 13 | |
---|
| 14 | <!--! |
---|
| 15 | <metal:title metal:fill-slot="title"> |
---|
| 16 | <tal:t i18n:translate="">dashboard for user</tal:t> |
---|
| 17 | <tal:user tal:content="context.fullname"></tal:user> |
---|
| 18 | </metal:title> |
---|
| 19 | --> |
---|
| 20 | |
---|
| 21 | <metal:content metal:fill-slot="content"> |
---|
| 22 | |
---|
| 23 | <div class="workout-content"> |
---|
| 24 | |
---|
| 25 | <section class="workout-list"> |
---|
| 26 | |
---|
[be56db9] | 27 | <h3 tal:condition="viewing_month is not None"> |
---|
[b437d1e] | 28 | <tal:d tal:content="month_name[viewing_month] + ' ' + str(viewing_year)"></tal:d> - |
---|
| 29 | <tal:n tal:content="len(workouts)"></tal:n> |
---|
| 30 | <tal:t i18n:translate="">Workouts</tal:t> |
---|
[2d91474] | 31 | </h3> |
---|
| 32 | |
---|
| 33 | <tal:no-workouts tal:condition="context.num_workouts == 0"> |
---|
| 34 | <div class="warning"> |
---|
| 35 | <p i18n:translate="">You haven't added any workouts yet</p> |
---|
| 36 | <p> |
---|
| 37 | <a href="" i18n:translate="" |
---|
| 38 | tal:attributes="href request.resource_url(context, 'add-workout')"> |
---|
| 39 | Upload one</a> | |
---|
| 40 | <a href="" i18n:translate="" |
---|
| 41 | tal:attributes="href request.resource_url(context, 'add-workout-manually')"> |
---|
| 42 | Add one manually</a> |
---|
| 43 | </p> |
---|
| 44 | </div> |
---|
| 45 | </tal:no-workouts> |
---|
| 46 | |
---|
| 47 | <tal:r tal:repeat="workout workouts"> |
---|
[5ec3a0b] | 48 | |
---|
| 49 | <article class="workout-resume"> |
---|
| 50 | |
---|
| 51 | <h2 class="workout-title"> |
---|
| 52 | <a href="" tal:content="workout.title" |
---|
| 53 | tal:attributes="href request.resource_url(workout)"></a> |
---|
| 54 | </h2> |
---|
| 55 | |
---|
| 56 | <ul class="workout-info"> |
---|
[d7a9df5] | 57 | <li> |
---|
| 58 | <tal:c tal:content="workout.sport"></tal:c> |
---|
| 59 | </li> |
---|
[5ec3a0b] | 60 | <li> |
---|
[31adfa5] | 61 | <tal:c tal:content="workout.start_in_timezone(context.timezone)"></tal:c> |
---|
[5ec3a0b] | 62 | </li> |
---|
| 63 | <li> |
---|
[64e8299] | 64 | <!--! use the properly formatted duration instead of the timedelta object --> |
---|
| 65 | <tal:c tal:content="workout._duration"></tal:c> |
---|
[5ec3a0b] | 66 | </li> |
---|
| 67 | <li tal:condition="workout.distance"> |
---|
| 68 | <tal:c tal:content="workout.rounded_distance"></tal:c> km |
---|
| 69 | </li> |
---|
[4985618] | 70 | <li tal:condition="workout.uphill"> |
---|
| 71 | +<tal:c tal:content="workout.uphill"></tal:c> m |
---|
| 72 | </li> |
---|
[5ec3a0b] | 73 | </ul> |
---|
| 74 | |
---|
[d7a9df5] | 75 | <div class="workout-intro"> |
---|
| 76 | <p tal:repeat="paragraph workout.trimmed_notes.split('\n')" |
---|
| 77 | tal:content="paragraph"></p> |
---|
| 78 | </div> |
---|
[5ec3a0b] | 79 | |
---|
[d1c4782] | 80 | <div class="workout-map" tal:condition="workout.has_gpx"> |
---|
| 81 | <a href="" tal:attributes="href request.resource_url(workout)"> |
---|
| 82 | <img src="" tal:attributes="src request.static_url(workout.map_screenshot); |
---|
| 83 | alt workout.title; title workout.title"> |
---|
| 84 | </a> |
---|
| 85 | </div> |
---|
| 86 | |
---|
[5ec3a0b] | 87 | </article> |
---|
| 88 | |
---|
| 89 | </tal:r> |
---|
| 90 | |
---|
| 91 | </section> |
---|
| 92 | |
---|
| 93 | <aside class="workout-aside"> |
---|
[1fe89ea] | 94 | <div class="aside-profile"> |
---|
| 95 | <tal:c tal:condition="getattr(context, 'picture', None)"> |
---|
[aa2130b] | 96 | <a href="" tal:attributes="href request.resource_url(context, 'profile')"> |
---|
| 97 | <img tal:attributes="src request.resource_path(context, 'picture')" |
---|
| 98 | width="450" /> |
---|
| 99 | </a> |
---|
[1fe89ea] | 100 | </tal:c> |
---|
[aa2130b] | 101 | <h2> |
---|
| 102 | <a href="" tal:attributes="href request.resource_url(context, 'profile')" |
---|
| 103 | tal:content="context.fullname"> |
---|
| 104 | </a> |
---|
| 105 | </h2> |
---|
[1fe89ea] | 106 | <ul> |
---|
[bd367d6] | 107 | <li> |
---|
[1fe89ea] | 108 | <tal:n tal:content="context.num_workouts"></tal:n> <tal:t i18n:translate="">workouts</tal:t> |
---|
[bd367d6] | 109 | </li> |
---|
[1fe89ea] | 110 | </ul> |
---|
| 111 | </div> |
---|
| 112 | <div class="week-stats js-week-stats"> |
---|
| 113 | <h3><tal:t i18n:translate="">This week</tal:t></h3> |
---|
| 114 | <p tal:define="totals context.week_totals"> |
---|
| 115 | <span class="week-stats-distance"> |
---|
| 116 | <tal:d tal:content="round(totals['distance'])"></tal:d> |
---|
[6662a84] | 117 | <tal:t i18n:translate="">kms</tal:t> | |
---|
[1fe89ea] | 118 | </span> |
---|
| 119 | <span class="week-stats-time"> |
---|
| 120 | <tal:hms tal:define="hms timedelta_to_hms(totals['time'])"> |
---|
| 121 | <tal:h tal:content="str(hms[0]).zfill(2)"></tal:h> |
---|
| 122 | <tal:t i18n:translate="">hours</tal:t>, |
---|
| 123 | <tal:h tal:content="str(hms[1]).zfill(2)"></tal:h> |
---|
| 124 | <tal:t i18n:translate="">min.</tal:t> |
---|
| 125 | </tal:hms> |
---|
| 126 | </span> |
---|
| 127 | </p> |
---|
| 128 | <div class="svg-cotent"> |
---|
| 129 | <svg width="300" height="200" viewBox="0 0 300 200"></svg> |
---|
| 130 | </div> |
---|
| 131 | </div> |
---|
| 132 | |
---|
[2d91474] | 133 | <tal:activity_tree tal:condition="context.num_workouts > 0"> |
---|
| 134 | <ul class="workout-activity-tree" tal:define="tree context.activity_dates_tree"> |
---|
| 135 | <tal:years tal:repeat="year sorted(tree.keys(), reverse=True )"> |
---|
| 136 | <li tal:define="is_viewing_year year == viewing_year"> |
---|
| 137 | <a href="" tal:content="year" |
---|
| 138 | tal:attributes="href request.resource_url(context, query={'year': year}); |
---|
| 139 | class 'js-year viewing-year' if is_viewing_year else 'js-year'"> |
---|
| 140 | </a> |
---|
[1fe89ea] | 141 | <ul tal:define="stats context.stats(year)" tal:attributes="class 'workout-activity-summary' if is_viewing_year else 'workout-activity-summary hidden'"> |
---|
| 142 | <li> |
---|
| 143 | <span i18n:translate="">Workouts:</span> |
---|
| 144 | <span tal:content="stats['workouts']"></span> |
---|
| 145 | </li> |
---|
| 146 | <li> |
---|
| 147 | <span i18n:translate="">Distance:</span> |
---|
| 148 | <span> <tal:kms tal:content="round(stats['distance'])"></tal:kms> km</span> |
---|
| 149 | </li> |
---|
| 150 | <li> |
---|
| 151 | <span i18n:translate="">Time:</span> |
---|
| 152 | <tal:hms tal:define="hms timedelta_to_hms(stats['time'])"> |
---|
| 153 | <span> |
---|
| 154 | <tal:h tal:content="str(hms[0]).zfill(2)"></tal:h> |
---|
| 155 | <tal:t i18n:translate="">hours</tal:t>, |
---|
| 156 | <tal:h tal:content="str(hms[1]).zfill(2)"></tal:h> |
---|
| 157 | <tal:t i18n:translate="">min.</tal:t> |
---|
| 158 | </span> |
---|
| 159 | </tal:hms> |
---|
| 160 | </li> |
---|
| 161 | <li> |
---|
| 162 | <span i18n:translate="">Elevation:</span> |
---|
| 163 | <span> <tal:m tal:content="stats['elevation']"></tal:m> m</span> |
---|
| 164 | </li> |
---|
| 165 | </ul> |
---|
[2d91474] | 166 | <ul class="workout-activity-tree-year" |
---|
| 167 | tal:attributes="class 'workout-activity-tree-year' if is_viewing_year else 'workout-activity-tree-year hidden'"> |
---|
| 168 | <tal:months tal:repeat="month sorted(tree[year].keys())"> |
---|
| 169 | <li tal:define="is_viewing_month is_viewing_year and month == viewing_month"> |
---|
[5cbc4a0] | 170 | <a href="" |
---|
[2d91474] | 171 | tal:attributes="href request.resource_url(context, query={'year': year, 'month': month}); |
---|
| 172 | class 'viewing-month' if is_viewing_month else ''"> |
---|
[5cbc4a0] | 173 | <span tal:content="month_name[month]"></span> |
---|
| 174 | <span tal:content="sum([tree[year][month][sport] for sport in tree[year][month]])"></span> |
---|
[2d91474] | 175 | </a> |
---|
| 176 | </li> |
---|
| 177 | </tal:months> |
---|
| 178 | </ul> |
---|
| 179 | </li> |
---|
| 180 | </tal:years> |
---|
| 181 | </ul> |
---|
| 182 | </tal:activity_tree> |
---|
[5bdfbfb] | 183 | |
---|
[5ec3a0b] | 184 | </aside> |
---|
| 185 | |
---|
| 186 | </div> |
---|
| 187 | |
---|
| 188 | </metal:content> |
---|
| 189 | |
---|
[5bdfbfb] | 190 | <metal:body-js metal:fill-slot="body-js"> |
---|
| 191 | <script src="${request.static_url('ow:static/components/d3/d3.min.js')}"></script> |
---|
| 192 | <script src="${request.static_url('ow:static/js/ow.js')}"></script> |
---|
| 193 | |
---|
| 194 | <script type="text/javascript"> |
---|
| 195 | var week_chart = owjs.week_chart({ |
---|
[4bab6c1] | 196 | chart_selector: 'div.js-week-stats svg', |
---|
[5bdfbfb] | 197 | url: "${request.resource_url(context, 'week')}", |
---|
| 198 | current_day_name: "${current_day_name}" |
---|
| 199 | }); |
---|
| 200 | week_chart.render(); |
---|
| 201 | </script> |
---|
| 202 | |
---|
| 203 | </metal:body-js> |
---|
| 204 | |
---|
[5ec3a0b] | 205 | </html> |
---|