{% extends 'old-bootstrap-modal-layout.html.twig' %}


{% set modal_class = 'modal-lg' %}

{% block title %}
  {% if targetType == 'courselesson' or targetType == 'opencourselesson' %} {{'上传任务文件'|trans}}
  {% elseif targetType == 'coursematerial' %} {{'上传资料文件'|trans}}
  {% elseif targetType == 'materiallib' %} {{'上传文件到教学资料库'|trans}}
  {% endif %}
{% endblock %}

{% block body %}

<style>
  .plupload_filelist_footer {
    height: 40px;
    line-height: 20px;
  }


</style>

	<div id="file-uploader-container"
    class="mbl"
    data-target-type="{{targetType}}"
    data-upload-mode="{{ storageSetting.upload_mode }}"
    data-hls-encrypted="{{ setting('developer.hls_encrypted', 1) }}"

    >

     <div
      id="file-chooser-uploader-div"
      data-role="uploader-div"
      data-upload-url="{{ path('uploadfile_upload', {targetType:targetType, targetId:targetId}) }}"
      data-params-url="{{ path('uploadfile_params', {storage:storageSetting.upload_mode, targetType:targetType, targetId:targetId}) }}"
     ></div>

	</div>

  {% if targetType == 'courselesson' or  targetType == 'materiallib' or targetType == 'opencourselesson'%}
    <div class="alert alert-info">
      <ul>
        {% if storageSetting.upload_mode == 'cloud' %}
          <li>{{'支持'|trans|raw}}<strong>mp3, mp4, avi, flv, wmv, mov, ppt, pptx, pdf, doc, docx, swf</strong>{{'格式的文件上传，文件大小不能超过'|trans|raw}}<strong>1 GB</strong>。</li>
          <li>{{'视频将上传到'|trans|raw}}<strong>{{'云服务器'}}</strong>{{'，上传之后会对视频进行格式转换，转换过程需要一定的时间，在这个过程中视频将无法播放。'|trans|raw}}</li>
        {% else %}
          <li>{{'支持'|trans}}<strong>mp4, mp3</strong>{{'格式的文件上传，且文件大小不能超过'|trans}}<strong>{{ upload_max_filesize() }}</strong>。<br>{{'MP4文件的视频编码格式，请使用AVC(H264)编码，否则浏览器无法播放。'|trans}}</li>
            <li>{{'视频将上传到'|trans}}<strong>{{'网站服务器'|trans}}</strong>{{'，如需使用%Edusoho%云视频,点击'|trans({'%Edusoho%':'EduSoho'|copyright_less})}}<a href="http://open.edusoho.com/show/cloud/video" target="_blank">{{'这里'|trans}}</a>{{'了解详情。'|trans}}</li>
        {% endif %}
      </ul>
    </div>

    {% if storageSetting.upload_mode == 'cloud' %}
    <div class="quality-switcher">
      <div class="quality-switcher-bar">
        {{'视频转码类型'|trans}}<span class="color-gray quality-switcher-name"></span> <a href="javascript:;" class="edit-btn text-info"><span class="glyphicon glyphicon-cog"></span> {{'设置'|trans}}</a>
      </div>
      <div class="quality-switcher-control">
        <div class="video-quality radios">
          {{'画质：'|trans}}
        {{ radios('video_quality', {'low':'流畅 <span class="color-gray">(适合PPT讲解)</span>'|trans, 'normal':'标准 <span class="color-gray">(适合屏幕录制、摄像头拍摄)</span>'|trans, 'high': '精细 <span class="color-gray">(适合动态电影)</span>'|trans}, storageSetting.video_quality|default('low')) }}
        
        </div>

        <div class="audio-quality radios">
          {{'音质：'|trans}}
          {{ radios('video_audio_quality', {'low':'流畅'|trans, 'normal':'标准'|trans, 'high': '高品'|trans}, storageSetting.video_audio_quality|default('low')) }}
        </div>

        <div class="quality-actions">
          <a href="javascript:;" class="btn btn-default btn-sm confrim-btn">{{'确定'|trans}}</a>
          <a href="javascript:;" class="btn btn-link btn-sm cancel-btn">{{'取消'|trans}}</a>
        </div>
      </div>
    </div>
    {% endif %}
  {% elseif targetType == 'coursematerial' %}
    <div class="alert alert-info">
      <ul>
        <li>{{'支持常见文档、图片、音视频、压缩包文件格式。'|trans}}{% if storageSetting.upload_mode == 'local' %}{{'且文件大小不能超过'|trans}}<strong>{{ upload_max_filesize() }}</strong>。{% endif %}</li>
        {% if storageSetting.upload_mode == 'cloud' %}
          {{'<li>文件将上传到<strong>云服务器</strong>。</li>'|trans|raw}}
        {% else %}
          <li>{{'视频将上传到'|trans}}<strong>{{'网站服务器'|trans}}</strong>{{'，如需使用%Edusoho%云视频,点击'|trans({'%Edusoho%':'EduSoho'|copyright_less})}}<a href="http://open.edusoho.com/show/cloud/video" target="_blank">{{'这里'|trans}}</a>{{'了解详情。'|trans}}</li>
        {% endif %}
      </ul>
    </div>
  {% endif %}

{% endblock %}

{% block script %}
 {% include 'seajs_loader_compatible.html.twig' with {topxiawebbundle: true} %}
  <script>app.lazyLoad = function() { app.load('course-manage-file/upload-course-files') };</script>
 {% endblock %}

{% block footer %}
  <button type="button" class="btn btn-primary" data-dismiss="modal">{{'关闭'|trans}}</button>
{% endblock %}