comparison website/issues/html/user.item.html @ 4566:b8119ba37707

Merge branch 'website'
author Eric S. Raymond <esr@thyrsus.com>
date Sun, 13 Nov 2011 11:18:42 -0500
parents c2d0d3e9099d
children 370cc9052239
comparison
equal deleted inserted replaced
4564:6327b1b21593 4566:b8119ba37707
1 <tal:doc metal:use-macro="templates/page/macros/icing"
2 define="edit_ok context/is_edit_ok"
3 >
4 <title metal:fill-slot="head_title">
5 <tal:if condition="context/id" i18n:translate=""
6 >User <span tal:replace="context/id" i18n:name="id"
7 />: <span tal:replace="context/username" i18n:name="title"
8 /> - <span tal:replace="config/TRACKER_NAME" i18n:name="tracker"
9 /></tal:if>
10 <tal:if condition="not:context/id" i18n:translate=""
11 >New User - <span tal:replace="config/TRACKER_NAME" i18n:name="tracker"
12 /></tal:if>
13 </title>
14 <metal:slot fill-slot="more-javascript">
15 <script metal:use-macro="templates/page/macros/user_utils"></script>
16 <script type="text/javascript" src="@@file/help_controls.js"></script>
17 </metal:slot>
18 <tal:block metal:fill-slot="body_title"
19 define="edit_ok context/is_edit_ok">
20 <span tal:condition="python: not (context.id or edit_ok)"
21 tal:omit-tag="python:1" i18n:translate="">New User</span>
22 <span tal:condition="python: not context.id and edit_ok"
23 tal:omit-tag="python:1" i18n:translate="">New User Editing</span>
24 <span tal:condition="python: context.id and not edit_ok"
25 tal:omit-tag="python:1" i18n:translate="">User<tal:x
26 replace="context/id" i18n:name="id" /></span>
27 <span tal:condition="python: context.id and edit_ok"
28 tal:omit-tag="python:1" i18n:translate="">User<tal:x
29 replace="context/id" i18n:name="id" /> Editing</span>
30 </tal:block>
31
32 <td class="content" metal:fill-slot="content">
33
34 <p tal:condition="python:not (context.is_view_ok()
35 or request.user.hasRole('Anonymous'))" i18n:translate="">
36 You are not allowed to view this page.</p>
37
38 <p tal:condition="python:not context.is_view_ok()
39 and request.user.hasRole('Anonymous')" i18n:translate="">
40 Please login with your username and password.</p>
41
42 <div tal:condition="context/is_view_ok">
43
44 <form method="POST"
45 tal:define="required python:'username address'.split()"
46 enctype="multipart/form-data"
47 tal:attributes="action context/designator;
48 onSubmit python:'return checkRequiredFields(\'%s\')'%'\', \''.join(required);
49 ">
50 <table class="form" tal:define="
51 th_label templates/page/macros/th_label;
52 src_input templates/page/macros/user_src_input;
53 normal_input templates/page/macros/user_normal_input;
54 pw_input templates/page/macros/user_pw_input;
55 confirm_input templates/page/macros/user_confirm_input;
56 edit_ok context/is_edit_ok;
57 ">
58 <tr tal:define="name string:realname; label string:Name; value context/realname; edit_ok edit_ok">
59 <th metal:use-macro="th_label">Name</th>
60 <td><input name="realname" metal:use-macro="src_input"></td>
61 </tr>
62 <tr tal:define="name string:username; label string:Login Name; value context/username">
63 <th metal:use-macro="th_label">Login Name</th>
64 <td><input metal:use-macro="src_input"></td>
65 </tr>
66 <tal:if condition="edit_ok">
67 <tr tal:define="name string:password; label string:Login Password">
68 <th metal:use-macro="th_label">Login Password</th>
69 <td><input metal:use-macro="pw_input" type="password"></td>
70 </tr>
71 <tr tal:define="name string:password; label string:Confirm Password">
72 <th metal:use-macro="th_label">Confirm Password</th>
73 <td><input metal:use-macro="confirm_input" type="password"></td>
74 </tr>
75 </tal:if>
76 <tal:if condition="python:request.user.hasPermission('Web Roles')">
77 <tr tal:define="name string:roles; label string:Roles;">
78 <th><label for="roles" i18n:translate="">Roles</label></th>
79 <td tal:define="gips context/id">
80 <tal:subif condition=gips define="value context/roles">
81 <input metal:use-macro="normal_input">
82 </tal:subif>
83 <tal:subif condition="not:gips" define="value db/config/NEW_WEB_USER_ROLES">
84 <input metal:use-macro="normal_input">
85 </tal:subif>
86 <tal:block i18n:translate="">(to give the user more than one role,
87 enter a comma,separated,list)</tal:block>
88 </td>
89 </tr>
90 </tal:if>
91
92 <tr tal:define="name string:phone; label string:Phone; value context/phone">
93 <th metal:use-macro="th_label">Phone</th>
94 <td><input name="phone" metal:use-macro="normal_input"></td>
95 </tr>
96
97 <tr tal:define="name string:organisation; label string:Organisation; value context/organisation">
98 <th metal:use-macro="th_label">Organisation</th>
99 <td><input name="organisation" metal:use-macro="normal_input"></td>
100 </tr>
101
102 <tr tal:condition="python:edit_ok or context.timezone"
103 tal:define="name string:timezone; label string:Timezone; value context/timezone">
104 <th metal:use-macro="th_label">Timezone</th>
105 <td><input tal:replace="structure python:
106 utils.tzfield(context.timezone, 'timezone', db.config.DEFAULT_TIMEZONE)"/>
107 </td>
108 </tr>
109
110 <tr tal:define="name string:address; label string:E-mail address; value context/address">
111 <th metal:use-macro="th_label">E-mail address</th>
112 <td tal:define="mailto python:context.address.field(id='address');
113 mklink python:mailto and not edit_ok">
114 <a href="mailto:calvin@the-z.org"
115 tal:attributes="href string:mailto:$value"
116 tal:content="value"
117 tal:condition="python:mklink">calvin@the-z.org</a>
118 <tal:if condition=edit_ok>
119 <input metal:use-macro="src_input" value="calvin@the-z.org">
120 </tal:if>
121 &nbsp;
122 </td>
123 </tr>
124
125 <tr>
126 <th><label for="alternate_addresses" i18n:translate="">Alternate E-mail addresses<br>One address per line</label></th>
127 <td>
128 <textarea rows=5 cols=40 tal:replace="structure context/alternate_addresses/multiline">nobody@nowhere.org
129 anybody@everywhere.net
130 (alternate_addresses)
131 </textarea>
132 </td>
133 </tr>
134
135 <tr tal:condition="edit_ok">
136 <td>
137 &nbsp;
138 <input type="hidden" name="@template" value="item">
139 <input type="hidden" name="@required" value="username,address"
140 tal:attributes="value python:','.join(required)">
141 </td>
142 <td><input type="submit" value="save" tal:replace="structure context/submit"><!--submit button here-->
143 <input type="reset">
144 </td>
145 </tr>
146 </table>
147 </form>
148
149 <tal:block tal:condition="not:context/id" i18n:translate="">
150 <table class="form">
151 <tr>
152 <td>Note:&nbsp;</td>
153 <th class="required">highlighted</th>
154 <td>&nbsp;fields are required.</td>
155 </tr>
156 </table>
157 </tal:block>
158
159 <tal:block tal:condition="context/id" tal:replace="structure context/history" />
160
161 </div>
162
163 </td>
164
165 </tal:doc>

Roundup Issue Tracker: http://roundup-tracker.org/