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