{% assign activities_count = 0 %}
{% for course_section in course.sections %}
  {% for course_activity in course_section.activities %}
    {% assign activities_count = activities_count | plus: 1 %}
  {% endfor %}
{% endfor %} 
{%comment%}{% capture course_path %}{% route course, id: course.id %}{% endcapture %}{%endcomment%}
{% capture course_path %}{% route course_viewer, course_id: course.id, learning_path_id: params.learning_path_id %}{% endcapture %}
{% capture enroll_path %}{% route course_enrollment, code: course.enrollment_code %}{% endcapture %}

<div class="rcmmnd-card-wrapper" style="height: 100%">
    <div class="rcmmnd-card row">
        <div class="rcmmnd-card-left-wrapper col-lg-6">
            <div class='rcmmnd-card-left'>
                <div class="rcmmnd-card-left-lessons">
                    {{activities_count}} LESSONS COURSE
                </div>
                <div class="rcmmnd-card-left-title">
                    {{course.name}}
                </div>
                <div class="rcmmnd-card-left-subtitle">
                    {{course.short_description}}
                </div>
                    <a href={% if course.enrolled? %}{{ course_path }}{% else %}{{ enroll_path }}{% endif %}>
                        <button class="rcmmnd-card-left-button">
                            {% if course.enrolled? %}Start course{% else %} Enroll in course{% endif %}
                        </button>
                    </a>
            </div>
        </div>
        <div class="rcmmnd-card-right-wrapper col-lg-6">
            <div class="rcmmnd-card-right" style="overflow-x:hidden">
                <img class='rcmmnd-card-right-image' src='{{course.image_url}}'>
                <div class="rcmmnd-card-right-background"></div>
            </div>
        </div>
    </div>
</div>