{% extends 'allianceauth/base.html' %}
{% load bootstrap %}

{% block page_title %}Charlink{% endblock page_title %}

{% block content %}
    <div class="col-lg-12">
        <h1 class="page-header text-center">Character Linking</h1>
        <div class="panel panel-primary text-center">
            <div class="panel-heading">
                <h3 class="panel-title text-center">Login Form</h3>
            </div>
            <div class="panel-body">
                <p>Select the apps you want to link from the list. You will be redirected to eveonline website to authenticate and provide the token with all the scopes needed.</p>
                <br>
                <form method="post">
                    {% csrf_token %}
                    {{ form|bootstrap }}
                    <button type="submit" class="btn btn-primary">Login</button>
                </form>
            </div>
        </div>

        <div class="panel panel-success text-center">
            <div class="panel-heading">
                <h3 class="panel-title text-center">Applications Info</h3>
            </div>
            <div class="panel-body">
                {% for app in apps %}
                    <span>{{ app.field_label }}</span>
                    <br><br>
                    <span>Scopes:</span>
                    {{ app.scopes|unordered_list|safe }}
                    {% if not forloop.last %}<hr>{% endif %}
                {% endfor %}
            </div>
        </div>
    </div>
{% endblock content %}