{% capture course_label %}{% endcapture %}
{% capture course_data_label %}none{% endcapture %}  
{% assign course_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 course_is_new = true %}{% endif %}
{% if course_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 class="np-card featured-card" href="{% route course, id: course.id %}">
  <div class="np-card-container">
    <img src="{{ course.image_url }}" alt="{{ course.name }}" />
    <div class="card-content-wrapper">
      <div class="featured-card-title">
        {{ course.name }}
      </div>
      <div class="featured-card-desc">
        {{ course.short_description }}
      </div>
      <div class="card-info">
        {% if course.properties.course_length != 'NULL' %}
          <div class="card-content-length">{{ course.properties.course_length }}</div>
        {% endif %}
        {{course_label}}
      </div>
    </div>
  </div>
</a>