{% extends "base.html" %}
{% load i18n %}

{% block main %}
<h1>
    {% if form.instance.pk %}
        {% trans "Update participation on" %} {{ event }}
    {% else %}
        {% trans "Participate on" %} {{ event }}
    {% endif %}
</h1>
{% if event.is_bookable and event.get_free_seats > 0 and permission_to_book %}
    <form method="post" action=".">
        {% csrf_token %}
        {{ form.non_field_errors }}
        {{ form.as_p }}
        <input type="submit" value="{% trans "Save" %}" />
    </form>
{% elif not event.is_bookable %}
    <p>{% trans "We're sorry. The event has already started." %}</p>
{% elif event.get_free_seats == 0 %}
    <p>{% trans "We're sorry. The event is fully booked." %}</p>
{% else %}
    <p>{% trans "We're sorry. You need to be logged in to book this event." %}</p>
{% endif %}
{% endblock %}