PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/modules/mod_admin_identity/templates/_action_dialog_set_username_password.tpl

https://code.google.com/p/zotonic/
Smarty Template | 44 lines | 36 code | 8 blank | 0 comment | 8 complexity | f19c863f39117edc7f39c3e7999680fd MD5 | raw file
 1{% if id == 1 %}
 2<p>
 3    {_ The password of the admin user cannot be changed in the database. Please edit your site's configuration file at _} <strong>priv/sites/{{ m.site.host }}/config</strong> {_ if you want to change the admin password. _}
 4
 5{% else %}
 6<p>
 7	{_ Give an unique username and a password. Usernames and passwords are case sensitive, so be careful when entering them. _}
 8	{% if username %}
 9		<br/>{_ Click â&#x20AC;&#x153;deleteâ&#x20AC;? to remove any existing username/ password from the person, the person won't be an user anymore. _}
10	{% endif %}
11</p>
12
13{% wire id=#form type="submit" postback="set_username_password" delegate=delegate %}
14<form id="{{ #form }}" method="POST" action="postback">
15
16	<input type="hidden" name="id" value="{{ id }}" />
17
18	<div class="new-predicate-wrapper">
19		<p>
20			<label for="new_username" style="color:white">{_ Username _}</label>
21			<input type="text" id="new_username" name="new_username" value="{{ username|escape }}" />
22			{% validate id="new_username" wait=400 type={presence} type={username_unique id=id} %}
23		</p>
24
25		<p>
26			<label for="new_password" style="color:white">{_ Password _}</label>
27			<input type="text" id="new_password" name="new_password" value="{{ password|escape }}" />
28			{% if m.config.mod_admin_identity.password_regex.value %}
29				{% validate id="new_password" type={presence} type={format pattern=m.config.mod_admin_identity.password_regex.value} %}
30			{% else %}
31				{% validate id="new_password" type={presence} %}
32			{% endif %}
33		</p>
34
35		<button type="submit">{_ Save _}</button>
36
37		{% button action={dialog_close} text=_"Cancel" %}
38
39		{% if username %}
40			{% button action={dialog_delete_username id=id on_success=on_delete} text=_"Delete" %}
41		{% endif %}
42	</div>
43</form>
44{% endif %}