{% extends "wagtailadmin/base.html" %}
{% load embed_video_tags wagtailimages_tags i18n wagtailadmin_tags %}
{% block titletag %}{% trans "Delete video" %}{% endblock %}

{% block content %}
    {% trans "Delete video" as del_str %}
    {% include "wagtailadmin/shared/header.html" with title=del_str icon="media" %}

    <div class="row row-flush nice-padding">
        <div class="col6">
            {% if embed_video.thumbnail %}
                {% image embed_video.thumbnail max-800x600 %}
            {% else %}
                {% video embed_video.url as my_video %}
                    <img src="{{ my_video.thumbnail }}">
                {% endvideo %}
            {% endif %}
        </div>
        <div class="col6">
            {% usage_count_enabled as uc_enabled %}
            {% if uc_enabled %}
                <div class="usagecount">
                    <a href="{{ embed_video.usage_url }}">{% blocktrans count usage_count=embed_video.get_usage.count %}Used {{ usage_count }} time{% plural %}Used {{ usage_count }} times{% endblocktrans %}</a>
                </div>
            {% endif %}
            <p>{% trans "Are you sure you want to delete this video?" %}</p>
            <form action="{% url 'wagtail_embed_videos:delete' embed_video.id %}" method="POST">
                {% csrf_token %}
                <input type="submit" value="{% trans 'Yes, delete' %}" class="button serious" />
                <a href="{% url 'wagtail_embed_videos:index' %}" class="button button-secondary">{% trans "No, don't delete" %}</a>
            </form>
        </div>
    </div>
{% endblock %}
