Skip to content

Commit

Permalink
Refactor main for communities/single.html
Browse files Browse the repository at this point in the history
  • Loading branch information
ch-tyson committed Jul 3, 2024
1 parent b79f695 commit d4c32fa
Showing 1 changed file with 87 additions and 88 deletions.
175 changes: 87 additions & 88 deletions themes/digital.gov/layouts/communities/single.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ define "content" }}
<main role="main" id="main-content" class="page main-content">
<article class="grid-container grid-container-desktop">
{{- define "content" -}}
<main role="main" id="main-content">
<article class="grid-container-desktop">
{{- partial "partials/core/usa-breadcrumbs.html" . -}}
<header>
<div>
Expand All @@ -24,108 +24,107 @@ <h1>{{ .Title | markdownify }} Community</h1>
data-title-heading-level="h3"
data-root-margin="-350px 0px -350px 0px"
></aside>
{{/* Summary */}}
{{- if .Params.summary -}}
<div class="content usa-prose">
<p>{{- .Params.summary | markdownify -}}</p>
<section>
{{- if .Params.summary -}}
<div class="content usa-prose">
<p>{{- .Params.summary | markdownify -}}</p>

{{- if .Params.community_list -}}
<section class="join-community-form">
<h4 class="join-community-form__header">
<svg
class="join-community-form__header-svg usa-icon dg-icon dg-icon--extra-large margin-bottom-05"
aria-hidden="true"
focusable="false"
>
<use
xlink:href="{{ "uswds/img/sprite.svg#groups" | relURL }}"
></use>
</svg>
Connect with us
</h4>
{{- if .Params.community_list -}}
<section class="join-community-form">
<h4 class="join-community-form__header">
<svg
class="join-community-form__header-svg usa-icon dg-icon dg-icon--extra-large margin-bottom-05"
aria-hidden="true"
focusable="false"
>
<use
xlink:href="{{ "uswds/img/sprite.svg#groups" | relURL }}"
></use>
</svg>
Connect with us
</h4>

{{- range $i, $e := .Params.community_list -}}
<div class="join-community-form__body">
<div class="join-community-form__body-eligibility">
{{/* Checks to see if the community is public or govt only and sets the "terms" of the community, with an option to override the terms for each community by setting it in the front matter */}}
{{- range $i, $e := .Params.community_list -}}
<div class="join-community-form__body">
<div class="join-community-form__body-eligibility">
{{/* Checks to see if the community is public or govt only and sets the "terms" of the community, with an option to override the terms for each community by setting it in the front matter */}}

{{/* PUBLIC */}}
{{- if eq $e.type "public" -}}
{{/* Checking to see if community terms are defined */}}
{{- if $e.terms -}}
<p>{{- $e.terms | markdownify -}}</p>
{{- else -}}
<p>Open to the public.</p>
{{/* PUBLIC */}}
{{- if eq $e.type "public" -}}
{{/* Checking to see if community terms are defined */}}
{{- if $e.terms -}}
<p>{{- $e.terms | markdownify -}}</p>
{{- else -}}
<p>Open to the public.</p>
{{- end -}}
{{- end -}}
{{- end -}}

{{/* GOVT */}}
{{- if eq $e.type "government" -}}
{{- if $e.terms -}}
<p>{{- $e.terms | markdownify -}}</p>
{{- else -}}
<p>
Open to anyone with a .gov or .mil email address.
</p>
{{/* GOVT */}}
{{- if eq $e.type "government" -}}
{{- if $e.terms -}}
<p>{{- $e.terms | markdownify -}}</p>
{{- else -}}
<p>
Open to anyone with a .gov or .mil email address.
</p>
{{- end -}}
{{- end -}}
{{- end -}}

{{/* GOVT_ONLY */}}
{{- if eq $e.type "government_only" -}}
{{- if $e.terms -}}
<p>{{- $e.terms | markdownify -}}</p>
{{- else -}}
<p>Open to any government employee.</p>
{{/* GOVT_ONLY */}}
{{- if eq $e.type "government_only" -}}
{{- if $e.terms -}}
<p>{{- $e.terms | markdownify -}}</p>
{{- else -}}
<p>Open to any government employee.</p>
{{- end -}}
{{- end -}}
{{- end -}}
</div>
</div>

<div class="join-community-form__body-email">
{{/* Community JOIN types ---
- Listerv via an email (most common)
- Listerv via a form
- Google Group
- Slack
*/}}
{{/* Listserv Platforms without form sign-up option */}}
{{- if and (eq $e.platform "listserv") (not $e.subscribe_form ) -}}
{{- partial "core/community-join-without-form.html" (dict "context" . "e" $e) -}}
{{- end -}}
<div class="join-community-form__body-email">
{{/* Community JOIN types ---
- Listerv via an email (most common)
- Listerv via a form
- Google Group
- Slack
*/}}
{{/* Listserv Platforms without form sign-up option */}}
{{- if and (eq $e.platform "listserv") (not $e.subscribe_form ) -}}
{{- partial "core/community-join-without-form.html" (dict "context" . "e" $e) -}}
{{- end -}}

{{/* Google Group platforms */}}
{{- if and (eq $e.platform "google-group") ( $e.subscribe_form ) -}}
{{- partial "core/community-join-google-group.html" (dict "context" . "e" $e) -}}
{{- end -}}
{{/* Google Group platforms */}}
{{- if and (eq $e.platform "google-group") ( $e.subscribe_form ) -}}
{{- partial "core/community-join-google-group.html" (dict "context" . "e" $e) -}}
{{- end -}}

{{/* Slack platforms */}}
{{- if and (eq $e.platform "slack") ( $e.subscribe_form ) -}}
{{- partial "core/community-join-slack.html" (dict "context" . "e" $e) -}}
{{- end -}}
{{/* Slack platforms */}}
{{- if and (eq $e.platform "slack") ( $e.subscribe_form ) -}}
{{- partial "core/community-join-slack.html" (dict "context" . "e" $e) -}}
{{- end -}}

</div>
</div>
</div>
{{- end -}}
{{- end -}}

</section>
{{- end -}}
<div>
{{- .Content -}}
</div>
</section>
{{- end -}}

<div class="community_events">
{{- partial "core/get-upcomingevents.html" . -}}
</div>
{{/* Main Content */}}
<div class="content usa-prose">
{{- .Content -}}
</div>

<div class="Community_conduct">
<h2 id="community-conduct">Community Conduct</h2>
{{- partial "core/community_pagefooter.html" . -}}
<br />
</div>
<div>
<br />
<div class="community_events">
{{- partial "core/get-upcomingevents.html" . -}}
</div>

<div class="Community_conduct">
<h2 id="community-conduct">Community Conduct</h2>
{{- partial "core/community_pagefooter.html" . -}}
</div>
</div>
</div>
{{- end -}}
{{- end -}}
</section>
</div>
</article>
</main>
Expand Down

0 comments on commit d4c32fa

Please sign in to comment.