<div class="thumbnail class-course-grid">
  {% if course.compulsory %}
    <span class="label label-success compulsory">必修</span>
  {% else %}
    <span class="label label-warning compulsory">选修</span>
  {% endif %}

  {% if course.status == 'closed' %}
    <span class="label label-danger compulsory">已关闭</span>
  {% endif %}

  <a href="{{ path('course_show',{id:course.id}) }}"><img  alt="{{ course.title }}" src="{{ file_path(course.middlePicture, 'course-large.png') }}"></a>
  <div class="caption">
    <a href="{{ path('course_show',{id:course.id}) }}"><h3 class="title">{{ course.title }}</h3></a>
    <div class="metas clearfix">
      {% if teacher %}
        <a href="{{ path('user_show',{id:teacher.id}) }}" class="pull-left">{{ teacher.truename}}</a>
      {% endif %}
      <span class="pull-right">{{ course.lessonNum}}个课时</span>
    </div>
  </div>
</div>