{% extends "admin/index.html" %}
{% load i18n thumbnail aircox %}


{% block app %}
<div class="section">
<div class="columns">
    <div class="column">
        <div class="box">
            <h1 class="title icon-text is-4">
                <span class="icon"><i class="fa-regular fa-calendar-days"></i></span>
                <span>{% translate "Today" %}</span>
            </h1>
            {% if diffusions %}
            <div class="grid-3">
                {% for obj in diffusions %}
                    {% page_widget "card" obj.episode diffusion=obj timetable=True admin=True tag_class="" %}
                {% endfor %}
            </div>
            {% else %}
            <div class="block has-text-centered">
                {% trans "No diffusion is scheduled for today." %}
            </div>
            {% endif %}
        </div>

        <div class="box">
            <h1 class="title is-4 icon-text">
                <span class="icon"><i class="fa-regular fa-comments"></i></span>
                <span>{% translate "Latest comments" %}</span>
            </h1>
            {% if comments %}
                {% for object in comments|slice:":5" %}
                {% page_widget "item" object with_title=True %}
                {% endfor %}
                <div class="has-text-centered">
                    <a href="{% url "admin:aircox_comment_changelist" %}" class="float-center">{% translate "All comments" %}</a>
                </div>
            {% else %}
            <p class="block has-text-centered">{% trans "No comment posted yet" %}</p>
            {% endif %}
        </div>
    </div>
    <div class="column">
        <div class="box">
            <h1 class="title is-4 icon-text">
                <span class="icon"><i class="fa-regular fa-newspaper"></i></span>
                <span>{% translate "Latest publications" %}</span>
            </h1>
            {% if latests %}
            {% include "aircox/widgets/page_list.html" with object_list=latests no_actions=True %}
            {% endif %}
        </div>
        <div class="box">
            <h1 class="title is-4 icon-text">
                <span class="icon"><i class="fa fa-screwdriver-wrench"></i></span>
                <span>{% translate "Administration" %}</span>
            </h1>
            {% include "admin/app_list.html" with app_list=app_list show_changelinks=True %}
        </div>
    </div>
</div>
</div>
{% endblock %}
