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

{% block page_content %}        
    <div id="div_request_entities">        
        <br>
        <br>
        <img class="center-block" src="{% static 'standingsrequests/Spinner-1s-200px.gif' %}" alt="Spinner"/>
        <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 page_content %}

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