{% load danceschool_tags cms_tags i18n %}

<div class="event_list {{ instance.cssClasses }}">
    {% if instance.title %}<h3>{{ instance.title }}</h3>{% endif %}
    <ul class="list-unstyled">
        {% for event in event_list %}
            {% ifchanged event.month %}
                {% if not forloop.first %}</ul>{% endif %}
                <li><h4>{{ event.month|readable_month }} {% if instance.eventType == 'S' %}{% trans "Classes" %}{% else %}{% trans "Events" %}{% endif %}</h4></li>
                <ul>
            {% endifchanged %}
            <li><a href="{{ event.url }}">{{ event.name }}</a></li>
            {% if forloop.last %}</ul>{% endif %}
        {% empty %}
        <li>{% trans "Nothing posted yet. Check back soon!" %}</li>
        {% endfor %}
    </ul>
	<p style="margin-top: 1em;">
		{% page_url 'calendar' as calendar_url %}
        {% url 'registration' as registration_url %}

        {% if calendar_url %}<a href="{{ calendar_url }}"><i class="fa fa-calendar"></i>&nbsp;{% trans "View Calendar" %}</a>{% if registration_url %}&nbsp;/{% endif %}{% endif %}
		{% if registration_url %}<a href="">{% trans "Register Now" %} &raquo;</a>{% endif %}
	</p>
</div>
