Skip to content

Commit

Permalink
Merge branch 'improve-cal-view' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
rverst committed Nov 16, 2020
2 parents d7311f3 + f0c1112 commit 5341971
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 94 deletions.
2 changes: 1 addition & 1 deletion content/termine/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Termine
type: eventlist
layout: abo
outputs:
- html
- json
Expand Down
7 changes: 7 additions & 0 deletions content/termine/abo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Termine
type: eventlist
outputs:
- calendar
---
Test
10 changes: 10 additions & 0 deletions themes/bb2018/assets/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"*": [
"*"
]
}
}
}
11 changes: 11 additions & 0 deletions themes/bb2018/layouts/termine/abo.calendar.ics
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//buterland-beckerhook//termine//DE
CALSCALE:GREGORIAN
METHOD:PUBLISH
{{- range first 2 .Sections -}}
{{- range .Pages.ByParam "start" -}}
{{- template "termine/calentry.ics" . -}}
{{- end -}}
{{- end -}}
END:VCALENDAR
40 changes: 40 additions & 0 deletions themes/bb2018/layouts/termine/calentry.ics
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{ $start := time .Params.start -}}
{{ $end := time .Params.end -}}
{{ $hasStart := (eq (printf "%T" $start) "time.Time") -}}
{{ $hasEnd := (eq (printf "%T" $end) "time.Time") -}}
{{ $seq := 0 }}
{{ with .Params.revision }}{{ $seq = . }}{{ end -}}
{{ $status := "CONFIRMED" -}}
{{ with .Params.canceled }}{{ if . }}{{ $status = "CANCELED" }}{{ end -}}{{ end -}}
{{ if and $hasStart (not .Draft) }}
BEGIN:VEVENT
ORGANIZER;CN="Schützenverein Buterland-Beckerhook":mailto:Kontakt@Buterland-Beckerhook.de
SUMMARY:{{ .Title }}
{{ with .Content }}DESCRIPTION: {{ . | plainify }}{{ end -}}
UID:{{ sha256 (printf "%s-%s" .Title (dateFormat "01-2006" $start)) }}
SEQUENCE:{{ $seq }}
STATUS:{{ $status }}
DTSTAMP:{{- with .Params.Date }}{{dateFormat "20060102T150405Z" . }}{{ else }}{{dateFormat "20060102T150405Z" now }}{{ end }}
LAST-MODIFIED:{{- with .Params.lastmod }}{{dateFormat "20060102T150405Z" . }}{{ else }}{{dateFormat "20060102T150405Z" now }}{{ end }}
{{- if (gt $start.Hour 0) }}
DTSTART;TZID=Europe/Berlin:{{dateFormat "20060102T150405" $start}}
DTEND;TZID=Europe/Berlin:{{- if $hasEnd }}{{dateFormat "20060102T150405" $end }}{{ else }}{{ printf "%sT000000" (dateFormat "20060102" ($start.AddDate 0 0 1)) -}}{{- end -}}
{{ else }}
DTSTART;VALUE=DATE:{{dateFormat "20060102" $start }}
DTEND;VALUE=DATE:{{- if $hasEnd }}{{dateFormat "20060102" $end }}{{ else }}{{dateFormat "20060102" $start -}}{{- end }}{{ end }}
LOCATION:{{ with .Params.location -}}
{{- with (index $.Site.Data.locations .) -}}
{{- .name }}
{{- with .street }}, {{.}}{{ end }}
{{- with .zip }}, {{.}}{{ end }}
{{- with .city }} {{.}}{{ end }}
{{- if and (isset . "lat") (isset . "lng") }}
GEO:{{ .lat }};{{ .lng }}
{{- end -}}
{{- else }}
{{- . -}}
{{- end }}
{{- end }}
URL:{{ .Site.BaseURL }}/termine
END:VEVENT
{{ end -}}
42 changes: 1 addition & 41 deletions themes/bb2018/layouts/termine/list.calendar.ics
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,6 @@ PRODID:-//buterland-beckerhook//termine//DE
CALSCALE:GREGORIAN
METHOD:PUBLISH
{{ range .Pages.ByParam "start" -}}
{{ $start := time .Params.start -}}
{{ $end := time .Params.end -}}
{{ $hasStart := (eq (printf "%T" $start) "time.Time") -}}
{{ $hasEnd := (eq (printf "%T" $end) "time.Time") -}}
{{ $seq := 0 }}
{{ with .Params.revision }}{{ $seq = . }}{{ end -}}
{{ $status := "CONFIRMED" }}
{{ with .Params.canceled }}{{ if . }}{{ $status = "CANCELED" }}{{ end -}}{{ end -}}

{{ if and $hasStart (not .Draft) }}
BEGIN:VEVENT
ORGANIZER;CN="Schützenverein Buterland-Beckerhook":mailto:Kontakt@Buterland-Beckerhook.de
SUMMARY:{{ .Title }}
{{ with .Content }}DESCRIPTION: {{ . | plainify }}{{ end -}}
UID:{{ sha256 (printf "%s-%s" .Title (dateFormat "01-2006" $start)) }}
SEQUENCE:{{ $seq }}
STATUS:{{ $status }}
DTSTAMP:{{- with .Params.Date }}{{dateFormat "20060102T150405Z" . }}{{ else }}{{dateFormat "20060102T150405Z" now }}{{ end }}
LAST-MODIFIED:{{- with .Params.lastmod }}{{dateFormat "20060102T150405Z" . }}{{ else }}{{dateFormat "20060102T150405Z" now }}{{ end }}
{{- if (gt $start.Hour 0) }}
DTSTART;TZID=Europe/Berlin:{{dateFormat "20060102T150405" $start}}
DTEND;TZID=Europe/Berlin:{{- if $hasEnd }}{{dateFormat "20060102T150405" $end }}{{ else }}{{ printf "%sT000000" (dateFormat "20060102" ($start.AddDate 0 0 1)) -}}{{- end -}}
{{ else }}
DTSTART;VALUE=DATE:{{dateFormat "20060102" $start }}
DTEND;VALUE=DATE:{{- if $hasEnd }}{{dateFormat "20060102" $end }}{{ else }}{{dateFormat "20060102" $start -}}{{- end }}{{ end }}
LOCATION:{{ with .Params.location -}}
{{- with (index $.Site.Data.locations .) -}}
{{- .name }}
{{- with .street }}, {{.}}{{ end }}
{{- with .zip }}, {{.}}{{ end }}
{{- with .city }} {{.}}{{ end }}
{{- if and (isset . "lat") (isset . "lng") }}
GEO:{{ .lat }};{{ .lng }}
{{- end -}}
{{- else }}
{{- . -}}
{{- end }}
{{- end }}
URL:{{ .Site.BaseURL }}/termine
END:VEVENT
{{ end -}}
{{- template "termine/calentry.ics" . -}}
{{ end -}}
END:VCALENDAR
9 changes: 3 additions & 6 deletions themes/bb2018/layouts/termine/noscript.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
<tr>
<td class="uk-text-bold {{ if $was }}uk-text-muted{{ end }}">
<a class="uk-link uk-link-text-nu" href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ with .OutputFormats.Get "calendar" }}
<a class="uk-link uk-link-text-nu" href="{{ .Permalink | safeURL }}" type="{{ .MediaType.Type }}" uk-icon="calendar"></a>
{{ end }}
</td>

<td class="{{ if $was }} uk-text-muted{{ end }}">
Expand Down Expand Up @@ -64,12 +61,12 @@
<div class="uk-alert">
<h3 uk-icon="info"></h3>
<p class="uk-text-small uk-margin-remove-top uk-margin-left">
Du kannst einzelne Termine einfach in deinen Kalendar importieren, indem du auf das Icon hinter dem Event klickst.
{{ $year := .Params.year}}
{{ with .OutputFormats.Get "calendar" }}
Oder klicke <a href="{{ .Permalink | safeURL }}" type="{{ .MediaType.Type }}" uk-icon="calendar">hier </a>, um alle Termine
aus {{ $year }} zu importieren.
Du kannst die Termine für {{ $year }} ganz einfach in deinen Kalendar importieren, indem du
<a href="{{ .Permalink | safeURL }}" type="{{ .MediaType.Type }}" uk-icon="calendar">hier </a>, klickst.
{{ end }}
Um einen einzelnen Termin zu importieren, wechsle in die Detailansicht des Termins.
</p>
</div>

Expand Down
42 changes: 1 addition & 41 deletions themes/bb2018/layouts/termine/single.calendar.ics
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,5 @@ VERSION:2.0
PRODID:-//buterland-beckerhook//termine//DE
CALSCALE:GREGORIAN
METHOD:PUBLISH
{{ $start := time .Params.start -}}
{{ $end := time .Params.end -}}
{{ $hasStart := (eq (printf "%T" $start) "time.Time") -}}
{{ $hasEnd := (eq (printf "%T" $end) "time.Time") -}}
{{ $seq := 0 }}
{{ with .Params.revision }}{{ $seq = . }}{{ end -}}
{{ $status := "CONFIRMED" }}
{{ with .Params.canceled }}{{ if . }}{{ $status = "CANCELED" }}{{ end -}}{{ end -}}

{{ if and $hasStart (not .Draft) }}
BEGIN:VEVENT
ORGANIZER;CN="Schützenverein Buterland-Beckerhook":mailto:Kontakt@Buterland-Beckerhook.de
SUMMARY:{{ .Title }}
{{ with .Content }}DESCRIPTION: {{ . | plainify }}{{ end -}}
UID:{{ sha256 (printf "%s-%s" .Title (dateFormat "01-2006" $start)) }}
SEQUENCE:{{ $seq }}
STATUS:{{ $status }}
DTSTAMP:{{- with .Params.Date }}{{dateFormat "20060102T150405Z" . }}{{ else }}{{dateFormat "20060102T150405Z" now }}{{ end }}
LAST-MODIFIED:{{- with .Params.lastmod }}{{dateFormat "20060102T150405Z" . }}{{ else }}{{dateFormat "20060102T150405Z" now }}{{ end }}
{{- if (gt $start.Hour 0) }}
DTSTART;TZID=Europe/Berlin:{{dateFormat "20060102T150405" $start}}
DTEND;TZID=Europe/Berlin:{{- if $hasEnd }}{{dateFormat "20060102T150405" $end }}{{ else }}{{ printf "%sT000000" (dateFormat "20060102" ($start.AddDate 0 0 1)) -}}{{- end -}}
{{ else }}
DTSTART;VALUE=DATE:{{dateFormat "20060102" $start }}
DTEND;VALUE=DATE:{{- if $hasEnd }}{{dateFormat "20060102" $end }}{{ else }}{{dateFormat "20060102" $start -}}{{- end }}{{ end }}
LOCATION:{{ with .Params.location -}}
{{- with (index $.Site.Data.locations .) -}}
{{- .name }}
{{- with .street }}, {{.}}{{ end }}
{{- with .zip }}, {{.}}{{ end }}
{{- with .city }} {{.}}{{ end }}
{{- if and (isset . "lat") (isset . "lng") }}
GEO:{{ .lat }};{{ .lng }}
{{- end -}}
{{- else }}
{{- . -}}
{{- end }}
{{- end }}
URL:{{ .Site.BaseURL }}/termine
END:VEVENT
{{ end -}}
{{- template "termine/calentry.ics" . -}}
END:VCALENDAR
14 changes: 9 additions & 5 deletions themes/bb2018/layouts/termine/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ <h2>{{ .Title }}</h2>
{{ if $hasEnd }}
<br><span class="{{ if $canceled }} text-strikethrough{{ end }}">
bis <time datetime="{{ $end.String }}">{{ $end.Day }}. {{ index $month.long $end.Month }} {{ $end.Year }}</time>
</span>{{ end }}


</span>{{ end }}

<p>{{ .Content }}</p>
{{ with .OutputFormats.Get "calendar" }}
<br>
<a class="uk-button uk-button-primary" href="{{ .Permalink | safeURL }}" type="{{ .MediaType.Type }}" >Termin Importieren</a>
{{ end }}
</div>
{{ with .Params.location }}
{{ with (index $.Site.Data.locations . ) }}
Expand All @@ -39,8 +45,6 @@ <h2>{{ .Title }}</h2>

if (token !== '') {

console.log(token);

let map = L.map('map').setView([lng, lat], 14);
L.tileLayer('https://api.mapbox.com/styles/v1/rverstbb/ckh22s77e1am31amt3ygaiho6/tiles/{z}/{x}/{y}?access_token=' + token, {
attribution: '© <a href="https://www.mapbox.com/feedback/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
Expand Down Expand Up @@ -68,8 +72,8 @@ <h2>{{ .Title }}</h2>
{{ end }}
</div>

<a href="{{ relURL "/termine" }}">Zurück zur Terminübersicht</a>

<br>
<a class="uk-button uk-button-primary" href="{{ relURL "/termine" }}">Zurück zur Terminübersicht</a>


{{ end }}

0 comments on commit 5341971

Please sign in to comment.