--wip-- [skip ci]

This commit is contained in:
2026-04-02 10:13:19 +02:00
parent dd936473d8
commit 9c71dc1e47
26 changed files with 650 additions and 343 deletions

View File

@@ -0,0 +1,31 @@
{% extends "base.html" %}
{% load static i18n wagtailcore_tags wagtailimages_tags %}
{% block title %}{% trans "Blog" %}{% endblock title %}
{% block body_class %}template-courseindex{% endblock body_class %}
{% block content %}
<h1 class="text-3xl font-bold mb-6 text-center">{% trans "Blog" %}</h1>
<div class="flex flex-wrap -mx-4">
{% for post in posts %}
<div class="w-full md:w-1/2 lg:w-1/3 px-4 mb-8">
<a href="{{ post.url }}" class="block bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
{% if post.blog_image %}
{% image post.blog_image original alt=post.title class="w-full h-auto" %}
{% endif %}
<div class="p-4">
<h2 class="text-xl font-semibold">{{ post.title }}</h2>
<p class="text-gray-600">{{ post.excerpt|truncatewords:20 }}</p>
</div>
</a>
</div>
{% empty %}
<p class="text-center text-gray-600 italic">{% trans "No blog posts yet." %}</p>
{% endfor %}
</div>
{% endblock content %}

View File

View File

@@ -1,62 +0,0 @@
{% 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>