{% extends 'es-bar/list-content/study-place.html.twig' %}
{% set esBarMenu = 'course' %}
{% block myStudyPlace %}
{% if courses %}
  <!-- 课程 -->
  <ul class="course-grids">
    {% set courseCount = 15 %}
    {% for course in courses %}
      {% set courseCount = loop.length %}
      {% set courseSet = data('CourseSet',{id:course.courseSetId}) %}
      <li class="course-grid mt0">
        <a href="{{ path('course_show', {id:course.id}) }}" class="grid-body" style="width: auto">
          <div class="course-grid-img">
            <img src="{{ filepath(course_set_cover(courseSet, 'middle'), 'courseSet.png') }}" class="img-responsive thumb">
            <div class="course-grid-mask">
              <span class="btn btn-warning btn-sm course-grid-btn-learn">
                继续学习
              </span>
            </div>
          </div>
          <div class="progress progress-sm mb0">
            <div class="progress-bar" role="progressbar" aria-valuenow="{{ course.percent }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ course.percent }}%" data-toggle="tooltip" data-placement="right" title="" data-original-title="40%">
            </div>
          </div>
          <div class="title">
             {{ courseSet.title|sub_text(6) }}
             <span class="pull-right color-primary text-12" >
              <span class="gray-light mrs">|</span>
              {{ course.title|sub_text(6) }}
            </span>
          </div>
        </a>
      
      </li>
    {% endfor %}
  </ul>
  {% if courseCount >= 15 %}
    <p class="text-center"><a class="link-dark" href="{{ path('my_courses_learning') }}" target="_blank">{{'更多'|trans}}<i class="es-icon es-icon-angledoubleright"></i></a></p>
  {% endif %}
{% else %}
  <div class="empty">{{'暂无课程'|trans}}</div>
{% endif %}
{% endblock %}