{% extends "wagtailadmin/base.html" %}
{% load i18n static %}
{% block titletag %}{% trans "Add a video" %}{% endblock %}
{% block bodyclass %}menu-embed-videos{% endblock %}
{% block extra_css %}
    {% include "wagtailadmin/shared/tag_field_css.html" %}
{% endblock %}

{% block extra_js %}
    {% include "wagtailadmin/shared/tag_field_js.html" %}

    {# TODO: Find a way to inject page editor handler in the return of the view and not injecting it here #}
    <script type="text/javascript" src="{% static 'wagtailimages/js/image-chooser.js' %}"></script>
    <script type="text/javascript" src="{% static 'wagtailadmin/js/modal-workflow.js' %}"></script>
    <script type="text/javascript">
        window.chooserUrls = {
            'pageChooser': '{% url "wagtailadmin_choose_page" %}'
        };
        window.chooserUrls.imageChooser = "{% url 'wagtailimages:chooser' %}";
    </script>

{% endblock %}

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

    <div class="nice-padding">
        <form action="{% url 'wagtail_embed_videos_add_embed_video' %}" method="POST" enctype="multipart/form-data">
            {% csrf_token %}
            <ul class="fields">
                {% for field in form %}
                    {% include "wagtailadmin/shared/field_as_li.html" with field=field %}
                {% endfor %}
                <li><input type="submit" value="{% trans 'Save' %}" /></li>
            </ul>
        </form>
    </div>
{% endblock %}
