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

{% block content %}
    <h1 class="title">Log in to your instance</h1>

    <form method="post" action="{% url "oldlogin" %}">
        {% csrf_token %}
        <div class="field">
            <label class="label">{{ form.instance.label  }}</label>
            <div class="control has-icons-left">
                {% render_field form.instance class+="input" %}
                <span class="icon is-small is-left">
                    <i class="fa fa-mastodon"></i>
                </span>
            </div>
        </div>

        <div class="field">
            <label class="label">{{ form.email.label }}</label>
            <div class="control has-icons-left">
                {% render_field form.email class+="input" %}
                <span class="icon is-small is-left">
                    <i class="fa fa-user"></i>
                </span>
            </div>
        </div>
        <div class="field" >
            <label class="label" >{{ form.password.label }}</label>
            <div class="control has-icons-left" >
                {% render_field form.password class+="input" type="password" %}
                <span class="icon is-small is-left">
                    <i class="fa fa-lock" ></i>
                </span>
            </div>
        </div>
        <div class="field">
            <input type="submit" name="log_in"
                   value="Log in" class="button is-primary" >
        </div>
    </form>
    {% if form.errors %}
    <p class="error">
      {{ form.non_field_errors | escape }}
    </p>
    {% endif %}

    <div class="notification">
        <button class="delete"></button>
        <p>
            This information is only used to log you in to your instance for the
            first time. Brutaldon never stores your username and password; it
            only uses it to acquire a token which you can disable from the
            settings page of your Mastodon instance. However, you do need to
            absolutely trust the person running this copy of brutaldon! If that's
            not the case, use the <a href="{% url "login" %}">OAuth login form</a>.
        </p>
    </div>

{% endblock %}
