{% assign totalCountInProg = 0 %}
{% for course in courses.enrolled %}
  {% if course.progress > 0 and course.progress < 100 %}
    {% assign totalCountInProg = totalCountInProg | plus: 1 %}
  {% endif %}
{% endfor %}

{%- comment -%} {% if totalCountInProg > 3 %}
  <div class="carousel-buttons-container">
    <div class="np-dashboard-resources-title">
      In Progress
    </div>
    <div style="display: flex">
      <div class="previous-carousel-button previous-courses-button" onclick="sliderInProg.goTo('prev')">
        <i class="far fa-solid fa-arrow-left"></i>
      </div>
      <div class="next-carousel-button next-courses-button" onclick="sliderInProg.goTo('next')">
        <i class="far fa-solid fa-arrow-right"></i>
      </div>
    </div>
  </div>
{% else %}
{% endif %} {%- endcomment -%}
{%- comment -%} <div class="np-dashboard-resources-title">
  In Progress
</div> {%- endcomment -%}

{%- comment -%} <div class="row row-with-thumbnails courses-in-prog-carousel
  {% if outerClass %}
    {{outerClass}}
  {% endif %} 
  {% if totalCountInProg <= 3 %}
    col-xs-12 np-stretch-content
  {% endif %}" 
  {% if totalCountInProg <= 3 %}
    style="padding: 0;"
  {% else %}
    style="margin-left: 0;"
  {% endif %}>
    {% for course in courses.enrolled %}
      {% if course.progress > 0 and course.progress < 100 %}
        <div class="course-card-wrapper {% if totalCountInProg <= 3 %}col-xs-12 col-sm-4{% endif %}" {% if totalCountInProg <= 3 %} style="padding: 0" {% endif %} data-product="{{ course.properties.product_names_for_course_cards}}">
          {% include "cards_course" with course, flag: 'inProg' %}
        </div>
      {% endif %}
    {% endfor %}
</div> {%- endcomment -%}

<div class="row row-with-thumbnails courses-in-prog col-xs-12 np-stretch-content
  {% if outerClass %}
    {{outerClass}}
  {% endif %}" 
  style="padding: 0;">
    {% for course in courses.enrolled %}
      {% if course.progress > 0 and course.progress < 100 %}
        <div class="course-card-wrapper col-xs-12 col-sm-6 col-md-4" style="padding: 0" data-product="{{ course.properties.product_names_for_course_cards}}">
          {% if outerClass == "dashboard-courses-index" %}
            {% include "cards_course" with course, flag: 'dashboard' %}
          {% else %}
            {% include "cards_course" with course %}
          {% endif %}
        </div>
      {% endif %}
    {% endfor %}
</div>