{% if learning_path.enrolled? %}
  {% assign lp_courses_count = 0 | times: 1 %}
  {% assign sum_of_progress = 0.0 | times: 1 %}
  {% for item in learning_path.items %}
    {% if item.course? %}
      {% assign lp_courses_count = lp_courses_count | plus: 1 %}
      {% assign sum_of_progress = sum_of_progress | plus: item.progress %}
    {% endif %}
  {% endfor %}
  {% if lp_courses_count == 0 %}
    {% assign lp_progress = 0 %}
  {% else %}
    {% assign lp_progress = sum_of_progress | divided_by: lp_courses_count | round %}
  {% endif %}
{% else %}
  {% assign lp_progress = 0 %}
{% endif %}
  <div class="np-top-cta-progress-content">
    <div class="np-top-cta-progress-text
        {% if lp_progress == 0 %} gray {% endif %}
    ">
      {% if lp_progress == 0 %}
        {% t shared.progress, count: lp_progress %}
      {% elsif lp_progress > 0 and lp_progress < 100 %}
        {{lp_progress}}%
      {% else %}
        <i class="fas fa-check-circle"></i> COMPLETED
      {% endif %}
    </div>
    <div class="np-progress-bar-container">
      <div
        style="width: {{ lp_progress }}%"
        class="np-button-background-color np-card-progress-bar">
      </div>
    </div>
  </div>


{% learning_path_next_step_button learning_path, class: "np-top-button np-button-font-color np-button np-button-big" %}
