<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">
    <div class="title" title="{{ course.title }}">
      <a href="{{ path('course_show',{id:course.id}) }}">{{ course.title }}</a>
    </div>
    <div class="clearfix">
      {% if class %}
      <a href="{{ path('class_show',{ classId: class.id })}}" class="pull-left"><small>{{ class_name(class) }}</small></a>
      {% else %}
        <span class="text-sm text-muted">公有课程</span>
      {% endif %}
    </div>
  </div>
</div>