{% include 'header.twig' %}

{% if resetStep == 1 %}
<div class="container">
  <div class="row">
    <div class="col-md-8 col-md-offset-2">

      {% if errorText %}
        <div class="alert alert-dismissible alert-danger">
          <button type="button" class="close" data-dismiss="alert">&times;</button>
          {{ errorText }}
        </div>
      {% endif %}
      {% if successText %}
        <div class="alert alert-dismissible alert-success">
          <button type="button" class="close" data-dismiss="alert">&times;</button>
          {{ successText }}
        </div>
      {% endif %}

      <div class="well">
        <form method="post" action="">

          <div class="form-group">
            <label for="username" class="control-label">{{ lang['resetpassword.user'] }}</label>
            <input type="text" class="form-control" name="user" value="{{ data['user'] }}">
          </div>

          <div class="form-group">
            <label for="username" class="control-label">{{ lang['resetpassword.type'] }}</label>
            <select class="form-control" name="type">
             {% for reset in resetType %}
              <option value="{{ reset['type'] }}">{{ reset['name'] }}</option>
             {% endfor %}
            </select>
          </div>


          {% if captcha %}
            <div class="form-group">
              <div class="g-recaptcha" data-sitekey="{{ captchaKey }}"></div>
            </div>
          {% endif %}

            <button type="submit" class="btn btn-primary click">{{ lang['resetpassword.button'] }}</button>
        </form>
      </div>
    </div>
  </div>
</div>
{% else %}
<div class="container">
  <div class="row">
    <div class="col-md-8 col-md-offset-2">

      {% if errorText %}
        <div class="alert alert-dismissible alert-danger">
          <button type="button" class="close" data-dismiss="alert">&times;</button>
          {{ errorText }}
        </div>
      {% endif %}
      {% if successText %}
        <div class="alert alert-dismissible alert-success">
          <button type="button" class="close" data-dismiss="alert">&times;</button>
          {{ successText }}
        </div>
      {% endif %}

      <div class="well">
        <form method="post" action="">

          <div class="form-group">
            <label for="username" class="control-label">{{ lang['account.password.new'] }}</label>
            <input type="password" class="form-control" name="password">
          </div>

          <div class="form-group">
            <label for="username" class="control-label">{{ lang['account.password.confirm'] }}</label>
            <input type="password" class="form-control" name="confirm_password">
          </div>

            <button type="submit" class="btn btn-primary click">{{ lang['resetpassword.button'] }}</button>
        </form>
      </div>
    </div>
  </div>
</div>

{% endif %}

{% for lang in site['languages'] %}
  {% if lang['active'] %}
    <script src="https://www.google.com/recaptcha/api.js?hl={{ lang['code'] }}"></script>
  {% endif %}
{% endfor %}

{% include 'footer.twig' %}
