{% extends "corptools/base.html" %}
{% load i18n %}
{% block ct_block %}
    <h2 class="text-center">{% translate "Admin Info" %}!</h2>
    <div class="col-md-4">
        <div class="panel panel-primary">
            <div class="panel-heading text-center">{% translate "DataBase" %}</div>
            <div class="panel-body">
                <h4>{% translate "EvE Models" %}</h4>
                <table class="table">
                    <tr>
                        <td class="">{% translate "Names" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ names }}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="">{% translate "Structure Names" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ location }}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="">{% translate "Categories" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ categorys }}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="">{% translate "Groups" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ groups }}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="">{% translate "Types" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ types }}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="">{% translate "Dogma Attributes" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ dogma }}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="">{% translate "Type Material Outputs" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ type_mets }}</span>
                        </td>
                    </tr>
                </table>
                <h4>{% translate "EvE Map" %}</h4>
                <table class="table">
                    <tr>
                        <td class="">{% translate "Regions" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ regions }}/106</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="">{% translate "Constellations" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ constellations }}/1146</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="">{% translate "Systems" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ systems }}/8285</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="">{% translate "Gate Links" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ gates }}/6913</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="">{% translate "Jump Bridge Links" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ bridges }}</span>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div class="col-md-4">
        <div class="panel panel-primary">
            <div class="panel-heading text-center">{% translate "DataBase" %}</div>
            <div class="panel-body">
                <h4>{% translate "Corporate" %}</h4>
                <table class="table">
                    <tr>
                        <td class="">{% translate "Corporation Audits" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ corpations }}</span>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div class="col-md-4">
        <div class="panel panel-primary">
            <div class="panel-heading text-center">{% translate "DataBase" %}</div>
            <div class="panel-body">
                <h4>{% translate "Character" %}</h4>
                <table class="table">
                    <tr>
                        <td class="">{% translate "Character Audits" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ characters }}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="">{% translate "Skill Lists" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ skilllists }}</span>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>

    <div class="col-md-4">
        <div class="panel panel-primary">
            <div class="panel-heading text-center">{% translate "Periodic Tasks" %}!</div>
            <div class="panel-body text-center">
                <h4>{% translate "Tasks" %}</h4>
                <table class="table">
                    <tr>
                        <td class="text-left">{% translate "Character Task" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ char_tasks }}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="text-left">{% translate "Corporation Task" %}</td>
                        <td class="text-right">
                            <span class="badge">{{ corp_tasks }}</span>
                        </td>
                    </tr>
                </table>
                <a class="btn col-md-12 btn-primary" href="{% url 'corptools:admin_create_tasks' %}">{% translate "Create or Update Periodic Tasks" %}</a>
            </div>
        </div>
    </div>

    <div class="col-md-4">
        <div class="panel panel-primary">
            <div class="panel-heading text-center">{% translate "Task Helper" %}!</div>
            <div class="panel-body text-center">
                <form action="{% url 'corptools:run_tasks' %}" method="post">
                    <br />
                    {% csrf_token %}
                    <span class="label label-info">
                        <label for="run_universe">{% translate "Clear all cached Etags" %}:</label>
                        <input type="checkbox" name="run_clear_etag" class="form-check" id="run_clear_etag" />
                    </span>
                    <br />
                    <br />
                    <span class="label label-info">
                        <label for="run_universe">{% translate "Update Map Data" %}:</label>
                        <input type="checkbox" name="run_universe" class="form-check" id="run_universe" />
                    </span>
                    <br />
                    <br />
                    <span class="label label-info">
                        <label for="run_universe">{% translate "Update all locations" %}:</label>
                        <input type="checkbox" name="run_locations" class="form-check" id="run_locations" />
                    </span>
                    <br />
                    <br />
                    <span class="label label-info">
                        <label for="run_update_all">{% translate "Force Character Update" %}:</label>
                        <input type="checkbox" name="run_update_all" class="form-check" id="run_update_all" />
                    </span>
                    <br />
                    <br />
                    <span class="label label-info">
                        <label for="run_update_eve_models">{% translate "Update Eve Models" %}:</label>
                        <input type="checkbox" name="run_update_eve_models" class="form-check" id="run_update_eve_models" />
                    </span>
                    <br />
                    <br />
                    <span class="label label-info">
                        <label for="run_corp_updates">{% translate "Update Corp Updates" %}:</label>
                        <input type="checkbox" name="run_corp_updates" class="form-check" id="run_corp_updates" />
                    </span>
                    <br />
                    <br />
                    <input type="submit" value="{% translate "Submit" %}" class="btn col-md-12 btn-primary" />
                    <br />
                </form>
            </div>
        </div>
    </div>

    <div class="col-md-4">
        <div class="panel panel-primary">
            <div class="panel-heading text-center">{% translate "Skill Lists" %}</div>
            <div class="panel-body text-center">
                <form method="post" action="{% url 'corptools:admin_add_pyfa_xml' %}" enctype="multipart/form-data">
                    {% csrf_token %}
                    <div class="form-group">
                        <label for="name">{% translate "Skill List Description" %}</label>
                        <input type="text" class="form-control" name="name" placeholder="Enter Description" />
                        <small id="nameHelp" class="form-text text-muted">{% translate "This will show as the name of the Skill List" %}.</small>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class='form-control' id="upload-file-info"></span>
                            <span class="input-group-btn">
                                <label class="btn btn-default" for="file">
                                    <input id="file" name="file" type="file" style="display:none" onchange="$('#upload-file-info').html(this.files[0].name)" />
                                    {% translate "Browse" %}
                                </label>
                            </div>
                            <small id="descriptionHelp" class="form-text text-muted">{% translate "PYFA XML Skills required list" %}.</small>

                        </div>
                        <input type="submit" class="btn col-md-12 btn-primary" />
                    </form>
                </div>
            </div>
        </div>

    {% endblock ct_block %}
