Skip to content

Commit

Permalink
Darstellung Kalender verbessert, wenn keine Events geplant sind
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Sep 28, 2024
1 parent 45cc421 commit 1a8b624
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
9 changes: 0 additions & 9 deletions data/osmevents.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
[[event]]
href = "https://2024.stateofthemap.org/"
title = "State of the Map 2024"
image = "sotm-nairobi.svg"
dateFrom = "2024-09-06"
dateTo = "2024-09-08"
dateText = "6. bis 8. September 2024"
location = "Nairobi, Kenia"

[[event]]
href = "https://www.fossgis.de/wiki/FOSSGIS_OSM_Communitytreffen_2024_Nummer_22"
title = "FOSSGIS OSM Communitytreffen 2024 Nummer 22"
Expand Down
9 changes: 0 additions & 9 deletions data/otherevents.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
[[event]]
href = "https://maker-faire.de/hannover/"
title = "Maker Faire 2024"
image = "makerfaire.png"
dateFrom = "2024-08-17"
dateTo = "2024-08-18"
dateText = "17. bis 18. August 2024"
location = "Hannover"

[[event]]
href = "https://datenspuren.de/2024/"
title = "Datenspuren 2024"
Expand Down
7 changes: 5 additions & 2 deletions layouts/shortcodes/cal.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<div class="cal-events">
{{ $c := index $.Site.Data (.Get "calendar") }}
{{ range sort $c.event "dateFrom" -}}
{{ if (time .dateTo).After now }}
{{ $cf := where $c.event "dateTo" "gt" (now.Format "2006-01-02") }}
{{ if ( gt ( len $cf ) 0 ) -}}
{{ range sort $cf "dateFrom" -}}
<div>
<a href="{{ .href }}">
{{- if isset . "image" -}}
Expand All @@ -13,5 +14,7 @@
<div>{{ .location }}<br/>{{ .dateText }}</div>
</div>
{{ end -}}
{{ else -}}
<i>(Derzeit keine Events geplant.)</i>
{{ end -}}
</div>

0 comments on commit 1a8b624

Please sign in to comment.