{% extends 'base/base.html' %}
{% load static %}
{% block title %} change password {% endblock %}

{% block body %}
    {% include 'base/nav-bar.html' %}
    <div id="wrap">
        <div id="main">
            <!-- content goes here -->
            <div class="container">
                <div class="row">
                    <div class="col-md-4 offset-md-4 card">
                        <div class="card-block">
                            <h2 class="card-title"><i class="fa fa-key" aria-hidden="true"></i> Change password</h2>
                            <hr>
                            <form action="" method="post">
                                {% csrf_token %}
                                <div class="form-group">
                                    <label for="magazine">New password</label>
                                    <input type="password" class="form-control" name="new_password1" id="new_password1" placeholder="New Password">
                                </div>
                                <div class="form-group">
                                    <label for="magazine">Confirm</label>
                                    <input type="password" class="form-control" name="new_password2" id="new_password2" placeholder="Confirm new Password">
                                </div>
                                <button type="submit" class="btn btn-primary">Submit</button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    {% include 'base/footer.html' %}

    <div class="notifications">
        {% if form.errors %}
            {% for field in form %}
                {% for error in field.errors %}
                    <div class="alert alert-danger alert-dismissable">
                        <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
                        {{ field.label }}: {{ error|escape }}
                    </div>
                {% endfor %}
            {% endfor %}
            {% for error in form.non_field_errors %}
                <div class="alert alert-danger alert-dismissable">
                    <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
                    {{ error|escape }}
                </div>
            {% endfor %}
        {% endif %}
    </div>

    <style>
        .container {
            margin-top: 70px;
        }

        .notifications {
            position: fixed;
            top: 90px;
            right: 0;
            z-index: 1000;
            font-size: 0.7em;
            max-width: 90%;
        }

        body {
            background-color: #fcfcfc;
        }
    </style>

{% endblock %}
