Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added metadata to events page #1119

Merged
merged 5 commits into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 31 additions & 19 deletions events/templates/events/event.html
brylie marked this conversation as resolved.
Show resolved Hide resolved
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 %}
Loading