source: OpenWorkouts-current/ow/templates/add_bulk_file.pt

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

(#77) Bulk workouts upload:

  • Added a new Folder-like object under the root object to store compressed files
  • Added a new Blob-like object to store those compressed files into the database
  • Added the needed view/template code to handle adding/uploading compressed files that may contain workout tracking files + a page to see them per-user
  • Property mode set to 100644
File size: 2.9 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="">Upload file with multiple workouts</tal:t>
12  </metal:head-title>
13
14  <metal:title metal:fill-slot="title">
15    <tal:t i18n:translate="">Upload file with multiple workouts</tal:t>
16  </metal:title>
17
18  <metal:content metal:fill-slot="content">
19
20    <div class="uploading-workout hidden">
21      <h2 i18n:translate="">Uploading workouts file, please wait...</h2>
22      <p i18n:translate="">
23        This can take a moment, depending on the size of your workouts file and your connection speed. Be patient and please don't hit the stop or go back buttons on your browser.
24      </p>
25      <img src="" alt="Uploading workouts file" i18n:attributes="alt"
26           tal:attributes="src request.static_url('ow:static/media/img/loading.gif')">
27    </div>
28
29    <div class="upload-workout ow-forms">
30      <a href="" class="back"
31         tal:attributes="href request.resource_url(context)"
32         i18n:translate="">Back</a>
33      <h2 i18n:translate="">Upload file with multiple workouts</h2>
34
35      <p tal:condition="request.root['_bulk_files'].get_by_uid(context.uid)">
36        <a href="" tal:attributes="href request.resource_url(context, 'bulk-files')">Manage your uploaded bulk files</a>
37      </p>
38
39      <p i18n:translate="">
40        Add several workouts by providing several tracking files (fit, gpx) in a compressed file (zip, gz, etc)
41      </p>
42
43      <p i18n:translate="">
44        Once uploaded, the tracking files will be extracted, analyzed and imported into your workouts timeline.
45        This task can take some time, so be patient, workouts will start appearing on your timeline as they are
46        added.
47      </p>
48
49      ${form.begin(multipart=True)}
50      ${form.csrf_token()}
51
52
53      <fieldset>
54
55        <p>
56          <label for="compressed_file" i18n:translate="">
57            Workouts file (zip, gz, tgz)</label>
58          ${form.errorlist('compressed_file')}
59          ${form.file('compressed_file')}
60        </p>
61
62      </fieldset>
63
64      <tal:with-localizer tal:define="localizer get_localizer(request)">
65        ${form.submit("submit", localizer.translate(_('Save')),  **{'class':"button button-normal"})}
66      </tal:with-localizer>
67
68      ${form.end()}
69        </div>
70
71  </metal:content>
72
73  <metal:body-js metal:fill-slot="body-js">
74    <script>
75        $(document).ready(function(){
76            $("div.upload-workout form").on("submit", function(){
77                console.log('Showing spinner');
78                $("div.upload-workout").fadeOut();
79                $("div.uploading-workout").fadeIn();
80            });
81        });
82    </script>
83  </metal:body-js>
84
85</html>
Note: See TracBrowser for help on using the repository browser.