[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 | |
---|
| 27 | <h2 tal:content="context.fullname"></h2> |
---|
| 28 | |
---|
[2d91474] | 29 | <h3> |
---|
| 30 | (<tal:n tal:content="len(workouts)"></tal:n>/<tal:n tal:content="context.num_workouts"></tal:n>) <tal:t i18n:translate="">workouts</tal:t> |
---|
| 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"> |
---|
| 57 | <li> |
---|
[31adfa5] | 58 | <tal:c tal:content="workout.start_in_timezone(context.timezone)"></tal:c> |
---|
[5ec3a0b] | 59 | </li> |
---|
| 60 | <li> |
---|
[64e8299] | 61 | <!--! use the properly formatted duration instead of the timedelta object --> |
---|
| 62 | <tal:c tal:content="workout._duration"></tal:c> |
---|
[5ec3a0b] | 63 | </li> |
---|
| 64 | <li tal:condition="workout.distance"> |
---|
| 65 | <tal:c tal:content="workout.rounded_distance"></tal:c> km |
---|
| 66 | </li> |
---|
| 67 | </ul> |
---|
| 68 | |
---|
| 69 | <ul class="workout-info" tal:define="hr workout.hr; cad workout.cad"> |
---|
| 70 | <li tal:condition="hr"> |
---|
| 71 | <span i18n:translate="">HR (bpm)</span>: |
---|
| 72 | <tal:c tal:content="hr['min']"></tal:c> |
---|
| 73 | <tal:t i18n:translate="">Min.</tal:t>, |
---|
| 74 | <tal:c tal:content="hr['avg']"></tal:c> |
---|
| 75 | <tal:t i18n:translate="">Avg.</tal:t>, |
---|
| 76 | <tal:c tal:content="hr['max']"></tal:c> |
---|
| 77 | <tal:t i18n:translate="">Max.</tal:t> |
---|
| 78 | </li> |
---|
| 79 | <li tal:condition="cad"> |
---|
| 80 | <span i18n:translate="">Cad</span>: |
---|
| 81 | <tal:c tal:content="cad['min']"></tal:c> |
---|
| 82 | <tal:t i18n:translate="">Min.</tal:t>, |
---|
| 83 | <tal:c tal:content="cad['avg']"></tal:c> |
---|
| 84 | <tal:t i18n:translate="">Avg.</tal:t>, |
---|
| 85 | <tal:c tal:content="cad['max']"></tal:c> |
---|
| 86 | <tal:t i18n:translate="">Max.</tal:t> |
---|
| 87 | </li> |
---|
| 88 | </ul> |
---|
| 89 | |
---|
| 90 | <div class="workout-intro" tal:content="workout.notes"></div> |
---|
| 91 | |
---|
| 92 | <ul class="workout-options"> |
---|
| 93 | <li class="owo-edit"><a href="" i18n:translate="" tal:attributes="href request.resource_url(workout, 'edit')"><span>edit</span></a></li> |
---|
| 94 | <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> |
---|
| 95 | <li class="owo-del"><a href="" i18n:translate="" tal:attributes="href request.resource_url(workout, 'delete')"><span>delete</span></a></li> |
---|
| 96 | </ul> |
---|
| 97 | |
---|
| 98 | </article> |
---|
| 99 | |
---|
| 100 | </tal:r> |
---|
| 101 | |
---|
| 102 | </section> |
---|
| 103 | |
---|
| 104 | <aside class="workout-aside"> |
---|
[2d91474] | 105 | <tal:activity_tree tal:condition="context.num_workouts > 0"> |
---|
| 106 | <ul class="workout-activity-tree" tal:define="tree context.activity_dates_tree"> |
---|
| 107 | <tal:years tal:repeat="year sorted(tree.keys(), reverse=True )"> |
---|
| 108 | <li tal:define="is_viewing_year year == viewing_year"> |
---|
| 109 | <a href="" tal:content="year" |
---|
| 110 | tal:attributes="href request.resource_url(context, query={'year': year}); |
---|
| 111 | class 'js-year viewing-year' if is_viewing_year else 'js-year'"> |
---|
| 112 | </a> |
---|
| 113 | <ul class="workout-activity-tree-year" |
---|
| 114 | tal:attributes="class 'workout-activity-tree-year' if is_viewing_year else 'workout-activity-tree-year hidden'"> |
---|
| 115 | <tal:months tal:repeat="month sorted(tree[year].keys())"> |
---|
| 116 | <li tal:define="is_viewing_month is_viewing_year and month == viewing_month"> |
---|
| 117 | <a href="" tal:content="month_name[month]" |
---|
| 118 | tal:attributes="href request.resource_url(context, query={'year': year, 'month': month}); |
---|
| 119 | class 'viewing-month' if is_viewing_month else ''"> |
---|
| 120 | </a> |
---|
| 121 | <ul class="workout-activity-tree-month"> |
---|
| 122 | <tal:sports tal:repeat="sport sorted(tree[year][month].keys())"> |
---|
| 123 | <li> |
---|
| 124 | <a href="#"> |
---|
| 125 | <tal:sport tal:content="sport"></tal:sport> (<tal:workouts tal:content="tree[year][month][sport]"></tal:workouts>) |
---|
| 126 | </a> |
---|
| 127 | </li> |
---|
| 128 | </tal:sports> |
---|
| 129 | </ul> |
---|
| 130 | </li> |
---|
| 131 | </tal:months> |
---|
| 132 | </ul> |
---|
| 133 | </li> |
---|
| 134 | </tal:years> |
---|
| 135 | </ul> |
---|
| 136 | </tal:activity_tree> |
---|
[5ec3a0b] | 137 | </aside> |
---|
| 138 | |
---|
| 139 | </div> |
---|
| 140 | |
---|
| 141 | </metal:content> |
---|
| 142 | |
---|
| 143 | </html> |
---|