<div class="my-course-item cd-mb16 clearfix">

  <a class="my-course-item__link" href="{{ path('course_set_show', {id:courseSet.id}) }}">
    {{ lazy_img(filepath(course_set_cover(courseSet, 'large'), 'courseSet.png'), 'my-course-item__picture', courseSet.title) }}
    {% include 'my/learning/course/courses-block-label.html.twig' %}
  </a>
  <div class="my-course-item__info">
    <div class="my-course-item__title text-overflow">
      <a class="cd-link-major" href="{{ path('course_set_show', {id:courseSet.id}) }}">{{ courseSet.title }}</a>
    </div>

    {% if classroom|default(null) %}
      <div class="my-course-item__classroom text-overflow">
        <span>{{ 'course.block_grid.from_classroom'|trans }}<a class="cd-link-assist" href="{{ path('classroom_show', {'id':classroom.id}) }}">{{ classroom.title }}</a></span>
      </div>
    {% endif %}

    {% set percent = courseSet.percent ~ '%' %}
    <div class="my-course-item__progress cd-mt32 cd-clearfix">
      <span class="my-course-item__progress__text">{{ 'course.members_manage.official_student.progress'|trans }}</span>
      <div class="cd-progress cd-progress-sm">
        <div class="progress-bar">
          <div class="progress-outer">
            <div class="progress-inner" style="width: {{ percent }};"></div> 
          </div>
        </div>
        <div class="progress-text">{{ percent }}</div>
      </div>
    </div>
  </div>

  {% if currentCourses|length > 1 %}
    <div class="my-course-item__btn my-course-item__dropdown cd-dropdown cd-dropdown-right" data-toggle="cd-dropdown">
      <a class="btn cd-btn cd-btn-primary dropdown-toggle" href="javascript:;">{% if type == 'learned' %}{{ 'course.block_grid.view_course_btn'|trans }}{% else %}{{ 'course.block_grid.countinue_learn_btn'|trans }}{% endif %}</a>
      <ul class="dropdown-menu" role="menu">
        {% for course in currentCourses %}
          {% set member = members[course.id]|default(null) %}
          <li><a class="clearfix" href="{{ path('my_course_show', {id:course.id}) }}"><span class="pull-right">{{ member.learnedCompulsoryTaskNum|default(0) }}&nbsp;<span class="cd-dark-assist">/{{ course.compulsoryTaskNum }}</span></span>{{ course.title|sub_text(10) }}</a></li>
        {% endfor %}
      </ul>
    </div>
  {% else %}
    <div class="my-course-item__btn">
      <a class="btn cd-btn cd-btn-primary" href="{{ path('my_course_show', {id:currentCourses[0].id}) }}">{% if type == 'learned' %}{{ 'course.block_grid.view_course_btn'|trans }}{% else %}{{ 'course.block_grid.countinue_learn_btn'|trans }}{% endif %}</a>
    </div>
  {% endif %}
</div>