<table class="{{ tclass }}-slides">
    <thead>
    <tr>
        <th>{{ l.slideshow_slide_panel_th_name }}</th>
        <th class="tac">{{ l.slideshow_slide_panel_th_duration }}</th>
        <th class="tac">{{ l.slideshow_slide_panel_th_enabled }}</th>
        <th class="">{{ l.slideshow_slide_panel_th_cron_scheduled }}</th>
        <th class="tac">{{ l.slideshow_slide_panel_th_activity }}</th>
    </tr>
    </thead>
    <tbody>
    <tr class="empty-tr {% if slides|length != 0 %}hidden{% endif %}">
        <td colspan="4">
            {{ l.slideshow_slide_panel_empty|replace(
                '%link%',
                ('<a href="javascript:void(0);" class="item-add slide-add">'~l.slideshow_slide_button_add~'</a>')|safe
            ) }}
        </td>
    </tr>
    {% for slide in slides %}
        <tr class="slide-item" data-level="{{ slide.id }}" data-entity="{{ slide.to_json() }}">
            <td class="infos">
                <div class="inner">
                    <a href="javascript:void(0);" class="item-sort slide-sort">
                        <i class="fa fa-sort icon-left"></i>
                    </a>
                    {% set icon_type = 'globe' %}
                    {% if slide.type == 'video' %}
                        {% set icon_type = 'video' %}
                    {% elif slide.type == 'picture' %}
                        {% set icon_type = 'image' %}
                    {% endif %}

                    <i class="fa fa-{{ icon_type }} icon-left"></i>
                    {{ slide.name }}
                </div>
            </td>
            <td class="tac">
                {{ slide.duration }} {{ l.slideshow_slide_panel_th_duration_unit }}
            </td>
            <td class="tac">
                <label class="pure-material-switch">
                    <input type="checkbox" {% if slide.enabled %}checked="checked"{% endif %}><span></span>
                </label>
            </td>
            <td class="">
                {% if slide.cron_schedule %}
                    {% set cron_desc = cron_descriptor(slide.cron_schedule)  %}
                    {% if cron_desc %}
                        {% if is_validate_cron_date_time(slide.cron_schedule) %}
                        📆 {{ cron_desc }}
                        {% else %}
                        ⏳ {{ cron_desc }}
                        {% endif %}
                    {% else %}
                        <span class="error">⚠️ {{ l.slideshow_slide_panel_td_cron_scheduled_bad_cron }}</span>
                    {% endif %}
                {% else %}
                    🔄 {{ l.slideshow_slide_panel_td_cron_scheduled_loop }}
                {% endif %}
            </td>
            <td class="actions tac">
                <a href="javascript:void(0);" class="item-edit slide-edit">
                    <i class="fa fa-pencil"></i>
                </a>
                {% if not fleet_mode or not slide.has_file() %}
                    <a href="{{ slide.location }}" class="item-download slide-download" target="_blank">
                        <i class="fa fa-eye"></i>
                    </a>
                {% elif var_external_url.value|length > 0 %}
                    <a href="{{ var_external_url.value }}/{{ slide.location }}" class="item-download slide-download" target="_blank">
                        <i class="fa fa-eye"></i>
                    </a>
                {% endif %}
                <a href="javascript:void(0);" class="item-delete slide-delete">
                    <i class="fa fa-trash"></i>
                </a>
            </td>
        </tr>
    {% endfor %}
    </tbody>
</table>