<div class="course-item">
  <div class="course-img">
    {% if courseSet.course is defined %}
      {% set course = courseSet.course %}
    {% else %}
      {% set course = data('PublishedCourseByCourseSet',{ courseSetId: courseSet.id } ) %}
    {% endif %}

    <a href="{{ path('course_show', {id: courseSet.defaultCourseId}) }}" target="_blank">
      {% if courseSet.discountId > 0 %}
        {% if courseSet.discount == 0 %}
          <!-- 限免 -->
          <span class="tag-discount free"></span>
        {% else %}
          <!-- 折扣 -->
          <span class="tag-discount"></span>
        {% endif %}
      {% endif %}
      {% if courseSet.serializeMode == 'serialized' %}
        <span class="tags"><span class="tag-serialing"></span></span>
      {% elseif courseSet.serializeMode == 'finished' %}
        <span class="tags"><span class="tag-finished"></span></span>
      {% endif %}
      {% if courseSet.type|default() == 'live' %}
        <span class="tags">
          <span class="tag-live"></span>
        </span>
      {% endif %}
      {% if courseSet.type|default() == 'reservation' %}
        <span class="tags">
          <span class="tag-reservation"></span>
        </span>
      {% endif %}
      {{ lazy_img(filepath(course_set_cover(courseSet, 'large'), 'courseSet.png'), 'img-responsive', courseSet.title) }}
    </a>
  </div>
  <div class="course-info">
    <div class="title">
      <a class="link-dark" href="{{ path('course_show', {id: courseSet.defaultCourseId}) }}" target="_blank">
        {{ courseSet.title }}
      </a>
    </div>
    <div class="metas clearfix">
      {% if setting('course.show_student_num_enabled', '1') == 1  %}
        <span class="num">
          {% if setting('course.show_cover_num_mode') == 'studentNum' %}
            <i class="es-icon es-icon-people"></i>{{ courseSet.studentNum }}
          {% elseif setting('course.show_cover_num_mode') == 'hitNum' %}
            <i class="es-icon es-icon-view"></i>{{ course.hitNum }}
          {% endif %}
        </span>
      {% endif %}
      {% if setting('course.show_review', '1') == 1 %}
        <span {% if setting('course.show_student_num_enabled', '1') == 1 %} class="comment" {% endif %}><i class="es-icon es-icon-textsms"></i>{{ courseSet.ratingNum }}</span>
      {% endif %}
      {% if courseSet.course.tryLookVideo|default(false) %}
        <span class="comment"><i class="es-icon es-icon-playcircleoutline"></i>{{'site.badge.try_watch'|trans}}</span>
      {% endif %}
      {# {% if course and priceFor|default('course') == 'course' %} #}
        {# {% include 'course/widgets/price.html.twig' with {shows:'price'} %} #}
      {# {% else %} #}
        {% include 'course/widgets/course-set-price.html.twig' with {shows: 'price'} %}
      {# {% endif %} #}
    </div>
  </div>
</div>