7
1
mirror of https://gitlab.com/ansol/web-ansol.org.git synced 2024-10-15 20:52:11 +00:00

Improve events list page

This commit is contained in:
Hugo Peixoto 2021-10-31 16:23:47 +00:00
parent 3024225072
commit 5183193f47
16 changed files with 57 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -11,5 +11,5 @@ metadata:
finish: 2021-10-31
map: {}
layout: evento
title: 'Wikidata: Data Quality Days 2021'
title: 'WikidataCon 2021'
---

View File

@ -158,6 +158,12 @@ nav.main .nav-search:hover {
margin-top: 10px;
}
.events-list-title {
margin: 2rem auto;
font-weight: 300;
font-size: 2.25rem;
}
.events-list {
margin-top: 20px;
padding: 0px;
@ -179,6 +185,10 @@ nav.main .nav-search:hover {
width: calc(50% - 50px);
}
.events-list.events-list-full-width li {
width: calc(100% - 50px);
}
.events-list .event-cover {
margin-top: -20px;
margin-left: -20px;

View File

@ -0,0 +1,46 @@
{{- define "main" -}}
<h1 class='events-list-title body-width'>Eventos</h1>
<ul class="events-list body-width">
{{ $paginator := .Paginate (.Data.Pages.ByParam "metadata.event.date.start").Reverse }}
{{ range $paginator.Pages }}
<li>
<a class="img" href="{{ .Permalink }}">
{{ $cover := (index (.Resources.ByType "image") 0) }}
{{ if not $cover }}
{{ $cover = resources.Get "images/default-events-cover.png" }}
{{ end }}
<img class='event-cover' src="{{ $cover.Permalink }}" />
</a>
<p class="headline">
<a class="title" href="{{ .Permalink }}">{{ .Title }}</a>
</p>
<p class="subheader">
<span class="date">
{{ with .Params.metadata.event.date }}
{{ if eq (time.Format "2 January 2006" .start) (time.Format "2 January 2006" .finish) }}
{{ if eq (time.Format "15:04" .start) (time.Format "15:04" .finish) }}
{{ time.Format "2 de January de 2006" .start }}
{{ else }}
{{ time.Format "2 de January de 2006" .start }} das
{{ time.Format "15:04" .start }} às
{{ time.Format "15:04" .finish }}
{{ end }}
{{ else if eq (time.Format "January 2006" .start) (time.Format "January 2006" .finish) }}
De {{ time.Format "2" .start }} a {{ time.Format "2 de January de 2006" .finish }}
{{ else }}
De {{ time.Format "2 de January de 2006" .start }} a {{ time.Format "2 de January de 2006" .finish }}
{{ end }}
{{ end }}
</span>
&mdash;
<span class='location'>{{ .Params.metadata.event.location }}</span>
</p>
</li>
{{ end }}
{{ partial "pagination" . }}
</ul>
{{- end -}}