{% extends "cms/home.html" %}
{% load cms_tags danceschool_tags thumbnail i18n %}

{% block title %}
	{{ eventset.0.name }}
{% endblock %}

{% block meta_title %}
	{{ eventset.0.name }}
{% endblock %}

{% block meta_description %}
	{% blocktrans with name=eventset.0.name startTime=eventset.0.eventoccurrence_set.all.first.startTime|date:'l, F d, h:i A' endTime=eventset.0.eventoccurrence_set.all.first.endTime|date:'h:i A' location=eventset.0.location.name %}
	Join us for our event, {{ name }}, held {{ startTime }} - {{ endTime }} at {{ location }}.
	{% endblocktrans %}
{% endblock %}

{% block facebook_og_description %}
	{% blocktrans with name=eventset.0.name startTime=eventset.0.eventoccurrence_set.all.first.startTime|date:'l, F d, h:i A' endTime=eventset.0.eventoccurrence_set.all.first.endTime|date:'h:i A' location=eventset.0.location.name %}
	Join us for our event, {{ name }}, held {{ startTime }} - {{ endTime }} at {{ location }}.
	{% endblocktrans %}
{% endblock %}

{% block body_id %}classes{% endblock %}

{% block content %}
	<h1 class="my-4">{{ eventset.0.name }}</h1>

	{% for event in eventset %}
	<div class="row">
		<div class="col-md-4 order-2">
			<p>
			{% if event.registrationOpen %}
				<a class="btn btn-primary btn-lg" href="{% url 'registration' %}">{% trans "Register for this event!" %}</a>
			{% endif %}
			</p>

			{% if 'core.change_event' in perms %}
			<p><a class="btn btn-outline-secondary" href="{% url 'admin:core_event_change' event.id %}">{% trans "Edit Event Details" %}</a></p>
			{% endif %}
			{% if 'core.view_registration_summary' in perms and event.registrationEnabled %}
			<p><a class="btn btn-outline-secondary" href="{% url 'viewregistrations' event.id %}">{% trans "View Registrations" %}</a></p>
			{% endif %}
		</div>
		<div class="col-md-8 order-1">
			<h3>{{ event.eventoccurrence_set.all.first.startTime|date:'l, F d, h:i A' }} - {{ event.eventoccurrence_set.all.first.endTime|date:'h:i A' }}</h3>

			<p class='address'>
			<strong>{{ event.location.name }}{% if event.room.name %} - {{ event.room.name }}{% endif %}</strong><br />
			{{ event.location.address }}<br />
			{{ event.location.city }}, {{ event.location.state }} {{ event.location.zip }}<br />
			<a href="{% page_url 'directions' as directions_url %}{{ directions_url }}#{{ event.location.name|slugify }}">{% trans "Map this" %}</a>

			{% if not event.registrationOpen %}
				<p class="font-italic">{% trans "Registration for this event is not required." %}</p>
			{% endif %}
			</p>
		</div>
	</div>

	<hr />

	{% endfor %}

	<div class="row">
		<div class="col-12">
			<h3>{% trans "About this Event" %}</h3>
			<div class='eventDescription'>
				{{ eventset.0.description|safe }}
			</div>
		</div>
	</div>
	
{% endblock %}