{% include "header" %}
{% include "course_version_outdated_alert", courses: courses.enrolled %}
<div class="np-homepage-hero">
  <img class="np-homepage-hero-image"
    src="{{ homepage.artwork_url }}"
    alt="{{ homepage.headline }}"
  />
  <div class="np-homepage-hero-content">
    <div class="np-homepage-headline np-header-font-color" style="width: 100%;margin-top: -15%;margin-bottom: 4%;">
      {{ homepage.headline }}
    </div>
    <div class="np-homepage-subheadline np-header-font-color" style="width: 100%">
      {{ homepage.subheadline }}
    </div>
    {% comment %}
    <br>
    <form class='searchBarContainer' action="{% route search %}" method="get" data-test="desktop-search" style="margin-top: 20px; margin-right: 50%; text-align: center; width: 200%;">
      <br>
      <input
        aria-label="searchBar"
        id="searchBar"
        type="text"
        name="q"
        placeholder="Search"
      >
        <i class="fas fa-search" ></i>
      </input>
    </form>
    {% endcomment %}
  </div>
</div>

<main class="np-main np-dashboard np-subpage-container np-max-width">
  <!-- Progress Widget and Featured Course -->
  <div class="row np-flex-center">
    <div class="col-xs-12 col-md-4">
      {% include "widget_course_progress" %}
    </div>

    <div class="col-xs-12 col-sm-8">
      
      {% if courses.featured.any? %}
        <div class="row">
          {% for course in courses.featured %}
            <div class="col-xs-12 col-sm-8 col-md-12">
              {% include "cards_featured_course" with course %}
            </div>
          {% endfor %}
        </div>
      {% else %}
        <div class="row np-homepage-featured-empty">
          <div class="np-zero-state-text">
            {%comment%}{% t .empty, key: current_school.course_vocabulary %}{%endcomment%}
            <p class="np-dashboard-resources-title">No Featured Course Available</p>
          </div>
          <img
            class="np-zero-state-courses"
            alt="{% t .empty, key: current_school.course_vocabulary %}"
          />
        </div>
      {% endif %}
    </div>
  </div>

  <!-- Continuing courses Carousel -->
  <div class="col-xs-12">
    {% if courses.enrolled.any? %}
      {% 
        include "carousel_courses_continue", 
        items: courses.enrolled
      %}
    {% else %}
      <div class="np-dashboard-resources-title" style="margin-bottom:19px;">
        Courses
      </div>
      {% capture message %}
        {% t shared.zero_state.courses.index,
          key: current_school.course_vocabulary
        %}
      {% endcapture %}
      <div style="margin-bottom:3rem;">
        {% include "courses_zero_state", message: message %}
      </div>
    {% endif %}
  </div>

  <h1 style="color: #E1E5F0;; max-width: 100%;margin-left: -60px">___________________________________________________________________________________________________</h1>

  <!-- Courses by Category -->
  <!-- Compliance -->
  <div class="col-xs-12">
    {% if courses.enrolled.any? %}
      {% if categories.enrolled.any? %}
        {% assign all_categories = categories.enrolled | map: "name" %}
          {% 
            include "carousel_courses_compliance", 
            items: courses.enrolled
          %}
      {% endif %}
    {% else %}
        <div class="np-dashboard-resources-title" style="margin-bottom:19px;">
          Courses
        </div>
        {% capture message %}
          {% t shared.zero_state.courses.index,
            key: current_school.course_vocabulary
          %}
        {% endcapture %}
        <div style="margin-bottom:3rem;">
          {% include "courses_zero_state", message: message %}
        </div>
    {% endif %}
  </div>

  <!-- Department Specific -->
  <div class="col-xs-12">
    {% if courses.enrolled.any? %}
      {% if categories.enrolled.any? %}
        {% assign all_categories = categories.enrolled | map: "name" %}
          {% 
            include "carousel_courses_departmentSpecific", 
            items: courses.enrolled
          %}
      {% endif %}
    {% else %}
        <div class="np-dashboard-resources-title" style="margin-bottom:19px;">
          Courses
        </div>
        {% capture message %}
          {% t shared.zero_state.courses.index,
            key: current_school.course_vocabulary
          %}
        {% endcapture %}
        <div style="margin-bottom:3rem;">
          {% include "courses_zero_state", message: message %}
        </div>
    {% endif %}
  </div>

  <!-- Governance -->
  <div class="col-xs-12">
    {% if courses.enrolled.any? %}
      {% if categories.enrolled.any? %}
        {% assign all_categories = categories.enrolled | map: "name" %}
          {% 
            include "carousel_courses_governance", 
            items: courses.enrolled
          %}
      {% endif %}
    {% else %}
        <div class="np-dashboard-resources-title" style="margin-bottom:19px;">
          Courses
        </div>
        {% capture message %}
          {% t shared.zero_state.courses.index,
            key: current_school.course_vocabulary
          %}
        {% endcapture %}
        <div style="margin-bottom:3rem;">
          {% include "courses_zero_state", message: message %}
        </div>
    {% endif %}
  </div>

  <!-- Wellness Workshops -->
  <div class="col-xs-12">
    {% if courses.enrolled.any? %}
      {% if categories.enrolled.any? %}
        {% assign all_categories = categories.enrolled | map: "name" %}
          {% 
            include "carousel_courses_wellnessWorkshops", 
            items: courses.enrolled
          %}
      {% endif %}
    {% else %}
        <div class="np-dashboard-resources-title" style="margin-bottom:19px;">
          Courses
        </div>
        {% capture message %}
          {% t shared.zero_state.courses.index,
            key: current_school.course_vocabulary
          %}
        {% endcapture %}
        <div style="margin-bottom:3rem;">
          {% include "courses_zero_state", message: message %}
        </div>
    {% endif %}
  </div>
</main>

{% include "footer" %}

<script>

  $(document).ready(function(){
    $(".courses-carousel").not('.slick-initialized').slick({
      slidesToShow: 3,
      cssEase: 'linear',
      prevArrow: '<i class="fal fa-chevron-left"></i>',
      nextArrow: '<i class="fal fa-chevron-right"></i>',
      infinite: false,
      responsive: [
        {
          breakpoint: 1170,
          settings: {
              slidesToShow: 2,
          }
        },
        {
          breakpoint: 768,
          settings: {
              slidesToShow: 1,
              slidesToScroll: 1,
              dots: false,
              arrows: true,
          }
        }
      ]
    }); 

    $(".continuing-carousel").not('.slick-initialized').slick({
      slidesToShow: 1.8,
      cssEase: 'linear',
      prevArrow: '<i class="fal fa-chevron-left"></i>',
      nextArrow: '<i class="fal fa-chevron-right"></i>',
      infinite: false,
      responsive: [
        {
          breakpoint: 1170,
          settings: {
              slidesToShow: 2,
          }
        },
        {
          breakpoint: 768,
          settings: {
              slidesToShow: 1,
              slidesToScroll: 1,
              dots: false,
              arrows: true,
          }
        }
      ]
    });  
  });
  
      
      
</script>



{%comment%}{% include "header" %}
{% include "course_version_outdated_alert", courses: courses.featured %}
<main class="np-main np-homepage">
  <div class="np-homepage-hero">
    <img class="np-homepage-hero-image"
      src="{{ homepage.artwork_url }}"
      alt="{{ homepage.headline }}"
    />
    <div class="np-homepage-hero-content">
      <div class="np-homepage-headline np-header-font-color">
        {{ homepage.headline }}
      </div>
      <div class="np-homepage-subheadline np-header-font-color">
        {{ homepage.subheadline }}
      </div>
      <a class="np-homepage-hero-cta np-button" href="{% route catalog %}">
        {% t .discover %}
      </a>
    </div>
  </div>
  {% include "sub_navigation" %}
  <div class="np-homepage-featured np-max-width">
    <div class="np-homepage-featured-text">
      <div class="np-homepage-headline">
        {{ homepage.featured_courses_headline }}
      </div>
      <div class="np-homepage-subheadline">
        {{ homepage.featured_courses_subheadline }}
      </div>
    </div>
    {% if courses.featured.any? %}
      <div class="np-homepage-featured-courses row">
        {% for course in courses.featured %}
          <div class="col-xs-12 col-md-6 col-lg-4 np-stretch-content">
            {% include "cards_course" with course %}
          </div>
        {% endfor %}
      </div>
    {% else %}
      <div class="np-homepage-featured-empty">
        <div class="np-zero-state-text">
          {% t .empty, key: current_school.course_vocabulary %}
        </div>
        <img
          class="np-zero-state-courses"
          alt="{% t .empty, key: current_school.course_vocabulary %}"
        />
      </div>
    {% endif %}
  </div>
</main>
{% include "footer" %}{%endcomment%}