{% include "subheader_search" %}{% include "course_version_outdated_alert"
  , courses: courses.featured %}

{% comment %} Check if there are any courses in progress {% endcomment %}
{% assign hasInProgressCourses = false %}
{% for course in courses.enrolled %}
  {% if course.progress > 0 and course.progress < 100 %}
    {% assign hasInProgressCourses = true %}
    {% break %}
  {% endif %}
{% endfor %}

<main class="np-main np-homepage np-subpage-container">
  <div class="np-homepage-featured np-max-width">
    <div class="global-section-title">
      <span class="lang-en">In progress</span>
      <span class="lang-es">En progreso</span>
    </div>

    {% if hasInProgressCourses %}
      <div class="global-section-subtitle">
        <span class="lang-en">Continue where You left off</span>
        <span class="lang-es">Continúa donde lo dejaste</span>
      </div>
      {% include "carrot_button"
        , buttonUrl: "/app/dashboard"
        , buttonText: "For you page"
        , buttonTextEs: "Para tu página" %}
      {% include "courses_catalog"
        , courseslist: courses.enrolled
        , filterInProgress: true
        , eventId: "" %}
    {% else %}
      <div class="global-section-subtitle">
        <span class="lang-en">No lessons are in progress</span>
        <span class="lang-es">No hay lecciones en progreso</span>
      </div>
      {% include "carrot_button"
        , buttonUrl: "/app/catalog"
        , buttonText: "View all lessons"
        , buttonTextEs: "Ver todas las lecciones" %}
    {% endif %}
  </div>
</main>
{% include "footer" %}