{% extends 'courseset-manage/layout.html.twig' %}
{% import 'macro.html.twig' as web_macro %}

{% block title %}{{ '试卷管理'|trans }} - {{ parent() }}{% endblock %}

{% set side_nav = 'testpaper' %}
{% set parentId = parentId | default(null) %}

{% do script(['app/js/testpaper-manage/index.js']) %}

{% block main %}

  <div class="panel panel-default panel-col">
    <div class="panel-heading">
      <a href="{{ path('course_set_manage_testpaper_create',{id:courseSet.id}) }}"
         class="btn btn-info btn-sm pull-right mls"><span class="es-icon es-icon-anonymous-iconfont"></span>{{ '创建试卷'|trans }}</a>
      {{ '试卷管理'|trans }}
    </div>

    <div class="panel-body " id="quiz-table-container">

      <table class="table table-striped table-hover" id="quiz-table">
        {{ web_macro.flash_messages() }}
        <thead>
        <tr>
          <th><input type="checkbox" autocomplete="off" data-role="batch-select"></th>
          <th width="20%">{{ '名称'|trans }}</th>
          <th>{{ '状态'|trans }}</th>
          <th>{{ '题目统计'|trans }}</th>
          <th>{{ '时间限制'|trans }}</th>
          <th >{{ '更新人/时间'|trans }}</th>
          <th width="15%">{{ '操作'|trans }}</th>
        </tr>
        </thead>
        <tbody>
        {% for testpaper in testpapers %}
          {% set user = users[testpaper.updatedUserId] %}
          {% include 'testpaper/manage/testpaper-list-tr.html.twig' %}
        {% else %}
          <tr>
            <td colspan="20">
              <div class="empty">{{ '还没有试卷，请点击右上角按钮，'|trans }}
                <a class="link-primary" href="{{ path('course_set_manage_testpaper_create',{id:courseSet.id}) }}">{{ '创建一个新试卷'|trans }}</a>
              </div>
            </td>
          </tr>
        {% endfor %}
        </tbody>
      </table>
      <div>
        <label class="checkbox-inline"><input type="checkbox" autocomplete="off" data-role="batch-select"> {{'全选'|trans}}</label>
        <button class="btn btn-default btn-sm mlm" data-role="batch-delete" data-name="{{ '试卷'|trans }}" data-url="{{ path('course_set_manage_testpaper_deletes',{courseSetId:courseSet.id}) }}">{{ '删除'|trans }}</button>
      </div>

      {{ web_macro.paginator(paginator) }}

      <div class="color-gray mtl">
        {{ '提示：试卷一旦发布不能修改，发布后的试卷需要'|trans }}
        <strong class="color-warning">{{ '添加到任务'|trans }}</strong>
        {{ '中才能正常使用。'|trans }}
      </div>
    </div>
  </div>

{% endblock %}



