<%page expression_filter="h"/>
<%inherit file="base.html" />
<%def name="online_help_token()"><% return "video" %></%def>
<%!
  import json
  from django.core.serializers.json import DjangoJSONEncoder
  from django.utils.translation import ugettext as _
  from openedx.core.djangolib.js_utils import (
      dump_js_escaped_json, js_escaped_string
  )
  from openedx.core.djangolib.markup import HTML, Text
%>
<%block name="title">${_("Video Uploads")}</%block>
<%block name="bodyclass">is-signedin course view-video-uploads</%block>

<%namespace name='static' file='static_content.html'/>

<%block name="header_extras">
% for template_name in ["active-video-upload", "previous-video-upload-list"]:
<script type="text/template" id="${template_name}-tpl">
    <%static:include path="js/${template_name}.underscore" />
</script>
% endfor
</%block>

<%block name="requirejs">
    require(["js/factories/videos_index"], function (VideosIndexFactory) {
        "use strict";
        var $contentWrapper = $(".content-primary");
        VideosIndexFactory(
            $contentWrapper,
            "${image_upload_url | n, js_escaped_string}",
            "${video_handler_url | n, js_escaped_string}",
            "${encodings_download_url | n, js_escaped_string}",
            "${default_video_image_url | n, js_escaped_string}",
            ${concurrent_upload_limit | n, dump_js_escaped_json},
            $(".nav-actions .upload-button"),
            $contentWrapper.data("previous-uploads"),
            ${video_supported_file_formats | n, dump_js_escaped_json},
            ${video_upload_max_file_size | n, dump_js_escaped_json},
            ${video_image_settings | n, dump_js_escaped_json}
        );
    });
</%block>

<%block name="content">

<div class="wrapper-mast wrapper">
    <header class="mast has-actions has-subtitle">
        <h1 class="page-header">
            <small class="subtitle">${_("Content")}</small>
            <span class="sr">&gt; </span>${_("Video Uploads")}
        </h1>

        <nav class="nav-actions" aria-label="${_('Page Actions')}">
            <h3 class="sr">${_("Page Actions")}</h3>
            <ul>
                <li class="nav-item">
                    <a href="#" class="button upload-button new-button"><span class="icon fa fa-plus" aria-hidden="true"></span> ${_("Upload New File")}</a>
                </li>
            </ul>
        </nav>
    </header>
</div>

<div class="wrapper-content wrapper">
    <section class="content">
        <article class="content-primary" role="main" data-previous-uploads="${json.dumps(previous_uploads, cls=DjangoJSONEncoder)}"></article>
    </section>
</div>

</%block>
