{% extends 'layouts/auth.twig' %}

{% block content %}
  <section class="auth-panel">
    <h1>Create Administrator</h1>
    <p>Set up the first account for this installation.</p>

    {% if error %}<div class="alert alert-danger">{{ error }}</div>{% endif %}

    <form method="post" action="{{ base_url }}/setup">
      <input type="hidden" name="_csrf_token" value="{{ csrf_token }}">
      {% if errors._csrf_token is defined %}<span class="form-error">{{ errors._csrf_token }}</span>{% endif %}

      <div class="field {{ errors.name is defined ? 'has-error' : '' }}">
        <label>Name</label>
        <input type="text" name="name" value="{{ form.name }}" autocomplete="name" autofocus>
        {% if errors.name is defined %}<span class="form-error">{{ errors.name }}</span>{% endif %}
      </div>
      <div class="field {{ errors.email is defined ? 'has-error' : '' }}">
        <label>Email</label>
        <input type="email" name="email" value="{{ form.email }}" autocomplete="email">
        {% if errors.email is defined %}<span class="form-error">{{ errors.email }}</span>{% endif %}
      </div>
      <div class="field {{ errors.password is defined ? 'has-error' : '' }}">
        <label>Password</label>
        <input type="password" name="password" autocomplete="new-password">
        {% if errors.password is defined %}<span class="form-error">{{ errors.password }}</span>{% endif %}
      </div>
      <div class="field {{ errors.password_confirmation is defined ? 'has-error' : '' }}">
        <label>Confirm Password</label>
        <input type="password" name="password_confirmation" autocomplete="new-password">
        {% if errors.password_confirmation is defined %}<span class="form-error">{{ errors.password_confirmation }}</span>{% endif %}
      </div>
      <button class="btn btn-primary" type="submit">Create Administrator</button>
    </form>
  </section>
{% endblock %}
