Skip to content

Commit

Permalink
Merge pull request #7748 from GSA/Update-Community-Links-Events
Browse files Browse the repository at this point in the history
  • Loading branch information
RileySeaburg authored Jul 16, 2024
2 parents 6439f46 + 20493c5 commit 52f9681
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 9 deletions.
18 changes: 9 additions & 9 deletions themes/digital.gov/layouts/events/single.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{/* ====
This template renders an event page with dynamic content including date, time, host, registration options,
and different event stages based on the platform and whether the event is in the future or past.
It includes the event title, description, location, and actions for users to register or add the event to their calendar.
*/}}
{{- define "content" -}}
{{/* This sets $future_event to true or false */}}
{{- $future_event := (time .Params.end_date).After now -}}
Expand Down Expand Up @@ -26,8 +31,6 @@ <h1>{{- .Title | markdownify -}}</h1>
{{- if .Params.deck -}}
<div class="deck">{{- .Params.deck | markdownify -}}</div>
{{- end -}}


<p class="datetime">
<svg
class="usa-icon dg-icon dg-icon--standard margin-bottom-05"
Expand All @@ -48,17 +51,15 @@ <h1>{{- .Title | markdownify -}}</h1>
{{ with .Params.end_date -}}
{{- . | dateFormat "3:04 PM ET" -}}
{{- end -}}
{{- end }}
</span>
</p>

{{- if .Params.host -}}
<p class="host">
Hosted by Digital.gov and the
{{ .Params.host }}
</p>
{{- end -}}

</div>
</div>
</div>
Expand Down Expand Up @@ -87,7 +88,7 @@ <h1>{{- .Title | markdownify -}}</h1>

{{/* EVENT Stages —
Depending on the type of event, different "event stages" appear on the page.
- Only for upcomming events
- Only for upcoming events
====================================
*/}}

Expand All @@ -97,7 +98,6 @@ <h1>{{- .Title | markdownify -}}</h1>
{{- if eq $future_event true -}}
{{- .Render "stage-youtube-live" -}}
{{- end -}}

{{- end -}}

{{/* PAST EVENT / Video -------------------- */}}
Expand Down Expand Up @@ -166,8 +166,8 @@ <h4>In this talk</h4>
{{- end -}}
{{- end -}}

{{/* Related Communities and Services */}}
{{- partial "core/get_related.html" . -}}
{{/* Display Primary Communities */}}
{{- partial "core/primary-communities.html" . -}}

{{/* Topics */}}
{{- partial "core/list-topics.html" . -}}
Expand Down
47 changes: 47 additions & 0 deletions themes/digital.gov/layouts/partials/core/primary-communities.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{{/* ======================================
Displays a vertical list of primary CoP's on the sidebar on event pages.
======================================
*/}}
{{ $mainCommunities := (where .Site.Pages "Section" "communities") }}
{{ $mainCommunities = (where $mainCommunities ".Params.dg_highlight" "eq" true) }}
{{ $featuredCommunity := (where $mainCommunities ".Params.weight" "eq" 2) }}
{{ $mainCommunities = union $featuredCommunity $mainCommunities }}
{{ $mainCommunities = first 8 ($mainCommunities.ByTitle) }}

{{/* Check if there are main community pages to display */}}
{{- with $mainCommunities -}}
<article class="dg-promos dg-related-communities">
<h3 class="dg-promos__heading">Join a Community</h3>
<ul class="dg-promos__list">
{{- range . -}}
<li class="promo dg-promos__list-item">
<a
href="{{ .Permalink }}?promo"
title="Visit {{ .Title }} community page"
class="dg-promos__link"
>
{{ .Title }}
</a>
</li>
{{- end -}}
</ul>
<footer class="dg-promos__footer">
{{ $communityCount := len (where $.Site.RegularPages "Section" "communities") }}
<a
href="{{ "communities" | relURL }}"
class="dg-promos__more-link dg-more-link"
>
<span> See all {{ $communityCount }} communities </span>
<svg
class="usa-icon dg-icon dg-icon--small margin-bottom-05"
aria-hidden="true"
focusable="false"
>
<use
xlink:href="{{ "uswds/img/sprite.svg#arrow_forward" | relURL }}"
></use>
</svg>
</a>
</footer>
</article>
{{- end -}}

0 comments on commit 52f9681

Please sign in to comment.