{% capture course_path %}{% route course, id: course.id %}{% endcapture %}
{% capture course_label %}{% endcapture %}{% capture course_data_label %}none{% endcapture %}

{% assign is_new = false %}
{% assign created_at_date_seconds = current_person.created_at | date: "%s" %}
{% assign course_published_date_seconds = course.properties.initial_publish_date | date: "%s" %}

{% if course_published_date_seconds > created_at_date_seconds %}
  {% assign is_new = true %}
{% endif %}

{% if is_new %}
  {% if course.progress == 0 %}
    {% capture course_label %}<div class="label label-green new-topic-label">New</div>{% endcapture %}
    {% capture course_data_label %}new{% endcapture %}
  {% endif %}
{% endif %}

{% if course.progress > 0 and course.progress < 100 %}
  {% capture course_label %}<div class="label label-orange">In progress</div>{% endcapture %}
  {% capture course_data_label %}in-progress{% endcapture %}
{% elsif course.completed? %}
  {% capture course_label %}<div class="label label-gray">Viewed</div>{% endcapture %}
  {% capture course_data_label %}viewed{% endcapture %}
{% endif %}

<a href="{{ course_path }}" class="np-card-condensed" data-label="{{course_data_label}}">
  <div class="np-card-condensed-content-wrapper">
    <div class="title-wrapper">
      <div class="np-course-title">{{ course.name }}</div>
      <div class="np-card-condensed-content-description">
        {{ course.full_description }}
      </div>
      <div class="info-wrapper">
        {% if course.properties.course_length != 'NULL' %}
          <div class="card-content-length">{{ course.properties.course_length }}</div>
        {% endif %}
      <div class="labels-wrapper">{{course_label}}</div>
      </div> 
    </div>
  </div>
</a>