{% extends 'miningtaxes/base.html' %}
{% load i18n %}
{% load static %}
{% load humanize %}
{% load evelinks %}
{% load bootstrap %}

{% block details %}
    <div class="panel panel-default">
        <div class="panel-heading" style="display:flex;">
            <h3 class="panel-title">{% translate 'Tax Settings' %}</h3>
        </div>
        <div class="panel-body">
	    <form class="form" action="{{ url }}" method="POST">
		    {% csrf_token %}
		    {{ form|bootstrap }}
		    <button type="submit" class="btn btn-primary">Edit Settings</button>
	    </form>
	</div>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading" style="display:flex;">
            <h3 class="panel-title">{% translate 'Accountant Characters (add only one accountant per corp)' %}</h3>
        </div>
        <div class="panel-body">
            <!-- Characters -->
            <div class="character-cards">
                <ul class="cards_container">
                    <!-- Add New Character -->
                    <li class="cards_item">
                        <div class="card">
                            <div class="card-header">{% translate 'Register Character' %}</div>

                            <div class="card-body card__content">
                                <a href="{% url 'miningtaxes:add_admin_character' %}">
                                    <img src="{{ 1|character_portrait_url:256 }}" alt="Add character">
                                </a>
                            </div>

                            <div class="card-footer">
                                <a class="btn btn-primary btn-sm" href="{% url 'miningtaxes:add_admin_character' %}">{% translate 'Register' %}</a>
                            </div>
                        </div>
                    </li>

                    {% if has_registered_characters %}
                        <!-- Registered Characters -->
                        {% for auth_character in auth_characters|dictsort:"character_name" %}
                            <li class="cards_item">
                                <div class="card">
                                    <div class="card-header">
                                        {{ auth_character.character_name }}
                                    </div>
                                    <div class="card-body card__content">
                                        <p>
					<a href="">
                                                <span class="aa-miningtaxes-launcher-character-image">
                                                    <img src="{{ auth_character.character_id|character_portrait_url:256 }}" alt="{{ auth_character.character_name }}">

                                                    {% if auth_character.alliance_id %}
                                                        <span class="aa-miningtaxes-alliance-logo">
                                                            <img class="" src="{{ auth_character.alliance_id|alliance_logo_url:64 }}" title="{{ auth_character.alliance_name }}">
                                                        </span>
                                                    {% endif %}

                                                    <span class="aa-miningtaxes-corporation-logo">
                                                        <img class="" src="{{ auth_character.corporation_id|corporation_logo_url:64 }}" title="{{ auth_character.corporation_name }}">
                                                    </span>
                                                </span>
                                            </a>
                                        </p>

                                        <div class="text-center">
                                        </div>
                                    </div>

                                    <div class="card-footer">
                                        <a class="btn btn-danger btn-sm" href="{% url 'miningtaxes:remove_admin_character' auth_character.character.pk %}"
                                            role="button" title="{% translate 'Remove this character.' %}"
                                            onclick="return confirm('Are you sure you want to REMOVE this character?')">
                                            <i class="far fa-trash-alt"></i>
                                        </a>
                                    </div>
                                </div>
                            </li>
                        {% endfor %}
                    {% endif %}
                </ul>
            </div>
        </div>
    </div>


{% endblock details %}

{% block extra_css %}
    <link rel="stylesheet" href="{% static 'miningtaxes/css/global.css' %}" type="text/css">
    <link rel="stylesheet" href="{% static 'miningtaxes/css/miningtaxes.css' %}" type="text/css">
    <link rel="stylesheet" href="{% static 'miningtaxes/css/launcher.css' %}" type="text/css">
{% endblock %}

{% block extra_script %}
{% endblock %}
