{% extends "html/settings/base.html" %}
{% block title %}{{ gettext('Add New User') }}{% endblock %}
{% block page_id %}add-user-page{% endblock %}

{% block main %}
<h1>{{ gettext('Add New User') }}</h1>
<form method="POST" action="/adduser">
  <ol>
    <li><h2>{{ gettext('Pick a username') }}</h2>
      <p>{{ gettext('The username must start with a letter and be between 4 and 32 characters long. It can only consist of letters, numbers, underscores, and one dot (.).') }}</p>
      <input type="text" name="username" value="{{ username_input if username_input else '' }}" />
      {% if error %}
      {% if error == 'username_invalid' %}
      <p><span class="error">{{ gettext('Error') }}:</span> {{ gettext('Invalid username') }}</p>
      {% elif error == 'username_taken' %}
      <p><span class="error">{{ gettext('Error') }}:</span> {{ gettext('Username taken') }}</p>
      {% else %}
      <p><span class="error">{{ gettext('Error') }}:</span> {{ gettext('Username Error') }}</p>
      {% endif %}
      {% endif %}
    </li>
  </ol>
  <div id="buttons">
    <button type="submit" name="cancel" value="">{{ gettext('Create Account') }}</button>
    <button type="submit" name="cancel" value="yes">{{ gettext('Cancel') }}</button>
  </div>
</form>
</div>
{% endblock %}

