{% extends "corptools/character/char_base.html" %}
{% load humanize %}
{% load i18n %}
{% load evelinks %}
{% load helpers %}
{% block ct_block %}
    <div class="row flex-container flex-wrap">
        {% for name, data in table_data.items %}
            <div class="col-md-6 col-xs-12 col-sm-12">
                <div class="panel {% if data.character.characteraudit.is_active %}panel-primary{% else %}panel-danger{% endif %}">
                    <div class="panel-heading  text-center">{{ name }}</div>
                    <div class="panel-body flex-middle ">
                        <div class="col-md-4">
                            <div class="text-center">
                                <img class="ra-avatar img-circle" src="{{ data.character.portrait_url_128 }}" />
                                <h4>{{ data.character.character_name }}</h4>
                                <span class="badge badge-default">{{ data.character.corporation_name }}</span>
                                {% if data.character.alliance_name %}
                                    <br />
                                    <span class="badge badge-default">{{ data.character.alliance_name }}</span>
                                {% endif %}
                                <br />
                                <br />
                                <span class="badge badge-default">{% translate "Total SP" %}: {{ data.total_sp|intcomma }}</span>
                                <span class="badge badge-default">{% translate "Isk" %}: {{ data.character.characteraudit.balance|intcomma }}</span>
                            </div>
                        </div>
                        <div class="col-md-8 col-lg-8 pannel-hieght-locked scroll-bar-narrow">
                            <table class="table datatable table-hover">
                                <thead>
                                    <th class="text-right">{% translate "Dataset" %}</th>
                                    <th>{% translate "Last Update" %}</th>
                                </thead>
                                <tbody>
                                    {% app_setting as appset %}

                                    <tr>
                                        <td class="text-right">{% translate "Public Data" %}</td>
                                        <td>{{ data.character.characteraudit.last_update_pub_data|timesince }} {% translate "ago" %}</td>
                                    </tr>
                                    {% if appset.CT_CHAR_ASSETS_MODULE %}
                                        <tr>
                                            <td class="text-right">{% translate "Assets" %}</td>
                                            <td>{{ data.character.characteraudit.last_update_assets|timesince }} {% translate "ago" %}</td>
                                        </tr>
                                    {% endif %}
                                    {% if appset.CT_CHAR_CLONES_MODULE %}
                                        <tr>
                                            <td class="text-right">{% translate "Clones" %}</td>
                                            <td>{{ data.character.characteraudit.last_update_clones|timesince }} {% translate "ago" %}</td>
                                        </tr>
                                    {% endif %}
                                    {% if appset.CT_CHAR_CONTACTS_MODULE %}
                                        <tr>
                                            <td class="text-right">{% translate "Contacts" %}</td>
                                            <td>{{ data.character.characteraudit.last_update_contacts|timesince }} {% translate "ago" %}</td>
                                        </tr>
                                    {% endif %}
                                    {% if appset.CT_CHAR_WALLET_MODULE %}
                                        <tr>
                                            <td class="text-right">{% translate "Orders" %}</td>
                                            <td>{{ data.character.characteraudit.last_update_orders|timesince }} {% translate "ago" %}</td>
                                        </tr>
                                    {% endif %}
                                    {% if appset.CT_CHAR_NOTIFICATIONS_MODULE %}
                                        <tr>
                                            <td class="text-right">{% translate "Notifications" %}</td>
                                            <td>{{ data.character.characteraudit.last_update_notif|timesince }} {% translate "ago" %}</td>
                                        </tr>
                                    {% endif %}
                                    {% if appset.CT_CHAR_MAIL_MODULE %}
                                        <tr>
                                            <td class="text-right">{% translate "Mails" %}</td>
                                            <td>{{ data.character.characteraudit.last_update_mails|timesince }} {% translate "ago" %}</td>
                                        </tr>
                                    {% endif %}
                                    {% if appset.CT_CHAR_ROLES_MODULE %}
                                        <tr>
                                            <td class="text-right">{% translate "Roles" %}</td>
                                            <td>{{ data.character.characteraudit.last_update_roles|timesince }} {% translate "ago" %}</td>
                                            <tr>
                                                <td class="text-right">{% translate "Titles" %}</td>
                                                <td>{{ data.character.characteraudit.last_update_titles|timesince }} {% translate "ago" %}</td>
                                            </tr>
                                        {% endif %}
                                        {% if appset.CT_CHAR_SKILLS_MODULE %}
                                            <tr>
                                                <td class="text-right">{% translate "Skills" %}</td>
                                                <td>{{ data.character.characteraudit.last_update_skills|timesince }} {% translate "ago" %}</td>
                                            </tr>
                                            <tr>
                                                <td class="text-right">{% translate "Skill Que" %}</td>
                                                <td>{{ data.character.characteraudit.last_update_skill_que|timesince }} {% translate "ago" %}</td>
                                            </tr>
                                        {% endif %}
                                        {% if appset.CT_CHAR_WALLET_MODULE %}
                                            <tr>
                                                <td class="text-right">{% translate "Wallet" %}</td>
                                                <td>{{ data.character.characteraudit.last_update_wallet|timesince }} {% translate "ago" %}</td>
                                            </tr>
                                        {% endif %}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            {% endfor %}
        </div>

    {% endblock ct_block %}
    {% block extra_javascript %}
        {% include "bundles/datatables-js.html" %}
    {% endblock extra_javascript %}
    {% block ct_extra_script %}
        $(document).ready(function() {
        $('table.datatable').DataTable({
        "paging":   false,
        "searching":  false,
        "ordering":  false,
        "info":     false,
        "columnDefs": [
        { "sortable": false, "targets": [0] }
        ]
        });
        } );
    {% endblock ct_extra_script %}
