source: OpenWorkouts-current/ow/templates/update_workout_from_file.pt @ c081c35

current
Last change on this file since c081c35 was c081c35, checked in by Borja Lopez <borja@…>, 5 years ago

(#84) Added the loading spinner to the "update workout from tracking file" page.

  • Property mode set to 100644
File size: 3.4 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="">Update workout from file</tal:t> -
12    <tal:w tal:content="context.title"></tal:w>
13  </metal:head-title>
14
15  <metal:title metal:fill-slot="title">
16    <tal:t i18n:translate="">Update workout from file</tal:t>
17    <tal:w tal:content="context.title"></tal:w>
18  </metal:title>
19
20  <metal:content metal:fill-slot="content">
21
22    <div class="uploading-workout hidden">
23      <h2 i18n:translate="">Uploading workout, please wait...</h2>
24      <p i18n:translate="">
25        This can take a moment, depending on the size of your tracking file and your connection speed. Be patient and please don't hit the stop or go back buttons on your browser.
26      </p>
27      <img src="" alt="Loading workout" i18n:attributes="alt"
28           tal:attributes="src request.static_url('ow:static/media/img/loading.gif')">
29    </div>
30
31    <div id="update_workout_file" class="ow-forms">
32
33      <a class="back" href="" tal:attributes="href request.resource_url(context)"
34         i18n:translate="">Back</a>
35
36      ${form.begin(multipart=True)}
37      ${form.csrf_token()}
38
39      <h2 tal:content="context.title"></h2>
40
41      <div tal:condition="context.has_tracking_file">
42
43        <h3 i18n:translate="">
44          Existing
45          <tal:filetype i18n:name="filetype"
46                        tal:content="context.tracking_filetype"></tal:filetype>
47          tracking file data
48        </h3>
49
50        <ul class="workout-activity-summary" id=""
51            tal:attributes="id 'workout-' + context.workout_id + '-details'"
52            tal:define="timezone request.root[request.authenticated_userid].timezone">
53          <li>
54            <tal:t i18n:translate="">Start:</tal:t>
55            <tal:c tal:content="context.start_in_timezone(timezone)"></tal:c>
56          </li>
57          <li>
58            <tal:t i18n:translate="">Duration:</tal:t>
59            <tal:c tal:content="context._duration"></tal:c>
60          </li>
61          <li>
62            <tal:t i18n:translate="">Distance:</tal:t>
63            <tal:c tal:content="context.rounded_distance"></tal:c>
64          </li>
65        </ul>
66        <div id="" tal:content="context.notes"
67             tal:attributes="id 'workout-' + context.workout_id + '-notes'">
68        </div>
69      </div>
70
71      <fieldset>
72        ${form.errorlist('tracking_file')}
73        <div>
74          <label for="notes" i18n:translate="">Workout file (gpx, fit):</label>
75          ${form.file('tracking_file')}
76        </div>
77      </fieldset>
78
79      <tal:with-localizer tal:define="localizer get_localizer(request)">
80        ${form.submit("submit", localizer.translate(_('Save')),  **{'class':"button button-normal"})}
81      </tal:with-localizer>
82
83      ${form.end()}
84    </div>
85
86  </metal:content>
87
88  <metal:body-js metal:fill-slot="body-js">
89    <script>
90        $(document).ready(function(){
91            $("#update_workout_file form").on("submit", function(){
92                console.log('Showing spinner');
93                $("#update_workout_file").fadeOut();
94                $("div.uploading-workout").fadeIn();
95            });
96        });
97    </script>
98  </metal:body-js>
99
100
101</html>
Note: See TracBrowser for help on using the repository browser.