<input type="hidden" name="media" id="media">
<div class="file-chooser-bar {% if not file|default(null) %}hidden {% endif %}">
  <span data-role="placeholder">{{ file.filename|default(null) }}</span>
  <button class="btn btn-link btn-sm js-choose-trigger" type="button">
    <i class="glyphicon glyphicon-edit"></i>
    {{ '编辑'|trans }}
  </button>

  <div class="alert alert-warning" data-role="waiting-tip"
       style="display:none;">{{ '正在转换视频格式，转换需要一定的时间，期间将不能播放该视频。'|trans }}<br/>{{ '转换完成后将以站内消息通知您。'|trans }}
  </div>
</div>
<div class="file-chooser-main {% if file|default(null) %}hidden {% endif %}">
  <div class="file-chooser-nav">
    <ul class="nav nav-pills nav-pills-sm  nav-pills-gray mb0" id="material">
      <li role="presentation" class="active"><a
            href="#chooser-upload-panel">上传资料</a></li>
      <li role="presentation"><a href="#chooser-material-panel">从资料库中选择</a></li>
      <li role="presentation"><a href="#chooser-course-panel">从课程中选择文件</a></li>
      {% if mediaType == 'video' and not hideImportVideo|default(false) %}
        <li role="presentation" >
          <a class="js-import-video" href="#import-video-panel" data-link="{% if link|default(null) and link != 'self' %} {{ link }}{% endif %}">导入网络视频</a>
        </li>
      {% endif %}
      {% if mediaType == 'download' %}
        <li role="presentation"><a href="#import-link-panel">网络连接</a>
        </li>
      {% endif %}
    </ul>
  </div>
  <div class="tab-content ">
    <div class="tab-pane file-chooser-tab active" id="chooser-upload-panel">
      {% include 'file-chooser/parts/upload-file.html.twig' %}
    </div>

    <div class="tab-pane " id="chooser-material-panel">
      {% include 'file-chooser/parts/materiallib-choose.html.twig' %}
    </div>

    <div class="tab-pane file-chooser-tab" id="chooser-course-panel">
      {% include 'file-chooser/parts/course-file-choose.html.twig' %}
    </div>

    {% if mediaType == 'video' and not hideImportVideo|default(false) %}
      <div class="tab-pane file-chooser-tab" id="import-video-panel">
        {% include 'file-chooser/parts/import-video.html.twig' %}
      </div>
    {% endif %}

    {% if mediaType == 'download' %}
      <div class="tab-pane file-chooser-tab" id="import-link-panel">
        {% include 'file-chooser/parts/import-link.html.twig' %}
      </div>
    {% endif %}
  </div>

</div>

{% if mediaType == 'download' %}
  <p class="mbl mtl"><label>资料名称：</label><span class="js-current-file">(请上传或选择资料)</span></p>
  <div class="row">
    <div class="col-sm-10"><input class="form-control " type="text" id="file-summary" placeholder="填写资料简介（可选）"></div>
    <div class="col-sm-2"><a class="btn btn-primary btn-block js-add-file-list">添加资料</a></div>
  </div>
  <span class="color-success js-success-redmine"></span>
  <span class="color-danger js-danger-redmine"></span>
{% endif %}
