Skip to content
Snippets Groups Projects
Commit e7aa79b4 authored by Olivia206's avatar Olivia206
Browse files

added style for unique event case

parent 518d52fd
No related branches found
No related tags found
No related merge requests found
.block-agenda .block-agenda
&--grid .events &--grid .events
@include grid(2, md) &:not(.unique)
@include grid(2, md)
&.unique .event
flex-direction: row
grid-gap: $grid-gutter
.media
width: col(4, 8)
&-content
flex: 1
.more
@include icon("arrow-right", after)
margin-top: $spacing1
&::after
margin-left: half($spacing0)
@include media-breakpoint-up(desktop)
&-dates
font-size: $h3-size-desktop
line-height: $h3-line-height
font-weight: $h3-weight
margin-bottom: $spacing2
&-content h2
font-size: $h2-size-desktop
line-height: $h2-line-height
font-weight: $h2-weight
@include media-breakpoint-down(desktop)
grid-gap: $grid-gutter-sm
.media:empty
display: none
.event .event
display: flex display: flex
flex-direction: column flex-direction: column
position: relative position: relative
@include media-breakpoint-down(desktop)
+ .event
margin-top: $spacing1
.media .media
order: -1 order: -1
img img
...@@ -28,6 +58,12 @@ ...@@ -28,6 +58,12 @@
margin-top: $spacing0 margin-top: $spacing0
.block-agenda--grid .block-agenda--grid
@include in-page-with-sidebar
.events.unique .event .media:empty
display: none
@include in-page-without-sidebar @include in-page-without-sidebar
.events .events:not(.unique)
@include grid(3, desktop) @include grid(3, desktop)
\ No newline at end of file .unique
.events.unique .event-content
position: relative
\ No newline at end of file
{{- $template := .block.template -}} {{- $template := .block.template -}}
{{- $position := .block.position -}} {{- $position := .block.position -}}
{{- $title := .block.title -}} {{- $title := .block.title -}}
{{- $isUnique := false -}}
{{- $class := "block block-agenda" -}} {{- $class := "block block-agenda" -}}
{{- $layout_class := "block-agenda--list" -}} {{- $layout_class := "block-agenda--list" -}}
{{- with .block.data -}} {{- with .block.data -}}
...@@ -26,13 +27,18 @@ ...@@ -26,13 +27,18 @@
{{ end -}} {{ end -}}
</div> </div>
{{ end -}} {{ end -}}
<div class="events"> {{ $rangeLength := len .events }}
{{ if eq $rangeLength 1 }}
{{ $isUnique = true }}
{{ end }}
<div class="events{{ if eq $rangeLength 1 }} unique{{ end}} ">
{{ range .events }} {{ range .events }}
{{ $event := site.GetPage .file }} {{ $event := site.GetPage .file }}
{{ with $event }} {{ with $event }}
{{ partial "events/event" (dict {{ partial "events/event" (dict
"event" . "event" .
"layout" $layout "layout" $layout
"isUnique" $isUnique
) }} ) }}
{{ end }} {{ end }}
{{ end }} {{ end }}
......
{{ $event := .event }} {{ $event := .event }}
{{ $layout := "list" }} {{ $layout := "list" }}
{{ $layout = .layout }} {{ $layout = .layout }}
{{ $isUnique := .isUnique }}
{{- $direction := "" -}} {{- $direction := "" -}}
{{ $heading := .heading | default "h2" }} {{ $heading := .heading | default "h2" }}
{{ $heading_tag := (dict {{ $heading_tag := (dict
...@@ -24,35 +25,52 @@ ...@@ -24,35 +25,52 @@
<a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}" itemprop="name">{{ $title }}</a> <a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}" itemprop="name">{{ $title }}</a>
{{ $heading_tag.close }} {{ $heading_tag.close }}
{{ if and (site.Params.events.index.show_description) (eq $layout "list") }} {{ if eq $isUnique true }}
{{- if (partial "GetTextFromHTML" .Params.summary) -}} <div class="event-dates" itemprop="startDate" content="{{- if .Params.dates.from.day -}}{{ .Params.dates.from.day }}{{- end -}} {{- if .Params.dates.from.hour -}}{{ .Params.dates.from.hour }}{{- end -}}">
<p itemprop="description"> {{ .Params.dates.computed.short }}
{{ if site.Params.events.index.truncate_description }} <div class="event-time">
{{ partial "GetTruncateContent" ( dict {{ if .Params.dates.from.hour }}
"text" .Params.summary <span>{{ .Params.dates.from.hour }}</span>
"length" site.Params.events.index.truncate_description {{ end }}
) }} {{ if .Params.dates.to.hour }}
{{ else }} <span> {{ .Params.dates.to.hour }}</span>
{{ partial "PrepareText" .Params.summary }}
{{ end }} {{ end }}
</p> </div>
</div>
{{ if site.Params.events.index.show_description }}
{{- if (partial "GetTextFromHTML" .Params.summary) -}}
<p itemprop="description">
{{ if site.Params.events.index.truncate_description }}
{{ partial "GetTruncateContent" ( dict
"text" .Params.summary
"length" site.Params.events.index.truncate_description
) }}
{{ else }}
{{ partial "PrepareText" .Params.summary }}
{{ end }}
</p>
{{- end -}}
{{- end -}} {{- end -}}
{{- end -}}
<p class="more meta" aria-hidden="true">{{- i18n "commons.more" -}}</p>
{{ end }}
</div> </div>
<div class="event-dates" itemprop="startDate" content="{{- if .Params.dates.from.day -}}{{ .Params.dates.from.day }}{{- end -}} {{- if .Params.dates.from.hour -}}{{ .Params.dates.from.hour }}{{- end -}}"> {{ if eq $isUnique false }}
{{ .Params.dates.computed.short }} <div class="event-dates" itemprop="startDate" content="{{- if .Params.dates.from.day -}}{{ .Params.dates.from.day }}{{- end -}} {{- if .Params.dates.from.hour -}}{{ .Params.dates.from.hour }}{{- end -}}">
<div class="event-time"> {{ .Params.dates.computed.short }}
{{ if .Params.dates.from.hour }} <div class="event-time">
<span>{{ .Params.dates.from.hour }}</span> {{ if .Params.dates.from.hour }}
{{ end }} <span>{{ .Params.dates.from.hour }}</span>
{{ if .Params.dates.to.hour }} {{ end }}
<span> {{ .Params.dates.to.hour }}</span> {{ if .Params.dates.to.hour }}
{{ end }} <span> {{ .Params.dates.to.hour }}</span>
{{ end }}
</div>
</div> </div>
</div>
{{ if and (site.Params.events.index.show_description) (eq $layout "grid") }} {{ if and (site.Params.events.index.show_description) (eq $layout "grid") }}
{{- if (partial "GetTextFromHTML" .Params.summary) -}} {{- if (partial "GetTextFromHTML" .Params.summary) -}}
<div class="event-description"> <div class="event-description">
<p itemprop="description"> <p itemprop="description">
...@@ -68,6 +86,7 @@ ...@@ -68,6 +86,7 @@
</div> </div>
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{ end }}
<div class="media"> <div class="media">
{{- if .Params.image -}} {{- if .Params.image -}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment