{%comment%}{% if learning_path.progress == 0%}
  {% assign wrapperClassBar =  "np-button-background-color np-card-progress-bar red-bar"%}
  {% assign wrapperClassStatus =  "np-card-content-progress np-button-color red-text"%}
{% else if learning_path.progress > 0 and learning_path.progress < 100%}
  {% assign wrapperClassBar =  "np-button-background-color np-card-progress-bar yellow-bar"%}
  {% assign wrapperClassStatus =  "np-card-content-progress np-button-color yellow-text"%}
{% else %}
  {% assign wrapperClassBar =  "np-button-background-color np-card-progress-bar green-bar"%}
  {% assign wrapperClassStatus =  "np-card-content-progress np-button-color green-text"%}
{% endif %}{%endcomment%}

{% 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 %}

{% if learning_path.enrolled? %}
  <div class="np-top-cta-progress-content">
    <div class="np-top-cta-progress-title np-text-title lp">
      {% t .progress %}
    </div>
    <div class="np-progress-bar-container">
      <div
        style="width: {{ lp_progress }}%"
        class="np-button-background-color np-card-progress-bar">
      </div>
    </div>
    <div class="np-card-content-progress
      {% if learning_path.completed? %} np-color-success {% else %} np-button-color {% endif %}
    ">
      {% t shared.progress, count: lp_progress %}
    </div>
  </div>
{% endif %}

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