mirror of
https://gitlab.com/ansol/web-ansol.org.git
synced 2024-11-22 06:11:30 +00:00
Adiciona ICS à pagina dos eventos e muda um bocado a paginação
This commit is contained in:
parent
1e01d9909a
commit
bb9fa6172d
@ -1,27 +1,47 @@
|
|||||||
{{- define "main" -}}
|
{{- define "main" -}}
|
||||||
|
|
||||||
<h1 class='events-list-title body-width'>Próximos eventos</h2>
|
{{ $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 }}
|
||||||
|
|
||||||
{{ $query := where site.RegularPages "Type" "eventos" }}
|
{{ $future_events := where site.RegularPages "Type" "eventos" }}
|
||||||
{{ $query = where $query "Params.metadata.event.date.finish" ">=" (now.Format "2006-01-02") }}
|
{{ $future_events = where $future_events "Params.metadata.event.date.finish" ">=" (now.Format "2006-01-02") }}
|
||||||
{{ $query = sort $query "Params.metadata.event.date.start" }}
|
{{ $future_events = sort $future_events "Params.metadata.event.date.start" }}
|
||||||
|
|
||||||
|
{{ if not $past_events_paginator.HasPrev }}
|
||||||
|
<h1 class='events-list-title body-width'>Próximos eventos</h2>
|
||||||
|
|
||||||
|
<div class='body-width'>
|
||||||
|
<a href="webcal://localhost:1313/eventos/index.ics">
|
||||||
|
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>
|
||||||
<ul class="events-list body-width">
|
<ul class="events-list body-width">
|
||||||
{{ range $query }}
|
{{ range $past_events_paginator.Pages }}
|
||||||
<li>{{ partial "evento" . }}</li>
|
<li>{{ partial "evento" . }}</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h1 class='events-list-title body-width'>Eventos antigos</h2>
|
{{ if or ($past_events_paginator.HasPrev) ($past_events_paginator.HasNext) }}
|
||||||
<ul class="events-list body-width">
|
<nav class='body-width'>
|
||||||
{{ $query := where site.RegularPages "Type" "eventos" }}
|
<ul class="pagination justify-content-center">
|
||||||
{{ $query = where $query "Params.metadata.event.date.finish" "<" (now.Format "2006-01-02") }}
|
{{ if $past_events_paginator.HasPrev }}
|
||||||
{{ $query = sort $query "Params.metadata.event.date.start" "desc" }}
|
<li class="page-item"><a class="page-link" href="{{ $past_events_paginator.Prev.URL }}">Eventos mais recentes</a></li>
|
||||||
{{ $paginator := .Paginate $query }}
|
|
||||||
{{ range $paginator.Pages }}
|
|
||||||
<li>{{ partial "evento" . }}</li>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
{{ if $past_events_paginator.HasNext }}
|
||||||
|
<li class="page-item"><a class="page-link" href="{{ $past_events_paginator.Next.URL }}">Eventos mais antigos</a></li>
|
||||||
{{ partial "pagination" . }}
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
{{ end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
BEGIN:VCALENDAR
|
BEGIN:VCALENDAR
|
||||||
VERSION:2.0
|
VERSION:2.0
|
||||||
PRODID:-//ansol-org//eventos//PT
|
PRODID:-//ansol-org//eventos//PT
|
||||||
|
URL:https://ansol.org/eventos/
|
||||||
|
NAME:ANSOL - Eventos
|
||||||
|
X-WR-CALNAME:ANSOL - Eventos
|
||||||
CALSCALE:GREGORIAN
|
CALSCALE:GREGORIAN
|
||||||
METHOD:PUBLISH
|
METHOD:PUBLISH
|
||||||
{{range .Pages -}}
|
{{range .Pages -}}
|
||||||
|
Loading…
Reference in New Issue
Block a user