/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. {% else %}
  5. <p>
  6. {_ Give an unique username and a password. Usernames and passwords are case sensitive, so be careful when entering them. _}
  7. {% if username %}
  8. <br/>{_ Click â&#x20AC;&#x153;deleteâ&#x20AC;? to remove any existing username/ password from the person, the person won't be an user anymore. _}
  9. {% endif %}
  10. </p>
  11. {% wire id=#form type="submit" postback="set_username_password" delegate=delegate %}
  12. <form id="{{ #form }}" method="POST" action="postback">
  13. <input type="hidden" name="id" value="{{ id }}" />
  14. <div class="new-predicate-wrapper">
  15. <p>
  16. <label for="new_username" style="color:white">{_ Username _}</label>
  17. <input type="text" id="new_username" name="new_username" value="{{ username|escape }}" />
  18. {% validate id="new_username" wait=400 type={presence} type={username_unique id=id} %}
  19. </p>
  20. <p>
  21. <label for="new_password" style="color:white">{_ Password _}</label>
  22. <input type="text" id="new_password" name="new_password" value="{{ password|escape }}" />
  23. {% if m.config.mod_admin_identity.password_regex.value %}
  24. {% validate id="new_password" type={presence} type={format pattern=m.config.mod_admin_identity.password_regex.value} %}
  25. {% else %}
  26. {% validate id="new_password" type={presence} %}
  27. {% endif %}
  28. </p>
  29. <button type="submit">{_ Save _}</button>
  30. {% button action={dialog_close} text=_"Cancel" %}
  31. {% if username %}
  32. {% button action={dialog_delete_username id=id on_success=on_delete} text=_"Delete" %}
  33. {% endif %}
  34. </div>
  35. </form>
  36. {% endif %}