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="">Add workout manually</tal:t> |
---|
12 | </metal:head-title> |
---|
13 | |
---|
14 | <metal:title metal:fill-slot="title"> |
---|
15 | <tal:t i18n:translate="">Add workout Manually</tal:t> |
---|
16 | </metal:title> |
---|
17 | |
---|
18 | <metal:css metal:fill-slot="css"> |
---|
19 | <link rel="stylesheet" href="${request.static_url('ow:static/components/EasyAutocomplete/easy-autocomplete.min.css')}" /> |
---|
20 | <link rel="stylesheet" href="${request.static_url('ow:static/components/pickadate/themes/default.css')}" /> |
---|
21 | <link rel="stylesheet" href="${request.static_url('ow:static/components/pickadate/themes/default.date.css')}" /> |
---|
22 | </metal:css> |
---|
23 | |
---|
24 | <metal:content metal:fill-slot="content"> |
---|
25 | <h2 i18n:translate="">Add a new workout</h2> |
---|
26 | <div class="add_workout ow-forms"> |
---|
27 | ${form.begin()} |
---|
28 | ${form.csrf_token()} |
---|
29 | |
---|
30 | <fieldset> |
---|
31 | <p> |
---|
32 | <label for="sport" i18n:translate="">Sport/Activity</label> |
---|
33 | ${form.errorlist('sport')} |
---|
34 | ${form.text('sport')} |
---|
35 | </p> |
---|
36 | <p> |
---|
37 | <label for="title" i18n:translate="">Title</label> |
---|
38 | ${form.errorlist('title')} |
---|
39 | ${form.text('title')} |
---|
40 | </p> |
---|
41 | </fieldset> |
---|
42 | |
---|
43 | <fieldset> |
---|
44 | <div class="input-container"> |
---|
45 | <div> |
---|
46 | <label for="start_date" i18n:translate="">Start date (dd/mm/yyyy)</label> |
---|
47 | ${form.errorlist('start_date')} |
---|
48 | ${form.text('start_date', size=10, **{'class': "date"})} |
---|
49 | </div> |
---|
50 | <div> |
---|
51 | <label for="start_time" i18n:translate="">Start time (HH:MM)</label> |
---|
52 | ${form.errorlist('start_time')} |
---|
53 | ${form.text('start_time', size=5, **{'class': "time"})} |
---|
54 | </div> |
---|
55 | </div> |
---|
56 | |
---|
57 | <div class="input-container"> |
---|
58 | <label for="duration_hours" i18n:translate="">Hours</label> |
---|
59 | ${form.errorlist('duration_hours')} |
---|
60 | ${form.text('duration_hours', size=3, **{'class': "number"})} |
---|
61 | |
---|
62 | <label for="duration_minutes" i18n:translate="">Minutes</label> |
---|
63 | ${form.errorlist('duration_minutes')} |
---|
64 | ${form.text('duration_minutes', size=3, **{'class': "number"})} |
---|
65 | |
---|
66 | <label for="duration_seconds" i18n:translate="">Seconds</label> |
---|
67 | ${form.errorlist('duration_seconds')} |
---|
68 | ${form.text('duration_seconds', size=3, **{'class': "number"})} |
---|
69 | </div> |
---|
70 | |
---|
71 | <p> |
---|
72 | <label for="distance" i18n:translate="">Distance (Km):</label> |
---|
73 | ${form.errorlist('distance')} |
---|
74 | ${form.text('distance', size=4, **{'class': "number"})} |
---|
75 | </p> |
---|
76 | </fieldset> |
---|
77 | |
---|
78 | <fieldset> |
---|
79 | <label for="notes" i18n:translate="">Notes:</label> |
---|
80 | ${form.errorlist('notes')} |
---|
81 | ${form.textarea('notes', rows=10, cols=50)} |
---|
82 | </fieldset> |
---|
83 | |
---|
84 | <p> |
---|
85 | ${form.submit("submit", "Save", **{'class':"button button-normal"})} |
---|
86 | <a href="" class="button button-important" |
---|
87 | tal:attributes="href request.resource_url(context)" |
---|
88 | i18n:translate="">Cancel</a> |
---|
89 | </p> |
---|
90 | |
---|
91 | ${form.end()} |
---|
92 | </div> |
---|
93 | |
---|
94 | </metal:content> |
---|
95 | |
---|
96 | |
---|
97 | <metal:body-js metal:fill-slot="body-js"> |
---|
98 | <script src="${request.static_url('ow:static/components/EasyAutocomplete/jquery.easy-autocomplete.min.js')}"></script> |
---|
99 | <script src="${request.static_url('ow:static/components/pickadate/picker.js')}"></script> |
---|
100 | <script src="${request.static_url('ow:static/components/pickadate/picker.date.js')}"></script> |
---|
101 | |
---|
102 | <script type="text/javascript"> |
---|
103 | $(document).ready(function() { |
---|
104 | var options = { |
---|
105 | data: ${request.root.sports_json}, |
---|
106 | }; |
---|
107 | $("#sport").easyAutocomplete(options); |
---|
108 | $('#start_date').pickadate({ |
---|
109 | format: 'dd/mm/yyyy', |
---|
110 | formatSubmit: 'dd/mm/yyyy', |
---|
111 | }); |
---|
112 | }); |
---|
113 | </script> |
---|
114 | </metal:body-js> |
---|
115 | |
---|
116 | |
---|
117 | </html> |
---|