From e9acff622df5846de400a6b1cba0f3b30ba13819 Mon Sep 17 00:00:00 2001 From: Olivia206 <olivia.simonet206@gmail.com> Date: Mon, 22 Apr 2024 12:37:16 +0200 Subject: [PATCH] changed contact block's layout --- assets/sass/_theme/blocks/contact.sass | 43 +++++++---- i18n/fr.yml | 2 + .../partials/blocks/templates/contact.html | 76 +++++++++++-------- 3 files changed, 74 insertions(+), 47 deletions(-) diff --git a/assets/sass/_theme/blocks/contact.sass b/assets/sass/_theme/blocks/contact.sass index acc9cf80..0659b9ba 100644 --- a/assets/sass/_theme/blocks/contact.sass +++ b/assets/sass/_theme/blocks/contact.sass @@ -15,8 +15,16 @@ @include h4 a @extend %underline-on-hover - + ul + .contact-types + margin-top: $spacing-3 + @include media-breakpoint-down(desktop) + > div + div + margin-top: $spacing-3 + + span + display: block margin-top: $spacing-4 + + ul + margin-top: $spacing-1 ul @include list-reset li @@ -36,13 +44,7 @@ &:nth-child(n+2) text-align: right @include media-breakpoint-up(desktop) - justify-content: space-between - span - width: 25% - &:first-child - width: 50% - span + span - text-align: right + gap: var(--grid-gutter) time + time @include icon(arrow-right, before) display: inline-block @@ -52,12 +54,21 @@ .top margin-bottom: $spacing-4 .informations - display: flex - margin-top: 0 - address + .contact-types + @include grid(3) + ul + span width: columns(4) - margin-top: 0 - ul - margin-top: 0 - width: columns(8) - margin-left: var(--grid-gutter) \ No newline at end of file + + @include in-page-with-sidebar + .contact-types + @include grid(2) + row-gap: $spacing-3 + ul + span + width: columns(2) + &:first-child + width: columns(3) + &:last-child + text-align: right + margin-left: columns(1) \ No newline at end of file diff --git a/i18n/fr.yml b/i18n/fr.yml index b0ae9fe6..d6f73494 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -91,6 +91,8 @@ commons: phone: Téléphone phone_professional: Téléphone professionnel website: Site web + web: Web + schedule: Horaires d'ouverture credit: Un site éco-conçu produit avec <a href="https://www.osuny.org/" title="Osuny - lien externe" target="_blank" rel="noreferrer">Osuny</a> date: Date download: diff --git a/layouts/partials/blocks/templates/contact.html b/layouts/partials/blocks/templates/contact.html index 286ba69b..3d4c00a9 100644 --- a/layouts/partials/blocks/templates/contact.html +++ b/layouts/partials/blocks/templates/contact.html @@ -19,45 +19,59 @@ {{ with .information }} {{ partial "PrepareHTML" . }} {{ end }} - {{ with .address }} - {{ if or .address .city .zipcode .country }} - <div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress"> - {{ if .address }} - <span itemprop="streetAddress"> - {{ partial "PrepareHTML" .address }}, - </span> - {{ end }} - <br> - {{ if .city }} - <span itemprop="addressLocality"> - {{ partial "PrepareHTML" .city }} - </span> + <div class="contact-types"> + {{ with .address }} + {{ if or .address .city .zipcode .country }} + <div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress"> + <p class="meta">{{- i18n "commons.contact.address" -}}</p> + {{ if .address }} + <span itemprop="streetAddress"> + {{ partial "PrepareHTML" .address }}, + </span> + {{ end }} + <br> + {{ if .city }} + <span itemprop="addressLocality"> + {{ partial "PrepareHTML" .city }} + </span> + {{ end }} + {{ if .zipcode }} + <span itemprop="postalCode"> + {{ partial "PrepareHTML" .zipcode }} + </span> + {{ end }} + {{ if .country }} + <span itemprop="addressCountry"> + {{ partial "PrepareHTML" .country }} + </span> + {{ end }} + </div> + {{ end }} + {{ end }} + {{ if or .url .emails }} + <div> + <p class="meta">{{- i18n "commons.contact.web" -}}</p> + {{ with .url }} + <p><a href="{{ . }}" target="_blank" rel="noreferrer">{{ . }}</a></p> {{ end }} - {{ if .zipcode }} - <span itemprop="postalCode"> - {{ partial "PrepareHTML" .zipcode }} - </span> + {{ range .emails }} + <p><a itemprop="email" href="mailto:{{ . }}">{{ . }}</a></p> {{ end }} - {{ if .country }} - <span itemprop="addressCountry"> - {{ partial "PrepareHTML" .country }} - </span> + </div> + {{ end }} + {{ with .phone_numbers}} + <div> + <p class="meta">{{- i18n "commons.contact.phone" -}}</p> + {{ range . }} + <p><a itemprop="telephone" href="tel:{{ . }}">{{ . }}</a></p> {{ end }} </div> {{ end }} - {{ end }} - {{ with .url }} - <p><a href="{{ . }}" target="_blank" rel="noreferrer">{{ . }}</a></p> - {{ end }} - {{ range .phone_numbers }} - <p><a itemprop="telephone" href="tel:{{ . }}">{{ . }}</a></p> - {{ end }} - {{ range .emails }} - <p><a itemprop="email" href="mailto:{{ . }}">{{ . }}</a></p> - {{ end }} + </div> </address> {{ if .timetable}} + <span class="meta">{{- i18n "commons.contact.schedule" -}}</span> <ul> {{ range .timetable }} {{ if or -- GitLab