{% extends "bee_django_course/base.html" %}
{% load static %}
{% load bee_django_course_filter %}
{% block styles %}
    <link rel="stylesheet" href="{% static 'bee_django_course/cc_uploadfile/css/jquery.fileupload.css' %}">
    <link rel="stylesheet" href="{% static 'bee_django_course/cc_uploadfile/css/jquery.fileupload-ui.css' %}">
    <link rel="stylesheet" href="{% static 'bee_django_course/cc_uploadfile/css/bootstrap.css' %}">
{% endblock %}
{% block content %}
    <div class="main">
        {#    <div><a href="{% url 'course:video_list' %}?sid={{ cookie_user.studio.id }}">返回视频列表</a></div>#}
        <!--<h1>jQuery File Upload Demo</h1>-->
        <!--<h2 class="lead">Basic Plus UI version</h2>-->
        <!-- The file upload form used as target for the file upload widget -->
        <div style="margin: 20px auto;">
            <form id="fileupload" method="POST" enctype="multipart/form-data">
                <div class="row fileupload-buttonbar">
                    <div class="col-lg-7">
                <span class="btn btn-success fileinput-button">
                    <i class="glyphicon glyphicon-plus"></i>
                    <span>添加文件...</span>
                    <input type="file" name="files[]" directory multiple>
                </span>
                        <button type="submit" class="btn btn-primary start">
                            <i class="glyphicon glyphicon-upload"></i>
                            <span>开始上传</span>
                        </button>
                        <button type="reset" class="btn btn-warning cancel">
                            <i class="glyphicon glyphicon-ban-circle"></i>
                            <span>取消上传</span>
                        </button>
                        <!-- The global file processing state -->
                        <span class="fileupload-process"></span>
                    </div>
                    <!-- The global progress state -->
                    <div class="col-lg-5 fileupload-progress fade">
                        <!-- The global progress bar -->
                        <div class="progress progress-striped active" role="progressbar" aria-valuemin="0"
                             aria-valuemax="100">
                            <div class="progress-bar progress-bar-success" style="width:0%;"></div>
                        </div>
                        <!-- The extended global progress state -->
                        <div class="progress-extended">&nbsp;</div>
                    </div>
                </div>
                <!-- The table listing the files available for upload/download -->
                <table role="presentation" class="table table-striped">
                    <tbody class="files"></tbody>
                </table>
            </form>

        </div>
    </div>
{% endblock %}
{% block scripts %}
    <script id="mtemplate-upload" type="text/x-tmpl">
[[#files]]
    <tr class="template-upload fade">
        <td>
            <span class="preview"></span>
        </td>
        <td>
            <p class="name">{{ name }}</p>
            <strong class="error text-danger"></strong>
        </td>
        <td>
            <p class="size">Processing...</p>
            <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100"
                 aria-valuenow="0">
                <div class="progress-bar progress-bar-success" style="width:0%;">
                </div>
            </div>
        </td>
        <td>
            <button class="btn btn-primary start" disabled>
                <i class="glyphicon glyphicon-upload"></i>
                <span>Start</span>
            </button>
            <button class="btn btn-warning cancel">
                <i class="glyphicon glyphicon-ban-circle"></i>
                <span>Cancel</span>
            </button>
        </td>
    </tr>
[[/files]]


    </script>
    <script src="{% static 'bee_django_course/cc_uploadfile/js/jquery.js' %}"></script>
    <script src="{% static 'bee_django_course/cc_uploadfile/js/bootstrap.js' %}"></script>
    <script src="{% static 'bee_django_course/cc_uploadfile/js/vendor/jquery.ui.widget.js' %}"></script>
    <script src="{% static 'bee_django_course/cc_uploadfile/js/mustache.js' %}"></script>
    <script src="{% static 'bee_django_course/cc_uploadfile/js/jquery.fileupload.js' %}"></script>
    <script src="{% static 'bee_django_course/cc_uploadfile/js/jquery.fileupload-process.js' %}"></script>
    <script src="{% static 'bee_django_course/cc_uploadfile/js/jquery.fileupload-validate.js' %}"></script>
    <script src="{% static 'bee_django_course/cc_uploadfile/js/jquery.fileupload-ui.js' %}"></script>
    <script src="{% static 'bee_django_course/cc_uploadfile/js/main.js' %}"></script>
{% endblock %}