

{% extends "../page_layout.html" %}
{% block title %}Dashboard | Unmanic{% end %}
{% block page %}main{% end %}

{% block head %}
<link rel="stylesheet" type="text/css"
      href="/assets/css/dashboard.css?version={{ escape(handler.config.read_version()) }}"/>
{% end %}

{% block page_plugin_styles %}
{# START DATATABLES #}
<link rel="stylesheet" type="text/css"
      href="/assets/plugins/datatables/datatables.min.css?version={{ escape(handler.config.read_version()) }}"/>
<link rel="stylesheet" type="text/css"
      href="/assets/plugins/datatables/plugins/bootstrap/datatables.bootstrap.css?version={{ escape(handler.config.read_version()) }}"/>
{# END DATATABLES #}
{% end %}
{% block page_plugins %}
{# START PIECHARTS #}
<script type="text/javascript"
        src="/assets/plugins/jquery-easypiechart/jquery.easypiechart.min.js?version={{ escape(handler.config.read_version()) }}"></script>
{# END PIECHARTS #}
{# START DATATABLES #}
<script type="text/javascript"
        src="/assets/js/datatable.js?version={{ escape(handler.config.read_version()) }}"></script>
<script type="text/javascript"
        src="/assets/plugins/datatables/datatables.min.js?version={{ escape(handler.config.read_version()) }}"></script>
<script type="text/javascript"
        src="/assets/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js?version={{ escape(handler.config.read_version()) }}"></script>
{# END DATATABLES #}
{% end %}

{% block page_theme_scripts %}
{# START PAGE COMPONENTS #}
<script type="text/javascript"
        src="/assets/js/page_components/dashboard/dashboard.js?version={{ escape(handler.config.read_version()) }}"></script>
<script type="text/javascript"
        src="/assets/js/page_components/dashboard/pending.js?version={{ escape(handler.config.read_version()) }}"></script>
{# END PAGE COMPONENTS #}
{% end %}


{% block content %}
<div class="row">
    <!-- BEGIN JOB STATISTICS -->
    <div class="col-md-12 col-sm-12 ">
        <div class="portlet light bordered">
            <div class="portlet-title">
                <div class="caption">
                    <i class="icon-disc font-purple"></i>
                    <span class="caption-subject font-purple bold uppercase"
                          title="Each worker can process one re-encoding job.
                                                This allows you to process more than one task at a time.
                                                Configure the number of Workers in the General Settings screen">Workers</span>
                    <span class="caption-helper">   </span>
                </div>
            </div>
            <div class="portlet-body">
                <!-- BEGIN WORKER PIE CHARTS -->
                <div class="row" id="worker_pie_charts"></div>
                <!-- END WORKER PIE CHARTS -->
                <!-- BEGIN WORKER PIE CHARTS TEMPLATE -->
                <div id="unmanic_worker_piechart_template" class="hidden">
                    <div class="col-md-2 col-sm-4 col-xs-6">
                        <div class="easy-pie-chart worker-pie-chart">
                            <div class="portlet light" style="box-shadow: none;">
                                <div class="portlet-title" style="border: none;">
                                    <div class="caption">
                                        <div class="row">
                                            <div class="worker-chart">
                                                <div class="number idle" data-percent="100">
                                                    <span style="margin-left:-7px;"> - </span>
                                                </div>
                                                {% if session.level == 0 %}
                                                    {% set data_target = "data-target=#login-popup data-toggle=modal" %}
                                                    {% set link_class = "" %}
                                                {% elif session.level == 1 %}
                                                    {% set data_target = "data-target=#insufficient-permissions-popup data-toggle=modal" %}
                                                    {% set link_class = "" %}
                                                {% elif session.level > 1 %}
                                                    {% set data_target = "" %}
                                                    {% set link_class = "worker-full-screen-toggle" %}
                                                {% end %}
                                                <a class="title {{ link_class }}" {{ data_target }} href="javascript:;">
                                                    <span class="worker-name"></span>
                                                    <br>
                                                    <span class="worker-subtitle"></span>
                                                </a>
                                            </div>

                                            <div class="worker-status col-md-6 text-left hidden">
                                                <div class="panel panel-default">
                                                    <div class="panel-heading">
                                                        <h3 class="panel-title">Status</h3>
                                                    </div>
                                                    <div class="panel-body">
                                                        <div class="col-md-12">
                                                            <label class="col-md-5 control-label">
                                                                <b>State:</b>
                                                            </label>
                                                            <div class="col-md-7">
                                                                <span class="worker-status-state"></span>
                                                            </div>
                                                        </div>
                                                        <div class="col-md-12">
                                                            <label class="col-md-5 control-label">
                                                                <b>Current Runner:</b>
                                                            </label>
                                                            <div class="col-md-7">
                                                                <span class="worker-status-current-runner"></span>
                                                            </div>
                                                        </div>
                                                        <div class="col-md-12">
                                                            <label class="col-md-5 control-label">
                                                                <b>Start Time:</b>
                                                            </label>
                                                            <div class="col-md-7">
                                                                <span class="worker-status-start-time"></span>
                                                            </div>
                                                        </div>
                                                        <div class="col-md-12">
                                                            <label class="col-md-5 control-label">
                                                                <b>Total Processing Time:</b>
                                                            </label>
                                                            <div class="col-md-7">
                                                                <span class="worker-status-total-proc-time"></span>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="actions hidden">
                                        <a class="btn btn-circle btn-icon-only btn-default worker-full-screen-toggle"
                                           href="javascript:;"
                                           data-original-title="" title=""><i class="fa fa-expand"></i></a>
                                    </div>
                                </div>
                                <div class="portlet-body hidden" style="height: auto;">
                                    <div class="worker-details hidden">

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="margin-bottom-10 visible-sm"></div>
                </div>
                <!-- END WORKER PIE CHARTS TEMPLATE -->
            </div>
        </div>
    </div>
    <!-- END JOB STATISTICS -->
</div>
<div class="row">
    <div class="col-md-6 col-sm-6">
        <div class="portlet light tasks-widget bordered dashboard-task-list dashboard-task-list-pending dashboard-task-list-preview"
             id="portlet-pending-tasks-list">
            <!-- START TASK LIST -->
            {% include "main-pending-tasks.html" %}
            <!-- END START TASK LIST -->
        </div>
    </div>
    <div class="col-md-6 col-sm-6">
        <div class="portlet light bordered dashboard-task-list">
            <div class="portlet-title">
                <div class="caption">
                    <i class="fa fa-tasks font-blue"></i>
                    <span class="caption-subject font-blue bold uppercase">Completed Tasks</span>
                </div>
            </div>
            <div class="portlet-body">
                <div class="scroller" style="height: 300px;" data-always-visible="1" data-rail-visible="0">
                    <!-- START TASK LIST -->
                    <div id="completed_tasks"></div>
                    <!-- END START TASK LIST -->
                </div>
                <div class="scroller-footer">
                    <div class="btn-arrow-link pull-right">
                        <a href="/history/">See All Records</a>
                        <i class="icon-arrow-right"></i>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
    {% if session.level == 0 %}
        {% include "../global/login-popup.html" %}
    {% elif session.level == 1 %}
        {% set minimum_required_sponsorship_level = "Supporter" %}
        {% include "../global/insufficient-permissions.html" %}
    {% end %}
{% end %}
