{% extends 'TopxiaAdminBundle:Course:layout.html.twig' %}

{% block title %}课程数据 - {{ parent() }}{% endblock %}

{% set menu = 'course-data' %}

{% block main %}
    <div class="page-header">
    </div>
    <form id="message-search-form" class="form-inline well well-sm" action="{{ path('admin_course_data') }}" method="get" novalidate>
      <div class="form-group">
        <select class="form-control" name="categoryId">
          {{ select_options(category_choices('course'), app.request.query.get('categoryId'), '课程分类') }}
        </select>
      </div>
      <div class="form-group">
        <input class="form-control" type="text" placeholder="标题" name="title" value="{{ app.request.get('title') }}">
      </div>
      <div class="form-group">
        <input class="form-control" type="text" placeholder="创建者" name="creator" value="{{ app.request.get('creator') }}">
      </div>
      <button class="btn btn-primary">搜索</button>
    </form>
    <div class="table-responsive">
        <table class="table table-bordered" style="word-break:break-all;text-align:center;">
          <tr class="active">
            <td width="30%">课程名</td>
            <td>课时数</td>
            <td>学员人数</td>
            <td>完成课程人数</td>
            <td>课程学习时长（分）</td>
            <td>操作</td>
          </tr>
          
          {% if courses %}
            {% for course in courses %}
            <tr>
            <td><a data-toggle="modal" data-target="#modal" data-url="{{path('course_detail_data',{id:course.id})}}" href="javascript:">{{course.title}}</a></td>
            <td>{{course.lessonCount}}</td>
            <td>{{course.studentNum}}</td>
            <td>{{course.isLearnedNum}}</td>
            <td>{{course.learnTime}}</td>
            <td><a href="{{path('admin_course_lesson_data',{id:course.id})}}">查看课时数据</a></td>
            </tr>
            {% endfor %}
          {% endif %}
          
         
        </table>
     {{ web_macro.paginator(paginator) }}
      </div>


{% endblock %}