{% extends "base.html" %}
{% block content %}
<div class="page-header">
  <h1>Reset password for {{ user.name }}</h1>
</div>

<table class="table table-striped">
  <thead>
    <tr>
      <th>Name</th>
      <th>Email</th>
      <th>Last seen</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{ user.name }}</td>
      <td>{{ user.email }}</td>
      <td>{{ user.last_seen|datetime_format }}</td>
    </tr>
  </tbody>
</table>

<form action="" method="POST" class="form-horizontal" name="reset_password_form">
    {{form.hidden_tag()}}
    <legend>New password</legend>
    {% if form.pass2.errors %}
    <div class="control-group error">
        <label class="control-label" for="inputError">Password</label>
        <div class="controls control-row">
            {{form.pass1(onFocus="this.select()", id="inputError", placeholder="Password")}}
            {{form.pass2(onFocus="this.select()", placeholder="Password, again")}}
            <span class="help-block">{{ form.pass2.errors[0] }}</span>
        </div>
    </div>
    {% else %}
    <div class="control-group">
        <label class="control-label" for="inputPassword">Password</label>
        <div class="controls control-row">
            {{form.pass1(onFocus="this.select()", id="inputPassword", placeholder="Password")}}
            {{form.pass2(onFocus="this.select()", placeholder="Password, again")}}
        </div>
    </div>
    {% endif %}
    <div class="form-actions">
        <button class="btn btn-primary" type="submit" name='button' value='Reset'>Reset</button>
        <button class="btn" type="submit" name='button' value='Cancel'>Cancel</button>
    </div>
</form>

{% endblock content %}
