Skip to content
Snippets Groups Projects
event_registration_text.html 2.87 KiB
Newer Older
Erxleben, Fredo's avatar
Erxleben, Fredo committed
{% comment %}
    If registration variables are set in event front matter, badges and texts
    are displayed on event details page and event overview page showing the
    registration status of the event.
{% endcomment %}

{% comment %}
    In case no registration data is given, do not display any registration
    information.
    There might still be registration information in the free text of the event.
{% endcomment %}
{% unless   include.event.registration_period.from == nil and
            include.event.registration_period.to == nil and
            include.event.fully_booked_out == nil and
            include.event.registration_link == nil and
            include.event.waiting_list_link == nil %}
    <h2>Registration</h2>
    {% comment %}
        Cases:
            1) Registration period is over.
            2) Event is booked out, there is no waiting list.
            3) Event is booked out, there is a waiting list.
            4) Registrations are open.
            5) Registrations are not open yet.
    {% endcomment %}
    {% assign today = "now" | date: "%Y-%m-%d" %}
    {% if include.event.registration_period.to < today %}
        The Registration period is over.
    {% else %}
        {% if include.event.fully_booked_out == true or
              include.event.waiting_list_link %}
            {% unless include.event.waiting_list_link %}
                {% include events/event_fully_booked_out_badge.html %}
                The event is completely booked out and there is no waiting list.
            {% else %}
                {% include events/event_waiting_list_badge.html %}
                The event is booked out. The waiting list is open until
                <strong class="text-danger">
                    {{ include.event.registration_period.to | date_to_long_string }}&#8203;
                </strong>.
            {% endunless %}
        {% else %}
            {% if include.event.registration_period.from <= today and
                  include.event.registration_period.to >= today and
                  include.event.registration_link %}
                {% include events/event_registration_open_badge.html %}
                Registrations are open until
                <strong class="text-danger">
                    {{ include.event.registration_period.to | date_to_long_string }}
                </strong>
                or until the event is booked out.
            {% else %}
                Registrations are not open yet.
                They will be open from
                <strong>
                    {{ include.event.registration_period.from | date_to_long_string }}
                </strong>
                to
                <strong>
                    {{ include.event.registration_period.to | date_to_long_string }}
                </strong>
                or until the event is booked out.
            {% endif %}
        {% endif %}
    {% endif %}
{% endunless %}