[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 | |
---|
[2d91474] | 27 | <h3> |
---|
[5cbc4a0] | 28 | <tal:n tal:content="len(workouts)"></tal:n> <tal:t i18n:translate="">Activities</tal:t> |
---|
[2d91474] | 29 | </h3> |
---|
| 30 | |
---|
| 31 | <tal:no-workouts tal:condition="context.num_workouts == 0"> |
---|
| 32 | <div class="warning"> |
---|
| 33 | <p i18n:translate="">You haven't added any workouts yet</p> |
---|
| 34 | <p> |
---|
| 35 | <a href="" i18n:translate="" |
---|
| 36 | tal:attributes="href request.resource_url(context, 'add-workout')"> |
---|
| 37 | Upload one</a> | |
---|
| 38 | <a href="" i18n:translate="" |
---|
| 39 | tal:attributes="href request.resource_url(context, 'add-workout-manually')"> |
---|
| 40 | Add one manually</a> |
---|
| 41 | </p> |
---|
| 42 | </div> |
---|
| 43 | </tal:no-workouts> |
---|
| 44 | |
---|
| 45 | <tal:r tal:repeat="workout workouts"> |
---|
[5ec3a0b] | 46 | |
---|
| 47 | <article class="workout-resume"> |
---|
| 48 | |
---|
| 49 | <h2 class="workout-title"> |
---|
| 50 | <a href="" tal:content="workout.title" |
---|
| 51 | tal:attributes="href request.resource_url(workout)"></a> |
---|
| 52 | </h2> |
---|
| 53 | |
---|
| 54 | <ul class="workout-info"> |
---|
| 55 | <li> |
---|
[31adfa5] | 56 | <tal:c tal:content="workout.start_in_timezone(context.timezone)"></tal:c> |
---|
[5ec3a0b] | 57 | </li> |
---|
| 58 | <li> |
---|
[64e8299] | 59 | <!--! use the properly formatted duration instead of the timedelta object --> |
---|
| 60 | <tal:c tal:content="workout._duration"></tal:c> |
---|
[5ec3a0b] | 61 | </li> |
---|
| 62 | <li tal:condition="workout.distance"> |
---|
| 63 | <tal:c tal:content="workout.rounded_distance"></tal:c> km |
---|
| 64 | </li> |
---|
| 65 | </ul> |
---|
| 66 | |
---|
| 67 | <ul class="workout-info" tal:define="hr workout.hr; cad workout.cad"> |
---|
| 68 | <li tal:condition="hr"> |
---|
| 69 | <span i18n:translate="">HR (bpm)</span>: |
---|
| 70 | <tal:c tal:content="hr['min']"></tal:c> |
---|
| 71 | <tal:t i18n:translate="">Min.</tal:t>, |
---|
| 72 | <tal:c tal:content="hr['avg']"></tal:c> |
---|
| 73 | <tal:t i18n:translate="">Avg.</tal:t>, |
---|
| 74 | <tal:c tal:content="hr['max']"></tal:c> |
---|
| 75 | <tal:t i18n:translate="">Max.</tal:t> |
---|
| 76 | </li> |
---|
| 77 | <li tal:condition="cad"> |
---|
| 78 | <span i18n:translate="">Cad</span>: |
---|
| 79 | <tal:c tal:content="cad['min']"></tal:c> |
---|
| 80 | <tal:t i18n:translate="">Min.</tal:t>, |
---|
| 81 | <tal:c tal:content="cad['avg']"></tal:c> |
---|
| 82 | <tal:t i18n:translate="">Avg.</tal:t>, |
---|
| 83 | <tal:c tal:content="cad['max']"></tal:c> |
---|
| 84 | <tal:t i18n:translate="">Max.</tal:t> |
---|
| 85 | </li> |
---|
| 86 | </ul> |
---|
| 87 | |
---|
| 88 | <div class="workout-intro" tal:content="workout.notes"></div> |
---|
| 89 | |
---|
| 90 | <ul class="workout-options"> |
---|
| 91 | <li class="owo-edit"><a href="" i18n:translate="" tal:attributes="href request.resource_url(workout, 'edit')"><span>edit</span></a></li> |
---|
| 92 | <li class="owo-update"><a href="" i18n:translate="" tal:attributes="href request.resource_url(workout, 'update-from-file')"><span>update with tracking file</span></a></li> |
---|
| 93 | <li class="owo-del"><a href="" i18n:translate="" tal:attributes="href request.resource_url(workout, 'delete')"><span>delete</span></a></li> |
---|
| 94 | </ul> |
---|
| 95 | |
---|
| 96 | </article> |
---|
| 97 | |
---|
| 98 | </tal:r> |
---|
| 99 | |
---|
| 100 | </section> |
---|
| 101 | |
---|
| 102 | <aside class="workout-aside"> |
---|
[5cbc4a0] | 103 | <div class="aside-profile"> |
---|
| 104 | <tal:c tal:condition="getattr(context, 'picture', None)"> |
---|
| 105 | <img tal:attributes="src request.resource_path(context, 'picture')" |
---|
| 106 | width="450" /> |
---|
| 107 | </tal:c> |
---|
| 108 | <h2 tal:content="context.fullname"></h2> |
---|
| 109 | <ul> |
---|
| 110 | <Li> |
---|
| 111 | <tal:n tal:content="context.num_workouts"></tal:n> <tal:t i18n:translate="">workouts</tal:t> |
---|
| 112 | </Li> |
---|
| 113 | </ul> |
---|
| 114 | </div> |
---|
[2d91474] | 115 | <tal:activity_tree tal:condition="context.num_workouts > 0"> |
---|
| 116 | <ul class="workout-activity-tree" tal:define="tree context.activity_dates_tree"> |
---|
| 117 | <tal:years tal:repeat="year sorted(tree.keys(), reverse=True )"> |
---|
| 118 | <li tal:define="is_viewing_year year == viewing_year"> |
---|
| 119 | <a href="" tal:content="year" |
---|
| 120 | tal:attributes="href request.resource_url(context, query={'year': year}); |
---|
| 121 | class 'js-year viewing-year' if is_viewing_year else 'js-year'"> |
---|
| 122 | </a> |
---|
| 123 | <ul class="workout-activity-tree-year" |
---|
| 124 | tal:attributes="class 'workout-activity-tree-year' if is_viewing_year else 'workout-activity-tree-year hidden'"> |
---|
| 125 | <tal:months tal:repeat="month sorted(tree[year].keys())"> |
---|
| 126 | <li tal:define="is_viewing_month is_viewing_year and month == viewing_month"> |
---|
[5cbc4a0] | 127 | <a href="" |
---|
[2d91474] | 128 | tal:attributes="href request.resource_url(context, query={'year': year, 'month': month}); |
---|
| 129 | class 'viewing-month' if is_viewing_month else ''"> |
---|
[5cbc4a0] | 130 | <span tal:content="month_name[month]"></span> |
---|
| 131 | <span tal:content="sum([tree[year][month][sport] for sport in tree[year][month]])"></span> |
---|
[2d91474] | 132 | </a> |
---|
| 133 | </li> |
---|
| 134 | </tal:months> |
---|
| 135 | </ul> |
---|
| 136 | </li> |
---|
| 137 | </tal:years> |
---|
| 138 | </ul> |
---|
| 139 | </tal:activity_tree> |
---|
[5ec3a0b] | 140 | </aside> |
---|
| 141 | |
---|
| 142 | </div> |
---|
| 143 | |
---|
| 144 | </metal:content> |
---|
| 145 | |
---|
| 146 | </html> |
---|