{% extends 'charlink/base_audit.html' %}

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

{% block auditblock %}
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">Search results</h3>
        </div>
        <div class="panel-body">
            <div class="tab-pane" id="characters">
                <div class="table-responsive">
                    <table class="table table-aa table-hover">
                        <thead>
                            <tr>
                                <th></th>
                                <th class="text-center">Character</th>
                                <th class="text-center">Corporation</th>
                                <th class="text-center">Main Character</th>
                                <th class="text-center">Main Corporation</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for character in characters %}
                                <tr>
                                    <td><img src="{{ character.portrait_url }}" class="img-circle" alt="{{ character }}"></td>
                                    <td class="text-center">{{ character }}</td>
                                    <td class="text-center">{{ character.corporation_name }}</td>
                                    <td class="text-center">
                                        {% if character.character_ownership.user.profile.main_character %}
                                            <a href="{% url 'charlink:audit_user' character.character_ownership.user_id %}">{{ character.character_ownership.user.profile.main_character }} <i class="fas fa-external-link-alt fa-xs"></i></a>
                                        {% endif %}
                                    </td>
                                    <td class="text-center">{{ character.character_ownership.user.profile.main_character.corporation_name }}</td>
                                </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
{% endblock auditblock %}