{% load cms_tags i18n extra_tags %}

{% spaceless %}
{% if course_runs %}
<ul class="course-detail__run-list">
    {% for run in course_runs %}
        {% render_model_block run %}
            <li>
                {% if course != run.direct_course %}
                    <a href="{{ run.direct_course.extended_object.get_absolute_url }}">
                {% endif %}
                {% if run.title %}
                    {% blocktrans with title=run.title|capfirst start=run.start|date:'DATE_FORMAT'|default:'...' end=run.end|date:'DATE_FORMAT'|default:'...' %}
                        {{ title }}, from {{ start }} to {{ end }}
                    {% endblocktrans %}
                {% else %}
                    {% blocktrans with start=run.start|date:'DATE_FORMAT'|default:'...' end=run.end|date:'DATE_FORMAT'|default:'...' %}
                        From {{ start }} to {{ end }}
                    {% endblocktrans %}
                {% endif %}
                {% if course != run.direct_course %}
                    </a>
                {% endif %}
            </li>
        {% endrender_model_block %}
    {% endfor %}
</ul>
{% endif %}
{% endspaceless %}
