{% assign activities_count = 0 %}
{% assign quizzes_count = 0 %}

{% for course_section in course.sections %}
  {% for course_activity in course_section.activities %}
    {% assign activities_count = activities_count | plus: 1 %}

    {% if course_activity.type == "quiz" %}
      {% assign quizzes_count = quizzes_count | plus: 1 %}
    {% endif %} 
  {% endfor %}
{% endfor %} 

<div class="np-course-details">
    <div class="np-course-detail activities">                 
        {{ activities_count }}
        <span class="np-details-label">
          {% if activities_count == 1 %}Activity{% else %}Activities{% endif %}
        </span>
    </div>
    
  
    <div class="np-course-detail">
        {% if course.properties.course_length > 0 %}
            {{course.properties.course_length}}<span class="np-details-label">Mins to Complete</span>
        {% else %}
            <div>&nbsp;&nbsp;&nbsp;</div>
        {% endif %}
    </div>
    <a
      class="np-top-button np-button-font-color np-button np-button-big" href="{% route course_enrollment, code: course.enrollment_code %}"          
      >
        {% if course.enrolled? == false %}
          {% t shared.enroll %}
        {% elsif course.started? == false %}
          {% t shared.start, key: current_school.course_vocabulary %}
        {% elsif course.completed? %}
          {% t shared.course.view, key: current_school.course_vocabulary %}
        {% else %}
          {% t shared.continue %}
        {% endif %}
    </a>
</div>
