{% extends "standingsrequests/base.html" %}
{% load bootstrap %}
{% load static %}
{% load i18n %}

{% block page_content %}
    <p>
        On this page you can create requests to <strong>get standing</strong> or <strong>revoke standing</strong> with <strong>{{ organization.name }}</strong> for your alts. If you are missing an alt, please add it first on the dashboard.
    </p>

    <h3>{% trans "Your Characters" %}</h3>
    <div id="div_request_characters">
        {% include "standingsrequests/partials/_spinner.html" %}
        <br>
    </div>

    <h3>{% trans "Your Corporations" %}</h3>
    <div id="div_request_corporations">
        {% include "standingsrequests/partials/_spinner.html" %}
        <br>
    </div>

    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                {% trans "Icon Legend" %}
            </div>
            <div class="panel-body">
                <table class="table">
                    <tr>
                        <td>
                            <i class="fas fa-star fa-fw text-primary"></i>
                        </td>
                        <td>
                            {% trans "Character is in this organisation." %}
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <i class="fas fa-exclamation-triangle fa-fw text-warning"></i>
                        </td>
                        <td>
                            {% trans "The character / corporation has no standings from this organisation towards it." %}
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <i class="fas fa-hourglass-start fa-fw"></i>
                        </td>
                        <td>
                            {% trans "The standing has been requested and is pending action by a standings manager." %}
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <i class="fas fa-hourglass-half fa-fw text-success"></i>
                        </td>
                        <td>
                            {% trans "The request has been accepted by a standings manager, but is waiting for confirmation that those standings have been updated in game." %}
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <i class="fas fa-reply-all fa-fw text-danger"></i>
                        </td>
                        <td>
                            {% trans "The standing is being revoked by yourself, a standings manager or automatically if you no longer meet the requirements permitting blue standings access. It is pending confirmation." %}
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <i class="fas fa-info-circle fa-fw text-info"></i>
                        </td>
                        <td>
                            {% trans "More keys are required to request standing for this corporation." %}
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>

{% endblock %}

{% block extra_javascript %}
    <script>
        $(function() {
            /* async load request_characters view into div or show HTTP errors if any */
            $("#div_request_characters").load(
                "{% url 'standingsrequests:request_characters' %}",
                function(responseTxt, statusTxt, xhr) {
                    if (statusTxt == "error") {
                        $("#div_request_characters").html(
                            '<p class="text-danger">{% trans "Failed to load content. Please reload this page to try again." %}</p>'
                        );
                    }
            });

            /* async load request_corporations view into div or show HTTP errors if any */
            $("#div_request_corporations").load(
                "{% url 'standingsrequests:request_corporations' %}",
                function(responseTxt, statusTxt, xhr) {
                    if (statusTxt == "error") {
                        $("#div_request_corporations").html(
                            '<p class="text-danger">{% trans "Failed to load content. Please reload this page to try again." %}</p>'
                        );
                    }
            });
        });
    </script>
{% endblock %}
