-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added metadata to events page (#1119)
* Added metadata to events page * change the metadata into a nextjs block and fixed formatting of the file * Formatted the code * Format * Cleanup comment --------- Co-authored-by: Brylie Christopher Oxley <brylie@protonmail.com>
- Loading branch information
1 parent
5cea94f
commit 240b9fb
Showing
1 changed file
with
31 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,71 @@ | ||
{% 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 %} | ||
<a href="{% pageurl page.get_parent %}?caegory={{ page.category }}"> | ||
Events | ||
</a> | ||
<a href="{% pageurl page.get_parent %}?category={{ page.category }}">Events</a> | ||
|
||
<h1>{{ event.title }}</h1> | ||
|
||
<p class="font-weight-bold mb-2"> | ||
{% if event.start_date %} | ||
{{ event.start_date | timezone:"US/Pacific" | date:"F d, Y, f A" }} | ||
{{ 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 | ||
{{ event.end_date|timezone:'US/Pacific'|date:'F d, Y, f A' }} | ||
{% endif %}US/Pacific | ||
</p> | ||
|
||
{% if event.sponsors.all %} | ||
<dt class="col-sm-2">Sponsor(s):</dt> | ||
<dd class="col-sm-10"> | ||
{% for sponsor in event.sponsors.all %} | ||
{% if sponsor.sponsor.live %} | ||
<a href="{% pageurl sponsor.sponsor %}"> | ||
{{ sponsor.sponsor }}</a>{% if not forloop.last %},{% endif %} | ||
<a href="{% pageurl sponsor.sponsor %}">{{ sponsor.sponsor }}</a>{% if not forloop.last %},{% endif %} | ||
{% else %} | ||
{{ sponsor.sponsor }}{% if not forloop.last %},{% endif %} | ||
{% endif %} | ||
{% endfor %} | ||
</dd> | ||
{% endif %} | ||
|
||
|
||
{% if event.body %} | ||
{{ event.body }} | ||
{% endif %} | ||
|
||
{% if event.website %} | ||
<a | ||
href="{{ event.specific.website }}" | ||
class="btn btn-primary btn-sm" | ||
target="blank" | ||
> | ||
<a href="{{ event.specific.website }}" class="btn btn-primary btn-sm" target="blank"> | ||
<i class="bi bi-link" aria-hidden="true"></i> | ||
Visit event website | ||
</a> | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block extra_js %} | ||
<script type="application/ld+json"> | ||
{ | ||
"@context": "https://schema.org", | ||
"@type": "Event", | ||
"name": "{{ event.title|escapejs }}", | ||
"startDate": "{% if event.start_date %}{{ event.start_date|date:'c' }}{% endif %}", | ||
"endDate": "{% if event.end_date %}{{ event.end_date|date:'c' }}{% endif %}", | ||
"eventStatus": "https://schema.org/EventScheduled", | ||
"eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode", | ||
"description": "{{ event.body|striptags|escapejs }}", | ||
"url": "{{ request.build_absolute_uri }}", | ||
"eventCategory": "{{ event.get_category_display|escapejs }}", | ||
"eventWebsite": "{% if event.website %}{{ event.website }}{% endif %}" | ||
} | ||
</script> | ||
{% endblock %} |