{% assign completed_courses_count = 0%}
{% assign first_level_completed = false %}
{% assign orientation_course = '91007f87-8d34-4f17-80fd-bd8cb44395e4' %}
{% assign ANZ_group = 'eeabc17d-8364-42fc-b667-c83ca18797f8' %}
{% assign ANZ = false %}
{% assign first_level_courses = '0c3468c6-a6b1-47ca-ad01-49983bf11808,d770f3b2-029e-4def-a420-7841edb1234f,d4227707-e8d4-42dc-a80c-e7d60deb37f6' | split: ',' %}


{% for group in current_person.groups %}
  {% if group.id == ANZ_group %}
    {% assign ANZ = true %}
    {% break %}
  {% endif %}
{% endfor %}

{% for course in courses.enrolled %}
  {% for cat in course.categories %}
    {% if cat.name == "Dasher101" %}
      {% if course.progress == 100%}
        {% assign completed_courses_count = completed_courses_count | plus: 1 %}
      {% endif %}
    {% endif %}
  {% endfor %}
  {% if ANZ and first_level_completed == false %}
    {% if first_level_courses contains course.id  %}
      {% if course.completed? %}
        {% assign first_level_completed = true %}
      {% endif %}
    {% endif %}
  {% endif %}
{% endfor %}

{% if courses.enrolled.any? %}
<script>console.log('{{completed_courses_count}}')</script>
  {% if completed_courses_count > 7%}
    <div class="np-learning-paths-resources">
      {% for course in courses.enrolled %}
        {% assign course_categories = course.categories | map: 'name' %}
        {% if course_categories contains "Feedback" %}
            {% include 'cards_course_lp' with course %}
        {% endif %}
      {% endfor %}
    </div>
  {% endif %}
  <div class="row row-with-thumbnails">
    {% if ANZ %}
      {% for course in courses.enrolled %}
        {% assign course_categories = course.categories | map: 'name' %}
        {% unless course_categories contains "Feedback" %}
          {% if course.id != orientation_course or first_level_completed %}
            {% include "cards_course" with course %}
          {% endif %}
        {% endunless %}
      {% endfor %}
    {% else %}
      {% for course in courses.enrolled %}
        {% assign course_categories = course.categories | map: 'name' %}
        {% unless course_categories contains "Feedback" %}
          {% include "cards_course" with course %}
        {% endunless %}
      {% endfor %}
    {% endif %}
  </div>
{% else %}
  {% capture message %}
    {% t shared.zero_state.courses.index,
      key: current_school.course_vocabulary
    %}
  {% endcapture %}
  {% include "courses_zero_state", message: message %}
{% endif %}
