2021-10-31 16:23:47 +00:00
|
|
|
{{- define "main" -}}
|
|
|
|
|
2024-01-01 15:59:04 +00:00
|
|
|
{{ $past_events := where site.RegularPages "Type" "eventos" }}
|
|
|
|
{{ $past_events = where $past_events "Params.metadata.event.date.finish" "<" (now.Format "2006-01-02") }}
|
|
|
|
{{ $past_events = sort $past_events "Params.metadata.event.date.start" "desc" }}
|
|
|
|
{{ $past_events_paginator := .Paginate $past_events }}
|
2021-10-31 16:23:47 +00:00
|
|
|
|
2024-01-01 15:59:04 +00:00
|
|
|
{{ $future_events := where site.RegularPages "Type" "eventos" }}
|
|
|
|
{{ $future_events = where $future_events "Params.metadata.event.date.finish" ">=" (now.Format "2006-01-02") }}
|
|
|
|
{{ $future_events = sort $future_events "Params.metadata.event.date.start" }}
|
2022-01-06 14:22:03 +00:00
|
|
|
|
2024-01-01 15:59:04 +00:00
|
|
|
{{ if not $past_events_paginator.HasPrev }}
|
|
|
|
<h1 class='events-list-title body-width'>Próximos eventos</h2>
|
|
|
|
|
|
|
|
<div class='body-width'>
|
2024-01-01 15:59:23 +00:00
|
|
|
<a href="webcal://ansol.org/eventos/index.ics">
|
2024-01-01 15:59:04 +00:00
|
|
|
Subscrever ao calendário (ICS)
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<ul class="events-list body-width">
|
|
|
|
{{ range $future_events }}
|
|
|
|
<li>{{ partial "evento" . }}</li>
|
|
|
|
{{ end }}
|
|
|
|
</ul>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
<h1 class='events-list-title body-width'>Eventos passados</h2>
|
2022-01-06 14:22:03 +00:00
|
|
|
<ul class="events-list body-width">
|
2024-01-01 15:59:04 +00:00
|
|
|
{{ range $past_events_paginator.Pages }}
|
2022-01-06 14:22:03 +00:00
|
|
|
<li>{{ partial "evento" . }}</li>
|
2021-10-31 16:23:47 +00:00
|
|
|
{{ end }}
|
|
|
|
</ul>
|
|
|
|
|
2024-01-01 15:59:04 +00:00
|
|
|
{{ if or ($past_events_paginator.HasPrev) ($past_events_paginator.HasNext) }}
|
|
|
|
<nav class='body-width'>
|
|
|
|
<ul class="pagination justify-content-center">
|
|
|
|
{{ if $past_events_paginator.HasPrev }}
|
|
|
|
<li class="page-item"><a class="page-link" href="{{ $past_events_paginator.Prev.URL }}">Eventos mais recentes</a></li>
|
|
|
|
{{ end }}
|
|
|
|
{{ if $past_events_paginator.HasNext }}
|
|
|
|
<li class="page-item"><a class="page-link" href="{{ $past_events_paginator.Next.URL }}">Eventos mais antigos</a></li>
|
|
|
|
{{ end }}
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
{{ end }}
|
2021-10-31 16:23:47 +00:00
|
|
|
{{- end -}}
|