{% block courseBox %}
    <article class="course-box {{ courseBoxClasses|join(' ') }}" data-course-id="{{ course.idCourse }}">

        {% block courseBoxCover %}
            <div class="course-box__cover" {% if course.use_logo_in_courselist %} style="background-image: url( {{ course.img_course }})"{% endif %}></div>
        {% endblock %}

        {% block courseBoxHeader %}
            <header class="course-box__header">
                {% block icon %}
                    <div class="course-box__icon icon--filter-{{ course.user_status }}"></div>
                    {# <div class="course-box__icon"><i class='fa fa-graduation-cap'></i></div> #}
                {% endblock %}

                {% block role %}
                    <div class="course-box__icon course-box__owner--{{ course.level_icon }}"
                         aria-label="{{ course.level_text }}"></div>
                {% endblock %}
            </header>
        {% endblock %}

        {% block courseBoxCategory %}
            {% if (course.nameCategory) %}
                <div class="course-box__category">
                    {{ course.nameCategory }}
                </div>
            {% endif %}
        {% endblock %}
        {% block showOptions %}
            {% if course.show_options %}
                <nav class="course-box__nav">
                    <div class="course-box__options dropdown pull-right">
                        <div class="dropdown-toggle" id="courseBoxOptions" data-toggle="dropdown" aria-haspopup="true"
                             aria-expanded="true">
                            <i class="glyphicon glyphicon-option-horizontal"></i>
                        </div>

                        <ul class="dropdown-menu" aria-labelledby="courseBoxOptions">
                            {% if course.userCanUnsubscribe  and course.is_enrolled %}
                                {% block unsubscribe %}
                                    <li>
                                        <a href="javascript:confirmDialog('{{ course.name }}', {{ course.idCourse }})">{{ Lang_translate('_SELF_UNSUBSCRIBE', 'course') }}</a>
                                    </li>
                                {% endblock %}
                            {% endif %}
                            {% if course.course_demo %}
                                {% block demo %}
                                    <li>
                                        <a href="index.php?r=catalog/downloadDemoMaterial&amp;course_id={{ course.idCourse }}"> {{ Lang_translate('_COURSE_DEMO', 'course') }}</a>
                                    </li>
                                {% endblock %}
                            {% endif %}
                        </ul>
                    </div>
                </nav>
            {% endif %}
        {% endblock %}



        {% block courseBoxTitle %}
            {# <strong>{{ course.name }}</strong> #}
            <div class="course-box__title {{ course.tooltipClass }}">{{ course.name }}</div>
                        <span class="twig-course-tooltipElement_raw">{{ course.tooltipElement|raw }}</span>
        {% endblock %}

        {% block courseBoxDescription %}
            <div class="course-box__description"> {{ course.box_description|raw }} </div>
        {% endblock %}

        {% block courseBoxCta %}
            <div class="course-box__cta">
                {% if course.course_type == 'classroom' and course.editions|length > 0 %}
                    {% if "course-box--disabled" not in courseBoxClasses %}
                        <div class="course-box__extrainformation">
                            {% block courseBoxMyCoursesNextLesson %}
                                <div class="course-box__next">
                                    <span class="course-box__next__text">{{ Lang_translate('_NEXT_LESSON', 'course') }}</span>
                                    <span class="course-box__next__value">{{ course.next_lesson }}</span>
                                </div>
                                <div class="course-box__allDates">
                                    <a href="javascript:;"
                                       onclick="openAllDatesPopup({{ course.idCourse }})">{{ Lang_translate('_SHOW_ALL_DATES', 'course') }}</a>
                                    <div class="show-all-dates-popup" data-overlay="course-{{ course.idCourse }}">
                                        <div id="pop_up_container" class="yui-module yui-overlay yui-panel">
                                            <a class="container-close" href="javascript:;"
                                               title="{{ Lang_translate('_CLOSE', 'standard') }}" onclick="closeAllDatesPopup({{ course.idCourse }})"></a>
                                            <div class="hd" id="pop_up_container_h">{{ course.name }}</div>
                                            <div class="bd">
                                                <div class="edition_container">
                                                    <table class="edition_table">
                                                        <thead>
                                                        <tr>
                                                            <th>{{ Lang_translate('_DAY', 'course') }}</th>
                                                            <th>{{ Lang_translate('_HOUR_BEGIN', 'course') }}</th>
                                                            <th>{{ Lang_translate('_HOUR_END', 'course') }}</th>
                                                            <th>{{ Lang_translate('_LOCATION_INFO', 'classroom') }}</th>
                                                        </tr>
                                                        </thead>
                                                        <tbody>
                                                        {% for id_edition, days in course.editions %}
                                                            <tr>
                                                                <td colspan=4>{{ Lang_translate('_EDITION') }}
                                                                    :&nbsp; {{ days.name }}
                                                                <td>
                                                            </tr>
                                                            {% if course.userCanUnsubscribe %}
                                                                <tr>
                                                                    <td colspan=4><a
                                                                                href="javascript:confirmDialog('{{ course.name }}','{{ course.idCourse }}','{{ id_edition }}')">{{ Lang_translate('_SELF_UNSUBSCRIBE', 'course') }}</a>
                                                                    <td>
                                                                </tr>
                                                            {% endif %}
                                                            {% for day in days.days %}
                                                                <tr>
                                                                    {% if day.day in course.next_lesson %}
                                                                        <td><b>{{ day.day }}</b></td>
                                                                        <td><b>{{ day.begin }}</b></td>
                                                                        <td><b>{{ day.end }}</b></td>
                                                                        <td><b>{{ day.classroom }}</b></td>
                                                                    {% else %}
                                                                        <td>{{ day.day }}</td>
                                                                        <td>{{ day.begin }}</td>
                                                                        <td>{{ day.end }}</td>
                                                                        <td>{{ day.classroom }}</td>
                                                                    {% endif %}
                                                                </tr>
                                                            {% endfor %}
                                                        {% endfor %}
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            {% endblock %}
                        </div>
                    {% endif %}
                {% else %}
                    {% block closingdate %}
                        {% if course.dateClosing_year > 0 %}
                            <div class="course-box__closingdate">
                                <span class="course-box__closingdate__text">{{ Lang_translate('_CLOSING_DATA', 'course') }}</span>
                                <span class="course-box__closingdate__value">{{ course.dateClosing_day }} {{ course.dateClosing_month }} {{ course.dateClosing_year }}</span>
                            </div>
                        {% endif %}
                    {% endblock %}
                {% endif %}

                {% block entercourse %}
                    {% if course.canEnter %}

                        <a class="forma-button course-box__cta__button no-border" title="{{ course.name }}"
                           href="index.php?modname=course&amp;op=aula&amp;idCourse={{ course.idCourse }} "
                           rel= {{ course.rel }}>
                            <span class="forma-button__label"> {{ Lang_translate('_USER_STATUS_ENTER', 'catalogue') }}</span>
                        </a>

                    {% else %}
                        <a class="forma-button forma-button--disabled" href="javascript:void(0);">
                                <span class="forma-button__label">
                                    {{ Lang_translate('_DISABLED', 'course') }}
                                </span>
                        </a>

                    {% endif %}
                {% endblock %}
            </div>
        {% endblock %}
    </article>
{% endblock %}