Skip to content

Commit 714cc77

Browse files
author
Richard Jones
committed
better timezone editing, also cleanup of is_edit/view_ok stuff
1 parent 867a665 commit 714cc77

File tree

1 file changed

+11
-33
lines changed

1 file changed

+11
-33
lines changed

templates/classic/html/user.item.html

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,9 @@
1212
</span>
1313

1414
<td class="content" metal:fill-slot="content">
15-
<span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())">
16-
You are not allowed to view this page.
17-
</span>
1815

1916
<form method="POST" onSubmit="return submit_once()"
20-
enctype="multipart/form-data" tal:condition="context/is_edit_ok"
17+
enctype="multipart/form-data"
2118
tal:attributes="action context/designator">
2219

2320
<table class="form">
@@ -57,7 +54,15 @@
5754
</tr>
5855
<tr>
5956
<th>Timezone</th>
60-
<td tal:content="structure context/timezone/field">timezone</td>
57+
<td tal:define="timezone request/form/timezone/value | python:'';
58+
timezone python:timezone
59+
or db._db.user.get(request.user.id, 'timezone')
60+
or config.DEFAULT_TIMEZONE">
61+
<input tal:condition="context/is_edit_ok" name="timezone"
62+
tal:attributes="value timezone">
63+
<span tal:condition="context/is_only_view_ok" tal:content="timezone" />
64+
(this is a numeric hour offset)
65+
</td>
6166
</tr>
6267
<tr>
6368
<th>E-mail address</th>
@@ -79,34 +84,7 @@
7984
</table>
8085
</form>
8186

82-
<table class="form" tal:condition="context/is_only_view_ok">
83-
<tr>
84-
<th colspan=2 class="header" tal:content="context/realname">realname</th>
85-
</tr>
86-
<tr>
87-
<th>Login Name</th>
88-
<td tal:content="context/username">username</td>
89-
</tr>
90-
<tr>
91-
<th>Phone</th>
92-
<td tal:content="context/phone">phone</td>
93-
</tr>
94-
<tr>
95-
<th>Organisation</th>
96-
<td tal:content="context/organisation">organisation</td>
97-
</tr>
98-
<tr>
99-
<th>Timezone</th>
100-
<td tal:content="context/timezone">timezone</td>
101-
</tr>
102-
<tr>
103-
<th>E-mail address</th>
104-
<td tal:content="context/address/email">address</td>
105-
</tr>
106-
</table>
107-
108-
<tal:block tal:condition="python:context.id and context.is_view_ok()"
109-
tal:replace="structure context/history" />
87+
<tal:block tal:replace="structure context/history" />
11088

11189
</td>
11290

0 commit comments

Comments
 (0)