-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add filtered event block to student pages
- Loading branch information
Showing
3 changed files
with
50 additions
and
15 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,30 +1,50 @@ | ||
{% set eventCount = 4 %} | ||
|
||
{% if eventFilter %} | ||
{% set taggedEvents = events | eventsFuture | eventsTagged(eventFilter) | eventsSort | limit(4) %} | ||
{% endif %} | ||
|
||
{% if eventFilter and taggedEvents|length == 0 %} | ||
<!-- No events to display --> | ||
{% else %} | ||
|
||
<section class="m-4 border border-cream lg:container mx-auto sm:my-8"> | ||
<div class="justify-between items-center p-4 pb-0 sm:pb-4 sm:border-b sm:flex sm:gap-4"> | ||
<h2 class="glbHeading">Upcoming events</h2> | ||
<a href="/calendar" class="text-blue decoration-orange">See the church calendar</a> | ||
</div> | ||
|
||
<div class="p-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4"> | ||
{% set eventCount = 4 %} | ||
{% if eventFilter and taggedEvents %} | ||
|
||
{% for event in taggedEvents %} | ||
{% include 'blocks/cal/simpleEvent.njk' %} | ||
{% endfor %} | ||
|
||
{% set featuredEvent = events | eventsFuture | eventsFeatured | eventsSort | limit(1) | first %} | ||
{% if featuredEvent %} | ||
{% set event = featuredEvent %} | ||
{% include 'blocks/cal/simpleEvent.njk' %} | ||
{% set eventCount = 3 %} | ||
{% endif %} | ||
{% else %} | ||
|
||
|
||
{% set soonEvents = events | eventsFuture(0, 'day') | eventsSort | limit(eventCount + 1) %} | ||
{% set displayedEvents = 0 %} | ||
{% for event in soonEvents %} | ||
{% if event.title == featuredEvent.title or displayedEvents == eventCount%} | ||
{# nothing to see here #} | ||
{% else %} | ||
{% set featuredEvent = events | eventsFuture | eventsFeatured | eventsSort | limit(1) | first %} | ||
{% if featuredEvent %} | ||
{% set event = featuredEvent %} | ||
{% include 'blocks/cal/simpleEvent.njk' %} | ||
{% set displayedEvents = displayedEvents + 1 %} | ||
{% set eventCount = 3 %} | ||
{% endif %} | ||
|
||
{% endfor %} | ||
{% set soonEvents = events | eventsFuture(0, 'day') | eventsSort | limit(eventCount + 1) %} | ||
{% set displayedEvents = 0 %} | ||
{% for event in soonEvents %} | ||
{% if event.title == featuredEvent.title or displayedEvents == eventCount%} | ||
{# nothing to see here #} | ||
{% else %} | ||
{% include 'blocks/cal/simpleEvent.njk' %} | ||
{% set displayedEvents = displayedEvents + 1 %} | ||
{% endif %} | ||
|
||
{% endfor %} | ||
|
||
{% endif %} | ||
</div> | ||
</section> | ||
|
||
{%endif %} |
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
pagePosition: bottom | ||
--- | ||
|
||
<div class="mt-12 px-4"> | ||
{% set eventFilter = 'students' %} | ||
{% include 'blocks/cal/eventsUpcoming.njk' %} | ||
{% set eventFilter = null %} | ||
</div> |