{% extends "corputils/base.html" %}
{% load i18n %}
{% block member_data %}
    <div class="panel panel-default">
        <div class="panel-heading clearfix">
            <div class="panel-title pull-left">{% translate "Search Results" %}</div>
        </div>
        <div class="panel-body">
            <table class="table table-hover" id="table-search">
                <thead>
                    <tr>
                        <th class="text-center"></th>
                        <th class="text-center">{% translate "Character" %}</th>
                        <th class="text-center">{% translate "Corporation" %}</th>
                        <th class="text-center">{% translate "zKillboard" %}</th>
                        <th class="text-center">{% translate "Main Character" %}</th>
                        <th class="text-center">{% translate "Main Corporation" %}</th>
                        <th class="text-center">{% translate "Main Alliance" %}</th>
                    </tr>
                </thead>
                <tbody>
                    {% for result in results %}
                        <tr {% if not result.1.registered %}class="danger"{% endif %}>
                            <td class="text-center"><img src="{{ result.1.portrait_url }}" class="img-circle"></td>
                            <td class="text-center">{{ result.1.character_name }}</td>
                            <td class="text-center">{{ result.0.corp.corporation_name }}</td>
                            <td class="text-center"><a href="https://zkillboard.com/character/{{ result.1.character_id }}/" class="label label-danger" target="_blank">{% translate "Killboard" %}</a></td>
                            <td class="text-center">{{ result.1.main_character.character_name }}</td>
                            <td class="text-center">{{ result.1.main_character.corporation_name }}</td>
                            <td class="text-center">{{ result.1.main_character.alliance_name }}</td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
{% endblock %}
{% block extra_javascript %}
    {% include 'bundles/datatables-js.html' %}
{% endblock %}
{% block extra_css %}
    {% include 'bundles/datatables-css.html' %}
{% endblock %}
{% block extra_script %}
    $(document).ready(function(){
        $('#table-search').DataTable();
    });
{% endblock %}
