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
&--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
display: flex
flex-direction: column
position: relative
@include media-breakpoint-down(desktop)
+ .event
margin-top: $spacing1
.media
order: -1
img
......@@ -28,6 +58,12 @@
margin-top: $spacing0
.block-agenda--grid
@include in-page-with-sidebar
.events.unique .event .media:empty
display: none
@include in-page-without-sidebar
.events
@include grid(3, desktop)
\ No newline at end of file
.events:not(.unique)
@include grid(3, desktop)
.unique
.events.unique .event-content
position: relative
\ No newline at end of file
{{- $template := .block.template -}}
{{- $position := .block.position -}}
{{- $title := .block.title -}}
{{- $isUnique := false -}}
{{- $class := "block block-agenda" -}}
{{- $layout_class := "block-agenda--list" -}}
{{- with .block.data -}}
......@@ -26,13 +27,18 @@
{{ end -}}
</div>
{{ 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 }}
{{ $event := site.GetPage .file }}
{{ with $event }}
{{ partial "events/event" (dict
"event" .
"layout" $layout
"isUnique" $isUnique
) }}
{{ end }}
{{ end }}
......
{{ $event := .event }}
{{ $layout := "list" }}
{{ $layout = .layout }}
{{ $isUnique := .isUnique }}
{{- $direction := "" -}}
{{ $heading := .heading | default "h2" }}
{{ $heading_tag := (dict
......@@ -24,35 +25,52 @@
<a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}" itemprop="name">{{ $title }}</a>
{{ $heading_tag.close }}
{{ if and (site.Params.events.index.show_description) (eq $layout "list") }}
{{- 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 }}
{{ if eq $isUnique true }}
<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 -}}">
{{ .Params.dates.computed.short }}
<div class="event-time">
{{ if .Params.dates.from.hour }}
<span>{{ .Params.dates.from.hour }}</span>
{{ end }}
{{ if .Params.dates.to.hour }}
<span> {{ .Params.dates.to.hour }}</span>
{{ 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 -}}
<p class="more meta" aria-hidden="true">{{- i18n "commons.more" -}}</p>
{{ end }}
</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 -}}">
{{ .Params.dates.computed.short }}
<div class="event-time">
{{ if .Params.dates.from.hour }}
<span>{{ .Params.dates.from.hour }}</span>
{{ end }}
{{ if .Params.dates.to.hour }}
<span> {{ .Params.dates.to.hour }}</span>
{{ end }}
{{ if eq $isUnique false }}
<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 -}}">
{{ .Params.dates.computed.short }}
<div class="event-time">
{{ if .Params.dates.from.hour }}
<span>{{ .Params.dates.from.hour }}</span>
{{ end }}
{{ if .Params.dates.to.hour }}
<span> {{ .Params.dates.to.hour }}</span>
{{ end }}
</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) -}}
<div class="event-description">
<p itemprop="description">
......@@ -68,6 +86,7 @@
</div>
{{- end -}}
{{- end -}}
{{ end }}
<div class="media">
{{- 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