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

Block Location: Ajout d'un lien "en savoir plus" #537

Merged
merged 22 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
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
104 changes: 61 additions & 43 deletions assets/sass/_theme/sections/locations.sass
Original file line number Diff line number Diff line change
@@ -1,51 +1,69 @@
.locations
.location
display: flex
flex-direction: column-reverse
gap: calc(var(--grid-gutter) / 2)
justify-content: flex-end
position: relative
a
@include stretched-link(after)
text-decoration: none
.more
@include hover-translate-icon(after)
@include meta
@include icon(arrow-right-line, after)
margin-left: $spacing-2
margin-top: $spacing-1

.media
Clararigaud marked this conversation as resolved.
Show resolved Hide resolved
width: 100%
img
aspect-ratio: 3/2
display: block
object-fit: cover
@include media-breakpoint-down(desktop)
&-description
margin-top: $spacing-1
+ .location
margin-top: $spacing-4

&--list
.location + .location
margin-top: $spacing-4
@include media-breakpoint-up(desktop)
.location
flex-direction: row
.media
width: columns(4)
border-bottom: 1px solid var(--color-border)
flex-direction: row-reverse
gap: var(--grid-gutter)
padding-bottom: $spacing-3
+ .location
margin-top: $spacing-3
&-content
width: columns(6)
flex: 1
@include in-page-with-sidebar
.media
width: columns(2)
@include in-page-without-sidebar
Clararigaud marked this conversation as resolved.
Show resolved Hide resolved
&-content,
&-description
display: flex
&-content
gap: var(--grid-gutter)
&-description
flex-direction: column
justify-content: space-between
&-title
min-width: columns(4)
.media
width: columns(4)
.more
line-height: 1

&--grid
.location-title
@include h3
@include media-breakpoint-down(desktop)
.location + .location
margin-top: $spacing-4
@include in-page-with-sidebar
@include grid(2)
@include in-page-without-sidebar
@include grid(4)

.location
display: flex
gap: $spacing-3 var(--grid-gutter)
flex-direction: column
position: relative
a
@include stretched-link
text-decoration: none
.media
aspect-ratio: 1.3
background: var(--color-background-alt)
order: -1
img
display: block
height: 100%
object-fit: cover
width: 100%
&-title
@include icon(arrow-right-line, after, true)
@include hover-translate-icon(after)
&-description
margin-top: $spacing-3
@include media-breakpoint-down(desktop)
.media
margin-left: var(--grid-gutter-negative)
margin-right: var(--grid-gutter-negative)
@include grid(3)
.location-title
@include h3

.campus-map
.map
Expand Down Expand Up @@ -79,7 +97,7 @@
align-items: center
display: flex
.campus-content
order: 2
order: 2
padding: 0 $spacing-3
span,
.campus-title
Expand All @@ -89,15 +107,15 @@
.media
aspect-ratio: 1
display: block
width: $spacing-6
margin-bottom: 0
order: 1
width: $spacing-6
img
display: block
height: 100%
object-fit: cover
&-wrapper
border-radius: 0
padding: 0
box-shadow: none
overflow: hidden
overflow: hidden
padding: 0
2 changes: 2 additions & 0 deletions i18n/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ blocks:
title: Image
key_figures:
title: Key figures
locations:
button_location: Discover the site
organizations:
title: Organizations
pages:
Expand Down
2 changes: 2 additions & 0 deletions i18n/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ blocks:
title: Image
key_figures:
title: Chiffres-clés
locations:
button_location: Découvrir le site
organizations:
title: Organisations
pages:
Expand Down
19 changes: 10 additions & 9 deletions layouts/partials/locations/location.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,31 @@
<a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a>
{{ $heading_tag.close }}

{{- if and (partial "GetTextFromHTML" .Params.summary) $options.summary -}}
<div class="location-description">
<div class="location-description">
{{- if and (partial "GetTextFromHTML" .Params.summary) $options.summary -}}
Clararigaud marked this conversation as resolved.
Show resolved Hide resolved
<p itemprop="description">
{{ partial "GetTruncateContent" ( dict
"text" .Params.summary
"length" site.Params.locations.index.truncate_description
) }}
</p>
{{- end -}}
<p class="more meta">
{{- i18n "blocks.locations.button_location" -}}
</p>
</div>
{{- end -}}
</div>
</div>

{{ if $options.image }}
<div class="media">
{{- if .Params.image -}}
{{- if .Params.image -}}
<div class="media">
{{- partial "commons/image.html"
(dict
"image" .Params.image
"sizes" site.Params.image_sizes.sections.locations.item
) -}}
{{- else -}}
{{- partial "commons/image-default.html" "locations" -}}
</div>
{{- end -}}
</div>
{{- end -}}
</article>
{{ end }}
Loading