{% extends "admin/layout.html" %}
{% from "admin/_form_helpers.html" import render_formbox %}
{% block title %}{{ _('New User') if form.new else _('Edit User') }}{% endblock %}
{% block contents %}
  <h1>{{ self.title()|e }}</h1>
  {% call form() %}
    <div class="formbox">
      <h3>{{ form.username.label() }}</h3>
      {{ form.username(size=30) }}
    </div>
    {{ render_formbox(form.real_name, toggleable=false) }}
    {{ render_formbox(form.password) }}
    {{ render_formbox(form.email) }}
    {{ render_formbox(form.www) }}
    {{ render_formbox(form.display_name) }}
    {{ render_formbox(form.groups) }}
    {{ render_formbox(form.privileges) }}
    <div class="formbox toggleable collapsed">
      <h3>{{ form.is_author.label.text|e }}</h3>
      {{ form.is_author.with_help_text() }}
    </div>
    <div class="formbox">
      <h3>{{ form.description.label() }}</h3>
      {{ form.description(rows=5) }}
    </div>
    <div class="actions">
      <input type="submit" name="save" value="{{ _('Save') }}">
      <input type="submit" name="save_and_continue" value="{{ _('Save and continue editing') }}">
      {%- if not form.new %}
        <input type="submit" name="delete" value="{{ _('Delete') }}">
      {%- endif %}
      <input type="submit" name="cancel" value="{{ _('Cancel') }}">
    </div>
  {% endcall %}
{% endblock %}
