--wip-- [skip ci]
This commit is contained in:
62
course_calendar/templates/event_page.html
Normal file
62
course_calendar/templates/event_page.html
Normal file
@@ -0,0 +1,62 @@
|
||||
{% load static i18n wagtailcore_tags wagtailimages_tags %}
|
||||
|
||||
<h2 class="text-3xl font-bold mb-4">{{ page.title }}</h2>
|
||||
|
||||
{% if page.image %}
|
||||
{% image page.image original alt=page.title class="w-full max-h-64 rounded-lg mb-3 object-cover" %}
|
||||
{% endif %}
|
||||
|
||||
<div class="flex items-center gap-2 text-gray-600 mb-2 text-sm">
|
||||
<i class="fi fi-br-clock-three leading-0"></i>
|
||||
<span>{{ page.start|date }}, {{ page.start|time }} – {{ page.end|date }}, {{ page.end|time }}</span>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2 text-gray-600 mb-6 text-sm {% if page.attendees_count >= page.max_attendees and page.max_attendees is not None and page.max_attendees != 0 %}text-red-600{% endif %}">
|
||||
<i class="fi fi-br-user leading-0"></i>
|
||||
<span>
|
||||
{{ page.attendees_count }}{% if page.max_attendees is not None and page.max_attendees != 0 %} / {{ page.max_attendees }}{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- sign up button -->
|
||||
<div class="not-prose my-4">
|
||||
{% if page.is_past %}
|
||||
<div class="p-4 bg-gray-100 border-l-4 border-gray-500 text-gray-700">
|
||||
<p>{% trans "This event has already ended. Please check our calendar for upcoming events." %}</p>
|
||||
</div>
|
||||
{% elif user_signed_up %}
|
||||
<div class="p-4 bg-green-100 border-l-4 border-green-500 text-green-700">
|
||||
<p>{% trans "You are signed up for this event. We look forward to seeing you there!" %}</p>
|
||||
<!-- cancel button -->
|
||||
<a href="{% url 'occurrence_signout' page.id %}" class="mt-4 inline-block bg-red-600 text-white px-4 py-2 rounded hover:bg-red-700 transition">
|
||||
{% trans "Cancel Sign Up" %}
|
||||
</a>
|
||||
</div>
|
||||
{% elif not user.is_authenticated %}
|
||||
{# If the user is not authenticated, we can prompt them to log in or sign up. #}
|
||||
<div class="p-4 bg-blue-100 border-l-4 border-blue-500 text-blue-700">
|
||||
<p>{% trans "You need to be logged in to sign up for this event. Please log in or sign up to reserve your spot." %}</p>
|
||||
<a href="{% url 'account_login' %}?next={% url 'calendar' %}?modal={{ page.id }}" class="mt-4 inline-block bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700 transition">
|
||||
{% trans "Login" %}
|
||||
</a>
|
||||
<a href="{% url 'account_signup' %}?next={% url 'calendar' %}?modal={{ page.id }}" class="mt-4 inline-block bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700 transition ml-2">
|
||||
{% trans "Sign Up" %}
|
||||
</a>
|
||||
</div>
|
||||
{% elif page.attendees_count >= page.max_attendees and page.max_attendees is not None and page.max_attendees != 0 %}
|
||||
<div class="p-4 bg-red-100 border-l-4 border-red-500 text-red-700">
|
||||
<p>{% trans "This event is fully booked. Please check back later for any cancellations." %}</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="p-4 bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700">
|
||||
<p>{% trans "You are not signed up for this event. Please sign up to reserve your spot." %}</p>
|
||||
<a href="{% url 'occurrence_signup' page.id %}" class="mt-4 inline-block bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700 transition">
|
||||
{% trans "Sign Up for Event" %}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="prose">
|
||||
{{ page.description | richtext }}
|
||||
</div>
|
||||
Reference in New Issue
Block a user