source: OpenWorkouts-current/ow/templates/dashboard.pt @ 2d2eb0d

currentfeature/docs
Last change on this file since 2d2eb0d was 2d2eb0d, checked in by Segundo Fdez <segun.2@…>, 5 years ago

Merge branch 'master' into feature/ui

# Conflicts:

  • Property mode set to 100644
File size: 6.6 KB
Line 
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        <h3>
28           <tal:n tal:content="len(workouts)"></tal:n> <tal:t i18n:translate="">Activities</tal:t>
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">
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>
56                <tal:c tal:content="workout.start_in_timezone(context.timezone)"></tal:c>
57              </li>
58              <li>
59                <!--! use the properly formatted duration instead of the timedelta object -->
60                <tal:c tal:content="workout._duration"></tal:c>
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            <div class="workout-map" tal:condition="workout.has_gpx">
91                <a href="" tal:attributes="href request.resource_url(workout)">
92                    <img src="" tal:attributes="src request.static_url(workout.map_screenshot);
93                              alt workout.title; title workout.title">
94                </a>
95            </div>
96
97            <ul class="workout-options">
98              <li class="owo-edit"><a href="" i18n:translate="" tal:attributes="href request.resource_url(workout, 'edit')"><span>edit</span></a></li>
99              <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>
100              <li class="owo-del"><a href="" i18n:translate="" tal:attributes="href request.resource_url(workout, 'delete')"><span>delete</span></a></li>
101            </ul>
102
103          </article>
104
105        </tal:r>
106
107      </section>
108
109      <aside class="workout-aside">
110      <div class="aside-profile">
111        <tal:c tal:condition="getattr(context, 'picture', None)">
112          <img tal:attributes="src request.resource_path(context, 'picture')"
113               width="450" />
114        </tal:c>
115        <h2 tal:content="context.fullname"></h2>
116        <ul>
117          <Li>
118            <tal:n tal:content="context.num_workouts"></tal:n> <tal:t i18n:translate="">workouts</tal:t>
119          </Li>
120        </ul>
121      </div>
122          <tal:activity_tree tal:condition="context.num_workouts > 0">
123              <ul class="workout-activity-tree" tal:define="tree context.activity_dates_tree">
124                  <tal:years tal:repeat="year sorted(tree.keys(), reverse=True )">
125                      <li tal:define="is_viewing_year year == viewing_year">
126                          <a href="" tal:content="year"
127                             tal:attributes="href request.resource_url(context, query={'year': year});
128                                             class 'js-year viewing-year' if is_viewing_year  else 'js-year'">
129                          </a>
130                          <ul class="workout-activity-tree-year"
131                              tal:attributes="class 'workout-activity-tree-year' if is_viewing_year  else 'workout-activity-tree-year hidden'">
132                              <tal:months tal:repeat="month sorted(tree[year].keys())">
133                                  <li tal:define="is_viewing_month is_viewing_year and month == viewing_month">
134                                      <a href=""
135                                         tal:attributes="href request.resource_url(context, query={'year': year, 'month': month});
136                                                         class 'viewing-month' if is_viewing_month else ''">
137                                           <span tal:content="month_name[month]"></span>
138                                           <span tal:content="sum([tree[year][month][sport] for sport in tree[year][month]])"></span>
139                                      </a>
140                                  </li>
141                              </tal:months>
142                          </ul>
143                      </li>
144                  </tal:years>
145              </ul>
146          </tal:activity_tree>
147      </aside>
148
149    </div>
150
151  </metal:content>
152
153</html>
Note: See TracBrowser for help on using the repository browser.