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

{% block title %}{{'文件移除'|trans}}{% endblock %}

{% block body %}

  {% if courseSet.type in ['open','liveOpen'] %}
    {% set deleteUrl = path('open_course_manage_files_delete', {id:courseSet.id}) %}
  {% else %}
    {% set deleteUrl = path('course_set_manage_delete_materials', {id:courseSet.id}) %}
  {% endif %}
	<form id="material-delete-form" class="form-horizontal" method="post" action="{{ deleteUrl }}" onsubmit="return false">

    <div class="form-group">
      <div class="controls mll">
        <span>{{'文件将从该课程中移除关联'|trans}}</span>
      </div>
      <div class="controls mll mtl">
				<input type="checkbox" name="isDeleteFile" value="1" />
      	{{'同时在我的教学资料中删除相关文件'|trans}}
      </div>

      {% include 'courseset-manage/file/file-used-in-material-list.html.twig' %}
    </div>
    
    <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">

  </form>
{% endblock %}

{% block footer %}
    <div class="pull-left pts"> 
      <span class="color-danger">{{'文件若被引用，移除或删除会引起引用任务无法正常使用'|trans}}</span>
    </div>
    <button class="btn btn-danger material-delete-form-btn" type="submit" data-toggle="form-submit" data-target="#material-delete-form" data-loading-text="{{'正在删除'|trans}}...">{{'确认'|trans}}</button>
    
    {% include 'seajs_loader_compatible.html.twig' with {topxiawebbundle: true} %}
    <script>app.lazyLoad = function() { app.load('course-manage-file/material-delete') };</script>
    
{% endblock %}