{% extends 'corptools/character/char_base.html' %}
{% load humanize  %}
{% 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">Total SP: {{ data.total_sp|intcomma }}</span>
                            <span class="badge badge-default">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">Dataset</th>
                                <th>Last Update</th>
                            </thead>
                            <tbody>
                                {% app_setting as appset %}

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

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