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

currentfeature/docs
Last change on this file since b05824e was b05824e, checked in by Segundo Fdez <segun.2@…>, 5 years ago

fix forms for edit profile anda change password

  • Property mode set to 100644
File size: 5.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="">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
49                      <label for="current_picture" i18n:translate="">
50                          Current picture:</label>
51                      <img id="current_picture" tal:attributes="src request.resource_path(context, 'picture')" width="150">
52                  </tal:c>
53                </div>
54                <div>
55                  <label for="picture" i18n:translate="">
56                      Picture (jpg, jpeg, png or gif):</label>
57                  ${form.errorlist('picture')}
58                  ${form.file('picture')}
59                </div>
60            </div>
61            <div class="input-container ly-flex ly-3 has-gap">
62              <div>
63                  <label for="firstname" i18n:translate="">First name:</label>
64                  ${form.errorlist('firstname')}
65                  ${form.text('firstname')}
66              </div>
67              <div>
68                  <label for="lastname" i18n:translate="">Last name:</label>
69                  ${form.errorlist('lastname')}
70                  ${form.text('lastname')}
71              </div>
72              <div>
73                  <label for="gender" i18n:translate="">Gender:</label>
74                  ${form.errorlist('gender')}
75                  ${form.select('gender', ['male', 'female'])}
76              </div>
77            </div>
78
79            <div class="input-container ly-flex ly-3 has-gap">
80              <div>
81                  <label for="birth_date" i18n:translate="">Birth date:</label>
82                  ${form.errorlist('birth_date')}
83                  ${form.date('birth_date', date_format='%d/%m/%Y')}
84              </div>
85              <div>
86                  <label for="height" i18n:translate="">Height (meters):</label>
87                  ${form.errorlist('height')}
88                  ${form.text('height')}
89              </div>
90              <div>
91                  <label for="weight" i18n:translate="">Weight (kg):</label>
92                  ${form.errorlist('weight')}
93                  ${form.text('weight')}
94              </div>
95            </div>
96            <p>
97                <label for="bio" i18n:translate="">Bio/About you:</label>
98                ${form.errorlist('bio')}
99                ${form.textarea('bio', rows=10, cols=50)}
100            </p>
101            <div>
102              <label for="timezone" i18n:translate="">Timezone:</label>
103                <small i18n:translate="">
104                    All dates and times will be formatted for this timezone
105                </small>
106            </div>
107            ${form.errorlist('timezone')}
108            ${form.select('timezone', timezones)}
109        </fieldset>
110
111        <p>
112            ${form.submit("submit", "Save",  **{'class':"button button-normal"})}
113        </p>
114        ${form.end()}
115    </div>
116
117  </metal:content>
118
119  <metal:body-js metal:fill-slot="body-js">
120      <script src="${request.static_url('ow:static/components/pickadate/picker.js')}"></script>
121      <script src="${request.static_url('ow:static/components/pickadate/picker.date.js')}"></script>
122      <script type="text/javascript">
123       $(document).ready(function() {
124           var today = new Date();
125           var first_year = new Date();
126           // start 100 years ago, should be enough for birth date
127           first_year.setMonth(first_year.getMonth() - 1200);
128           $('#birth_date').pickadate({
129               format: 'dd/mm/yyyy',
130               formatSubmit: 'dd/mm/yyyy',
131               selectMonths: true,
132               selectYears: 100,
133               min: first_year,
134               max: today
135           });
136       });
137      </script>
138  </metal:body-js>
139
140</html>
Note: See TracBrowser for help on using the repository browser.