{% extends "gap_admin/base.html" %}
{% block title %}Статистика отсутствий{% endblock %}
{% block content %}

<style>
    body {
        padding-top: 70px;
    }
    textarea {
        resize:none;
    }
    .textcenter {
        padding: 30px;
    }
</style>

<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <p class="navbar-text">Статистика отсутствий</p>
        </div>
        <ul class="nav navbar-nav navbar-right">
            <li>
                <a href="{% url 'gap-admin:index' %}">в админку</a>
            </li>
        </ul>
    </div>
</nav>

<div class="container">
    <div class="panel panel-success">
        <div class="panel-heading">Статистика</div>
        <div class="panel-body">
            <table class = "table">
                <tbody>
                    <tr>
                        <td>Дата с (UTC):</td>
                        <td>{{ date_from }}</td>
                    </tr>
                    <tr>
                        <td>Дата по (UTC):</td>
                        <td>{{ date_to }}</td>
                    </tr>
                    <tr>
                        <td>Всего:</td>
                        <td>{{ total }}</td>
                    </tr>
                </tbody>
            </table>
            <table class = "table">
                <thead>
                    <tr>
                        <th>Тип</th>
                        <th>Всего</th>
                        <th>Статус new</th>
                        <th>Статус canceled</th>
                        <th>Статус confirmed</th>
                        <th>Статус signed</th>
                        <th>Полный день (да / нет)</th>
                        <th>Работа во время (да / нет)</th>
                    </tr>
                </thead>
                <tbody>
                {% for workflow in workflows %}
                    <tr>
                        <td>{{ workflow.verbose_name }} ({{ workflow.workflow }})</td>
                        <td>{{ workflow.stats.total }}</td>
                        <td>{{ workflow.stats.new }}</td>
                        <td>{{ workflow.stats.canceled }}</td>
                        <td>{{ workflow.stats.confirmed }}</td>
                        <td>{{ workflow.stats.signed }}</td>
                        <td>{{ workflow.stats.full_day_yes }} / {{ workflow.stats.full_day_no }}</td>
                        <td>{{ workflow.stats.work_in_absence_yes }} / {{ workflow.stats.work_in_absence_no }}</td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>

{% endblock %}


