source: OpenWorkouts-current/ow/templates/edit_profile.pt @ 737eb6c

currentfeature/docs
Last change on this file since 737eb6c was 737eb6c, checked in by Borja Lopez <borja@…>, 5 years ago

Fixed missing translations for submit buttons all over the place.

  • Property mode set to 100644
File size: 6.1 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="">Edit profile</tal:t>
12  </metal:head-title>
13
14  <metal:title metal:fill-slot="title">
15      <tal:t i18n:translate="">Edit profile</tal:t>
16  </metal:title>
17
18  <metal:css metal:fill-slot="css">
19      <link rel="stylesheet" href="${request.static_url('ow:static/components/pickadate/themes/default.css')}" />
20      <link rel="stylesheet" href="${request.static_url('ow:static/components/pickadate/themes/default.date.css')}" />
21  </metal:css>
22
23  <metal:content metal:fill-slot="content">
24    <div class="edit-profile ow-forms">
25            <a href="" class="back"
26               tal:attributes="href request.resource_url(context, 'profile')"
27               i18n:translate="">Cancel</a>
28      <h2 i18n:translate="">Edit profile</h2>
29      ${form.begin(multipart=True)}
30      ${form.csrf_token()}
31
32        <fieldset>
33            <div class="input-container ly-flex ly-2 has-gap">
34              <div>
35                  <label for="email" i18n:translate="">Email address:</label>
36                  ${form.errorlist('email')}
37                  ${form.text('email')}
38              </div>
39              <div>
40                  <label for="nickname" i18n:translate="">Nickname:</label>
41                  ${form.errorlist('nickname')}
42                  ${form.text('nickname')}
43              </div>
44            </div>
45            <div  class="input-container ly-flex ly-2 has-gap">
46                <div>
47                  <tal:c tal:condition="getattr(context, 'picture', None)">
48                      <label for="current_picture" i18n:translate="">
49                          Current picture:</label>
50                      <img id="current_picture"
51                           tal:attributes="src request.resource_path(context, 'picture', query={'size': 200})"
52                           width="150">
53                  </tal:c>
54                </div>
55                <div>
56                  <label for="picture" i18n:translate="">
57                      Picture (jpg, jpeg, png or gif):</label>
58                  ${form.errorlist('picture')}
59                  ${form.file('picture')}
60                </div>
61            </div>
62            <div class="input-container ly-flex ly-3 has-gap">
63              <div>
64                  <label for="firstname" i18n:translate="">First name:</label>
65                  ${form.errorlist('firstname')}
66                  ${form.text('firstname')}
67              </div>
68              <div>
69                  <label for="lastname" i18n:translate="">Last name:</label>
70                  ${form.errorlist('lastname')}
71                  ${form.text('lastname')}
72              </div>
73              <div>
74                  <label for="gender" i18n:translate="">Gender:</label>
75                  ${form.errorlist('gender')}
76                  ${form.select('gender', ['male', 'female'])}
77              </div>
78            </div>
79
80            <div class="input-container ly-flex ly-3 has-gap">
81              <div>
82                  <label for="birth_date" i18n:translate="">Birth date:</label>
83                  ${form.errorlist('birth_date')}
84                  ${form.date('birth_date', date_format='%d/%m/%Y')}
85              </div>
86              <div>
87                  <label for="height" i18n:translate="">Height (meters):</label>
88                  ${form.errorlist('height')}
89                  ${form.text('height')}
90              </div>
91              <div>
92                  <label for="weight" i18n:translate="">Weight (kg):</label>
93                  ${form.errorlist('weight')}
94                  ${form.text('weight')}
95              </div>
96            </div>
97            <p>
98                <label for="bio" i18n:translate="">Bio/About you:</label>
99                ${form.errorlist('bio')}
100                ${form.textarea('bio', rows=10, cols=50)}
101            </p>
102            <div class="input-container ly-flex ly-2 has-gap">
103              <div>
104                <label for="timezone" i18n:translate="">Timezone:</label>
105                <p>
106                  <small i18n:translate="">
107                    All dates and times will be formatted for this timezone
108                  </small>
109                </p>
110                ${form.errorlist('timezone')}
111                ${form.select('timezone', timezones)}
112              </div>
113              <div>
114                <label for="locale" i18n:translate="">Language:</label>
115                <p>
116                  <small i18n:translate="">
117                    All texts in the user interface will appear in this language
118                  </small>
119                </p>
120                ${form.errorlist('locale')}
121                ${form.select('locale', available_locale_names, selected_value=current_locale)}
122              </div>
123            </div>
124        </fieldset>
125
126        <p>
127          <tal:with-localizer tal:define="localizer get_localizer(request)">
128            ${form.submit("submit", localizer.translate(_('Save')),  **{'class':"button button-normal"})}
129          </tal:with-localizer>
130        </p>
131        ${form.end()}
132    </div>
133
134  </metal:content>
135
136  <metal:body-js metal:fill-slot="body-js">
137      <script src="${request.static_url('ow:static/components/pickadate/picker.js')}"></script>
138      <script src="${request.static_url('ow:static/components/pickadate/picker.date.js')}"></script>
139      <script type="text/javascript">
140       $(document).ready(function() {
141           var today = new Date();
142           var first_year = new Date();
143           // start 100 years ago, should be enough for birth date
144           first_year.setMonth(first_year.getMonth() - 1200);
145           $('#birth_date').pickadate({
146               format: 'dd/mm/yyyy',
147               formatSubmit: 'dd/mm/yyyy',
148               selectMonths: true,
149               selectYears: 100,
150               min: first_year,
151               max: today
152           });
153       });
154      </script>
155  </metal:body-js>
156
157</html>
Note: See TracBrowser for help on using the repository browser.