{% extends "base.html" %}
{% load humanize %}
{% load static %}

{% block title %}
EVE Online - View Character
{% endblock %}


<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    {% block header %}
    Character
    {% endblock %}

    {% block description %}
    {{character.name}}
    {% endblock %}

    <!-- Main content -->
    {% block content %}
    {% if form.errors %}
    {% for field in form %}
    {% for error in field.errors %}
    <div class="wrap-input100 alert alert-danger m-b-10">
        <span class="badge badge-secondary">{{field.label}}</span>
        <strong>{{ error|escape }}</strong>
    </div>
    {% endfor %}
    {% endfor %}
    {% endif %}
    <div class="row">
        <div class="col-md-3">

            <!-- Profile Image -->
            <div class="box box-primary">
                <div class="box-body box-profile">
                    <img class="profile-user-img img-responsive img-circle"
                        src="https://imageserver.eveonline.com/Character/{{character.external_id}}_128.jpg"
                        alt="User profile picture">
                    <h3 class="profile-username text-center">{{character.name }}</h3>
                    <h5 class="text-muted text-center">{{character.corporation}} </h5>
                    <h6 class="text-muted text-center">{{character.corporation.alliance}} </h6>
                    <br>

                    <ul class="list-group list-group-unbordered">
                        <li class="list-group-item">
                            <b>Links</b>
                            <p class="pull-right">
                                <a href="https://forums.eveonline.com/u/{{character.name}}/summary" target="_blank">
                                    <img width="16x"
                                        src="{% static 'django_eveonline_connector/img/eve_forum_logo.ico'%}">
                                </a>
                                <a href="http://evewho.com/pilot/{{character.name}}" target="_blank">
                                    <img width="16x"
                                        src="{% static 'django_eveonline_connector/img/evewho_logo.ico'%}">
                                </a>
                                <a href="https://zkillboard.com/character/{{character.name}}" target="_blank">
                                    <img width="16x"
                                        src="{% static 'django_eveonline_connector/img/zkillboard_logo.ico'%}">
                                </a>
                            </p>
                        </li>
                        <li class="list-group-item">
                            <b>Skill Points</b>
                            <p class="pull-right">
                                {{character.info.skill_points|intcomma}}
                            </p>
                        </li>
                        {% if "django_discord_connector" in INSTALLED_APPS %}
                        <li class="list-group-item">
                            <b>Discord</b>
                            {% if character.token.user.discord_token %}
                            <p class="pull-right">
                                {{character.token.user.discord_token.discord_user}}
                            </p>
                            {% else %}
                            <p class="pull-right"><i>None</i></p>
                            {% endif %}
                        </li>
                        {% endif %}
                    </ul>

                    <a class="btn btn-success btn-block"
                        href="{% url 'django-eveonline-connector-refresh-character' character.external_id %}?fields=assets,jumpclones,contacts,contracts,skills,journal,transactions">Refresh
                        Character</a>
                </div>
                <!-- /.box-body -->
            </div>
            <!-- /.box -->

        </div>

        <!-- /.col -->
        <div class="col-md-9">
            <div class="nav-tabs-custom">
                <ul class="nav nav-tabs">
                    <li id="assets"><a
                            href="{% url 'django-eveonline-connector-view-character-assets' character.external_id %}">Assets</a>
                    </li>
                    <li id="clones"><a
                            href="{% url 'django-eveonline-connector-view-character-clones' character.external_id %}">Clones</a>
                    </li>
                    <li id="contacts"><a
                            href="{% url 'django-eveonline-connector-view-character-contacts' character.external_id %}">Contacts</a>
                    </li>
                    <li id="contracts"><a
                            href="{% url 'django-eveonline-connector-view-character-contracts' character.external_id %}">Contracts</a>
                    </li>
                    <li id="skills"><a
                            href="{% url 'django-eveonline-connector-view-character-skills' character.external_id %}">Skills</a>
                    </li>
                    <li id="journal"><a
                            href="{% url 'django-eveonline-connector-view-character-journal' character.external_id %}">Journal</a>
                    </li>
                    <li id="transactions"><a
                            href="{% url 'django-eveonline-connector-view-character-transactions' character.external_id %}">Transactions</a>
                    </li>
                    <li id="audit"><a
                            href="{% url 'django-eveonline-connector-view-character-audit' character.external_id %}">Audit</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active">
                        {% block tab_content %}
                        {% endblock %}
                    </div>
                </div>
                <!-- /.tab-content -->
                <!-- /.nav-tabs-custom -->
            </div>
        </div>
        <!-- /.col -->
    </div>
    <!-- /.row -->
    {% include 'django_eveonline_connector/adminlte/snippets/view_entity_modal.html' %}
    {% endblock %}
    <!-- /.content -->
</div>