source: OpenWorkouts-current/ow/templates/bulk_files.pt @ 715671f

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

(#77) Bulk workouts upload:

  • Added methods to extract files from compressed bulk files, then load workouts from those files.
  • Added a task to process/load workouts from "not loaded" bulk files
  • Added full tests coverage
  • 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="">Multiple file uploads</tal:t>
12  </metal:head-title>
13
14  <metal:title metal:fill-slot="title">
15    <tal:t i18n:translate="">Multiple file uploads</tal:t>
16  </metal:title>
17
18  <metal:content metal:fill-slot="content">
19
20    <div class="bulk-files ow-forms">
21      <a href="" class="back"
22         tal:attributes="href request.resource_url(context, 'add-bulk-file')"
23         i18n:translate="">Back</a>
24      <h2 i18n:translate="">Multiple file uploads</h2>
25
26      <tal:bulk_files tal:repeat="bulk_file bulk_files">
27        <div class="bulk-file">
28
29          <h3 tal:content="bulk_file.file_name"></h3>
30
31          <p>
32            <span i18n:translate="">Uploaded on</span>
33            <span tal:content="bulk_file.uploaded_in_timezone(context.timezone)"></span>
34          </p>
35
36          <p>
37            <tal:loaded tal:condition="bulk_file.loaded">
38              <span i18n:translate="">File loaded on</span>
39              <span tal:content="bulk_file.loaded_in_timezone(context.timezone)"></span>
40              <ul>
41                <tal:loaded_files tal:repeat="file_name bulk_file.loaded_info.keys()">
42                  <li tal:define="file_info bulk_file.loaded_info[file_name]">
43                    <span tal:content="file_name"></span>
44                    <tal:file_loaded tal:condition="file_info['loaded']">
45                      <span i18n:translate="">Loaded correctly</span>
46                      <a href="" tal:attributes="href request.resource_url(context, file_info['workout'])"
47                         i18n:translate="">See workout</a>
48                    </tal:file_loaded>
49                    <tal:file_not_loaded tal:condition="not file_info['loaded']">
50                      <span i18n:translate="">Couldn't be loaded:</span>
51                      <span tal:content="file_info['error']"></span>
52                    </tal:file_not_loaded>
53                  </li>
54                </tal:loaded_files>
55              </ul>
56            </tal:loaded>
57            <tal:not_loaded tal:condition="not bulk_file.loaded">
58              <span i18n:translate="">This file has not been yet processed</span>
59            </tal:not_loaded>
60          </p>
61
62          <!--!
63               <tal:workouts tal:condition="bulk_file.loaded and bulk_file.workout_ids">
64               <ul class="bulk-loaded-workouts">
65               <tal:workout tal:repeat="workout bulk_file.workouts">
66               <li>
67               <span tal:content="workout.start_in_timezone(context.timezone)"></span>,
68               <span tal:content="workout.sport"></span>,
69               <span tal:content="workout.title"></span>
70               </li>
71               </tal:workout>
72               </ul>
73               </tal:workouts>
74          -->
75          <tal:no_workouts tal:condition="bulk_file.loaded and not bulk_file.workout_ids">
76            <p><span i18n:translate>No workouts have been loaded from this file</span></p>
77          </tal:no_workouts>
78
79        </div>
80      </tal:bulk_files>
81
82    </div>
83
84  </metal:content>
85
86</html>
Note: See TracBrowser for help on using the repository browser.