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 profile</tal:t> |
---|
12 | </metal:head-title> |
---|
13 | |
---|
14 | <metal:content metal:fill-slot="content"> |
---|
15 | |
---|
16 | <div class="user-profile"> |
---|
17 | <div class="user-profile-account"> |
---|
18 | <div> |
---|
19 | <tal:c tal:condition="getattr(context, 'picture', None)"> |
---|
20 | <img tal:attributes="src request.resource_path(context, 'picture')" |
---|
21 | width="450" /> |
---|
22 | </tal:c> |
---|
23 | <div> |
---|
24 | <h2> |
---|
25 | <tal:fullname tal:content="context.fullname"></tal:fullname> |
---|
26 | </h2> |
---|
27 | <p> |
---|
28 | <tal:has-nickname tal:condition="context.nickname"> |
---|
29 | <tal:nickname tal:content="context.nickname"></tal:nickname> |
---|
30 | </tal:has-nickname> | |
---|
31 | <span><tal:email tal:content="context.email"></tal:email></span> |
---|
32 | </p> |
---|
33 | <div class="profile-bio"> |
---|
34 | <p tal:repeat="paragraph getattr(context, 'bio', '').split('\n')" |
---|
35 | tal:content="paragraph"></p> |
---|
36 | </div> |
---|
37 | <ul class="workout-options"> |
---|
38 | <li><a href="" |
---|
39 | tal:attributes="href request.resource_url(context, 'edit')" |
---|
40 | i18n:translate="">edit profile</a></li> |
---|
41 | <li><a href="" |
---|
42 | tal:attributes="href request.resource_url(context, 'passwd')" |
---|
43 | i18n:translate="">change password</a></li> |
---|
44 | </ul> |
---|
45 | </div> |
---|
46 | </div> |
---|
47 | |
---|
48 | </div> |
---|
49 | |
---|
50 | <div class="workout-content"> |
---|
51 | <div class="workout-list"> |
---|
52 | <div class="total-workouts"> |
---|
53 | <span> |
---|
54 | <tal:w tal:replace="len(workouts)"></tal:w> |
---|
55 | <tal:t i18n:translate="">workouts</tal:t> |
---|
56 | </span> |
---|
57 | <span> |
---|
58 | <tal:hms tal:define="hms timedelta_to_hms(totals['time'])"> |
---|
59 | <tal:h tal:content="str(hms[0]).zfill(2)"></tal:h> |
---|
60 | <tal:t i18n:translate="">hours</tal:t>, |
---|
61 | <tal:h tal:content="str(hms[1]).zfill(2)"></tal:h> |
---|
62 | <tal:t i18n:translate="">min.</tal:t> |
---|
63 | </tal:hms> |
---|
64 | </span> |
---|
65 | <span> |
---|
66 | <tal:w tal:replace="round(totals['distance'])"></tal:w> |
---|
67 | <tal:t i18n:translate="">km</tal:t> |
---|
68 | </span> |
---|
69 | <span> |
---|
70 | <tal:w tal:replace="round(totals['elevation'])"></tal:w> |
---|
71 | <tal:t i18n:translate="">m</tal:t> |
---|
72 | </span> |
---|
73 | </div> |
---|
74 | |
---|
75 | <div class="month-stats js-month-stats"> |
---|
76 | <div class="svg-cotent"> |
---|
77 | <svg width="900" height="180" viewBox="0 0 900 180"></svg> |
---|
78 | </div> |
---|
79 | <div class="center"> |
---|
80 | <ul class="workout-options filters js-filters"> |
---|
81 | <li><a href="#" class="js-distance is-active" i18n:translate="">distance</a></li> |
---|
82 | <li><a href="#" class="js-time" i18n:translate="">time</a></li> |
---|
83 | <li><a href="#" class="js-elevation" i18n:translate="">elevation</a></li> |
---|
84 | </ul> |
---|
85 | |
---|
86 | <ul class="workout-options switcher js-switcher"> |
---|
87 | <li><a href="#" class="js-weekly" i18n:translate="">weekly</a></li> |
---|
88 | <li><a href="#" class="js-monthly is-active" i18n:translate="">monthly</a></li> |
---|
89 | </ul> |
---|
90 | </div> |
---|
91 | </div> |
---|
92 | |
---|
93 | |
---|
94 | <tal:r tal:repeat="workout workouts"> |
---|
95 | |
---|
96 | <article class="workout-resume"> |
---|
97 | |
---|
98 | <h2 class="workout-title"> |
---|
99 | <a href="" tal:content="workout.title" |
---|
100 | tal:attributes="href request.resource_url(workout)"></a> |
---|
101 | </h2> |
---|
102 | |
---|
103 | <ul class="workout-info"> |
---|
104 | <li> |
---|
105 | <tal:c tal:content="workout.start_in_timezone(context.timezone)"></tal:c> |
---|
106 | </li> |
---|
107 | <li> |
---|
108 | <!--! use the properly formatted duration instead of the timedelta object --> |
---|
109 | <tal:c tal:content="workout._duration"></tal:c> |
---|
110 | </li> |
---|
111 | <li tal:condition="workout.distance"> |
---|
112 | <tal:c tal:content="workout.rounded_distance"></tal:c> km |
---|
113 | </li> |
---|
114 | <li tal:condition="workout.uphill"> |
---|
115 | +<tal:c tal:content="workout.uphill"></tal:c> m |
---|
116 | </li> |
---|
117 | </ul> |
---|
118 | |
---|
119 | <ul class="workout-info" tal:define="hr workout.hr; cad workout.cad"> |
---|
120 | <li tal:condition="hr"> |
---|
121 | <span i18n:translate="">HR (bpm)</span>: |
---|
122 | <tal:c tal:content="hr['avg']"></tal:c> |
---|
123 | <tal:t i18n:translate="">Avg.</tal:t>, |
---|
124 | <tal:c tal:content="hr['max']"></tal:c> |
---|
125 | <tal:t i18n:translate="">Max.</tal:t> |
---|
126 | </li> |
---|
127 | <li tal:condition="cad"> |
---|
128 | <span i18n:translate="">Cad</span>: |
---|
129 | <tal:c tal:content="cad['avg']"></tal:c> |
---|
130 | <tal:t i18n:translate="">Avg.</tal:t>, |
---|
131 | <tal:c tal:content="cad['max']"></tal:c> |
---|
132 | <tal:t i18n:translate="">Max.</tal:t> |
---|
133 | </li> |
---|
134 | </ul> |
---|
135 | |
---|
136 | <div class="workout-intro"> |
---|
137 | <p tal:repeat="paragraph workout.notes.split('\n')" |
---|
138 | tal:content="paragraph"></p> |
---|
139 | </div> |
---|
140 | |
---|
141 | <div class="workout-map" tal:condition="workout.has_gpx"> |
---|
142 | <a href="" tal:attributes="href request.resource_url(workout)"> |
---|
143 | <img src="" tal:attributes="src request.static_url(workout.map_screenshot); |
---|
144 | alt workout.title; title workout.title"> |
---|
145 | </a> |
---|
146 | </div> |
---|
147 | |
---|
148 | </article> |
---|
149 | |
---|
150 | </tal:r> |
---|
151 | </div> |
---|
152 | |
---|
153 | <div class="workout-aside"> |
---|
154 | <ul class="profile-data"> |
---|
155 | <li> |
---|
156 | <span><tal:t i18n:translate="">Gender:</tal:t></span> |
---|
157 | <tal:c tal:content="getattr(context, 'gender', '-')"></tal:c> |
---|
158 | </li> |
---|
159 | <li tal:define="birth_date getattr(context, 'birth_date', None)"> |
---|
160 | <span><tal:t i18n:translate="">Birth date:</tal:t></span> |
---|
161 | <tal:c tal:condition="birth_date" |
---|
162 | tal:content="birth_date.strftime('%d/%m/%Y')"></tal:c> |
---|
163 | <tal:c tal:condition="birth_date is None">-</tal:c> |
---|
164 | </li> |
---|
165 | <li> |
---|
166 | <span><tal:t i18n:translate="">Height:</tal:t></span> |
---|
167 | <tal:c tal:content="getattr(context, 'height', '-')"></tal:c> meters |
---|
168 | </li> |
---|
169 | <li> |
---|
170 | <span><tal:t i18n:translate="">Weight:</tal:t></span> |
---|
171 | <tal:c tal:content="getattr(context, 'weight', '-')"></tal:c> kg |
---|
172 | </li> |
---|
173 | </ul> |
---|
174 | </div> |
---|
175 | </div> |
---|
176 | </div> |
---|
177 | |
---|
178 | </metal:content> |
---|
179 | |
---|
180 | <metal:body-js metal:fill-slot="body-js"> |
---|
181 | |
---|
182 | <script src="${request.static_url('ow:static/components/d3/d3.min.js')}"></script> |
---|
183 | <script src="${request.static_url('ow:static/js/ow.js')}"></script> |
---|
184 | |
---|
185 | <script type="text/javascript"> |
---|
186 | var y_axis_labels = { |
---|
187 | "distance": "Kilometers", |
---|
188 | "time": "Hours", |
---|
189 | "elevation": "Meters" |
---|
190 | }; |
---|
191 | |
---|
192 | var year_chart = owjs.year_chart({ |
---|
193 | chart_selector: '.js-month-stats svg', |
---|
194 | filters_selector: '.js-month-stats .js-filters a', |
---|
195 | switcher_selector: '.js-month-stats .js-switcher a', |
---|
196 | is_active_class: 'is-active', |
---|
197 | urls: {"monthly": "${request.resource_url(context, 'monthly')}", |
---|
198 | "weekly": "${request.resource_url(context, 'weekly')}"}, |
---|
199 | current_month: "${current_month}", |
---|
200 | current_week: "${current_week}", |
---|
201 | y_axis_labels: y_axis_labels, |
---|
202 | filter_by: "distance", |
---|
203 | url: "${'monthly' if current_week is None else 'weekly'}", |
---|
204 | }); |
---|
205 | year_chart.render("distance", "${'monthly' if current_week is None else 'weekly'}"); |
---|
206 | year_chart.filters_setup(); |
---|
207 | year_chart.switcher_setup(); |
---|
208 | </script> |
---|
209 | |
---|
210 | </metal:body-js> |
---|
211 | |
---|
212 | </html> |
---|