{% extends "base.html" %}
{% load static %}

{% block title %}Passwort ändern{% endblock %}

{% block content %}
<div class="row">
  <div class="col-md-6 col-md-offset-3">
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title">Passwort ändern</h3>
      </div>
      <div class="panel-body">
        <form method="post">
          {% csrf_token %}
          
          {% if form.errors %}
            <div class="alert alert-danger">
              <p>Bitte korrigieren Sie die Fehler unten.</p>
            </div>
          {% endif %}
          
          <div class="form-group">
            <label for="id_old_password">Aktuelles Passwort:</label>
            <input type="password" name="old_password" class="form-control" id="id_old_password" required>
            {% if form.old_password.errors %}
              <div class="text-danger">{{ form.old_password.errors }}</div>
            {% endif %}
          </div>
          
          <div class="form-group">
            <label for="id_new_password1">Neues Passwort:</label>
            <input type="password" name="new_password1" class="form-control" id="id_new_password1" required>
            {% if form.new_password1.errors %}
              <div class="text-danger">{{ form.new_password1.errors }}</div>
            {% endif %}
          </div>
          
          <div class="form-group">
            <label for="id_new_password2">Neues Passwort bestätigen:</label>
            <input type="password" name="new_password2" class="form-control" id="id_new_password2" required>
            {% if form.new_password2.errors %}
              <div class="text-danger">{{ form.new_password2.errors }}</div>
            {% endif %}
          </div>
          
          <div class="form-group">
            <button type="submit" class="btn btn-primary">Passwort ändern</button>
            <a href="/" class="btn btn-default">Abbrechen</a>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
{% endblock %}