From 2b617da4d072d4816b0e0a7b9bfaeddf900777bf Mon Sep 17 00:00:00 2001 From: Ironmanhim3 Date: Fri, 20 Sep 2024 16:23:03 +0300 Subject: [PATCH 1/5] Added metadata to events page --- events/templates/events/event.html | 113 ++++++++++++++++------------- 1 file changed, 64 insertions(+), 49 deletions(-) diff --git a/events/templates/events/event.html b/events/templates/events/event.html index 2e12f1cf..706fae6d 100644 --- a/events/templates/events/event.html +++ b/events/templates/events/event.html @@ -8,52 +8,67 @@ {% block title %}{{ page.title }}{% endblock %} {% block content %} - - Events - - -

{{ event.title }}

- -

- {% if event.start_date %} - {{ event.start_date | timezone:"US/Pacific" | date:"F d, Y, f A" }} - {% endif %} - - {% if event.end_date %} - - - {{ event.end_date | timezone:"US/Pacific" | date:"F d, Y, f A" }} - {% endif %} - - US/Pacific -

- - {% if event.sponsors.all %} -
Sponsor(s):
-
- {% for sponsor in event.sponsors.all %} - {% if sponsor.sponsor.live %} - - {{ sponsor.sponsor }}{% if not forloop.last %},{% endif %} - {% else %} - {{ sponsor.sponsor }}{% if not forloop.last %},{% endif %} - {% endif %} - {% endfor %} -
- {% endif %} - - - {% if event.body %} - {{ event.body }} - {% endif %} - - {% if event.website %} - - - Visit event website - - {% endif %} -{% endblock %} + + + + + + + Events + + +

{{ event.title }}

+ +

+ {% if event.start_date %} + {{ event.start_date | timezone:"US/Pacific" | date:"F d, Y, f A" }} + {% endif %} + + {% if event.end_date %} + - + {{ event.end_date | timezone:"US/Pacific" | date:"F d, Y, f A" }} + {% endif %} + + US/Pacific +

+ +{% if event.sponsors.all %} +
Sponsor(s):
+
+ {% for sponsor in event.sponsors.all %} + {% if sponsor.sponsor.live %} + + {{ sponsor.sponsor }}{% if not forloop.last %},{% endif %} + {% else %} + {{ sponsor.sponsor }}{% if not forloop.last %},{% endif %} + {% endif %} + {% endfor %} +
+{% endif %} + + +{% if event.body %} +{{ event.body }} +{% endif %} + +{% if event.website %} + + + Visit event website + +{% endif %} +{% endblock %} \ No newline at end of file From 21cfad1d07deac9bbeafbf4e9fe57d605994bf1b Mon Sep 17 00:00:00 2001 From: Ironmanhim3 Date: Fri, 20 Sep 2024 17:13:28 +0300 Subject: [PATCH 2/5] change the metadata into a nextjs block and fixed formatting of the file --- events/templates/events/event.html | 79 +++++++++++++++--------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/events/templates/events/event.html b/events/templates/events/event.html index 706fae6d..944adb15 100644 --- a/events/templates/events/event.html +++ b/events/templates/events/event.html @@ -8,55 +8,36 @@ {% block title %}{{ page.title }}{% endblock %} {% block content %} - - - - - - Events + Events

{{ event.title }}

- {% if event.start_date %} - {{ event.start_date | timezone:"US/Pacific" | date:"F d, Y, f A" }} - {% endif %} + {% if event.start_date %} + {{ event.start_date | timezone:"US/Pacific" | date:"F d, Y, f A" }} + {% endif %} - {% if event.end_date %} - - - {{ event.end_date | timezone:"US/Pacific" | date:"F d, Y, f A" }} - {% endif %} + {% if event.end_date %} + - + {{ event.end_date | timezone:"US/Pacific" | date:"F d, Y, f A" }} + {% endif %} - US/Pacific + US/Pacific

{% if event.sponsors.all %}
Sponsor(s):
- {% for sponsor in event.sponsors.all %} - {% if sponsor.sponsor.live %} - - {{ sponsor.sponsor }}{% if not forloop.last %},{% endif %} - {% else %} - {{ sponsor.sponsor }}{% if not forloop.last %},{% endif %} - {% endif %} - {% endfor %} + {% for sponsor in event.sponsors.all %} + {% if sponsor.sponsor.live %} + + {{ sponsor.sponsor }}{% if not forloop.last %},{% endif %} + {% else %} + {{ sponsor.sponsor }}{% if not forloop.last %},{% endif %} + {% endif %} + {% endfor %}
{% endif %} @@ -67,8 +48,28 @@

{{ event.title }}

{% if event.website %} - - Visit event website + + Visit event website {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} + +{% block extra_js %} + + + +{% endblock extra_js %} From 5a5fc91be560ef415f55e1485fd4b5ff50b15eb4 Mon Sep 17 00:00:00 2001 From: Ironmanhim3 Date: Fri, 20 Sep 2024 17:24:55 +0300 Subject: [PATCH 3/5] Formatted the code --- events/templates/events/event.html | 82 ++++++++++++++---------------- 1 file changed, 39 insertions(+), 43 deletions(-) diff --git a/events/templates/events/event.html b/events/templates/events/event.html index 944adb15..bb79915b 100644 --- a/events/templates/events/event.html +++ b/events/templates/events/event.html @@ -1,61 +1,58 @@ -{% extends "base.html" %} +{% extends 'base.html' %} {% load tz %} {% load static wagtailcore_tags %} -{% block body_class %}template-event{% endblock %} +{% block body_class %} + template-event +{% endblock %} -{% block title %}{{ page.title }}{% endblock %} +{% block title %} + {{ page.title }} +{% endblock %} {% block content %} - - Events - - -

{{ event.title }}

+ Events -

- {% if event.start_date %} - {{ event.start_date | timezone:"US/Pacific" | date:"F d, Y, f A" }} - {% endif %} +

{{ event.title }}

- {% if event.end_date %} - - - {{ event.end_date | timezone:"US/Pacific" | date:"F d, Y, f A" }} - {% endif %} +

+ {% if event.start_date %} + {{ event.start_date|timezone:'US/Pacific'|date:'F d, Y, f A' }} + {% endif %} - US/Pacific -

+ {% if event.end_date %} + - + {{ event.end_date|timezone:'US/Pacific'|date:'F d, Y, f A' }} + {% endif %}US/Pacific +

-{% if event.sponsors.all %} -
Sponsor(s):
-
- {% for sponsor in event.sponsors.all %} - {% if sponsor.sponsor.live %} - - {{ sponsor.sponsor }}{% if not forloop.last %},{% endif %} - {% else %} - {{ sponsor.sponsor }}{% if not forloop.last %},{% endif %} + {% if event.sponsors.all %} +
Sponsor(s):
+
+ {% for sponsor in event.sponsors.all %} + {% if sponsor.sponsor.live %} + {{ sponsor.sponsor }}{% if not forloop.last %},{% endif %} + {% else %} + {{ sponsor.sponsor }}{% if not forloop.last %},{% endif %} + {% endif %} + {% endfor %} +
{% endif %} - {% endfor %} - -{% endif %} - -{% if event.body %} -{{ event.body }} -{% endif %} + {% if event.body %} + {{ event.body }} + {% endif %} -{% if event.website %} - - - Visit event website - -{% endif %} + {% if event.website %} + + + Visit event website + + {% endif %} {% endblock %} {% block extra_js %} - - -{% endblock extra_js %} +{% endblock %} From f351f4b4901abca7b90ed702d4d02c58d2827a88 Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Fri, 20 Sep 2024 14:26:59 +0000 Subject: [PATCH 4/5] Format --- events/templates/events/event.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/events/templates/events/event.html b/events/templates/events/event.html index bb79915b..ab4b4a65 100644 --- a/events/templates/events/event.html +++ b/events/templates/events/event.html @@ -55,17 +55,17 @@

{{ event.title }}

{% block extra_js %} {% endblock %} From 054660b67290f771b743a373ea751cedd9b7ff19 Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Fri, 20 Sep 2024 14:27:52 +0000 Subject: [PATCH 5/5] Cleanup comment --- events/templates/events/event.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/templates/events/event.html b/events/templates/events/event.html index ab4b4a65..5ee0673f 100644 --- a/events/templates/events/event.html +++ b/events/templates/events/event.html @@ -64,7 +64,7 @@

{{ event.title }}

"eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode", "description": "{{ event.body|striptags|escapejs }}", "url": "{{ request.build_absolute_uri }}", - "eventCategory": "{{ event.get_category_display|escapejs }}", + "eventCategory": "{{ event.get_category_display|escapejs }}", "eventWebsite": "{% if event.website %}{{ event.website }}{% endif %}" }