prepare dynamic calendar

This commit is contained in:
L3D 2019-02-14 11:54:06 +01:00
parent a10ed36055
commit ffabdd1a19
7 changed files with 92 additions and 17 deletions

View file

@ -0,0 +1,5 @@
_template: waffeln.ics
---
_model: waffeln
---
title: C3WOC Tourdaten

View file

@ -1,18 +1,28 @@
;
; Eine Liste mit allen C3WOC Events
;
;; example use:
;
;; start[] = 1970-01-23 13:37:23 Europe/Berlin
;; ende[] = 1970-01-23 23:42:00 Europe/Berlin
;; event[] = Chaos Creation Code
;; ort[] = Ponyville
;; url[] = 'https://example.com'
;
[termine] [termine]
datum[0] = foo start[0] = 1970-01-23 13:37:23 Europe/Berlin
event[0] = bar ende[0] = 1970-01-23 23:42:00 Europe/Berlin
ort[0] = baz event[0] = Chaos Creation Code
url[0] = 42 ort[0] = Ponyville
url[0] = 'https://example.com'
datum[] = foo ;---------------------------------
event[] = bar start[1] = 1970-01-24 13:37:23 Europe/Berlin
ort[] = baz1 ende[1] = 1970-01-25 23:42:00 Europe/Berlin
url[] = 42 event[1] = Chaos Creation Code2
ort[1] = Ponyville2
datum[] = foo url[1] = 'https://example.com/pr0n'
event[] = bar ;---------------------------------
ort[] = baz2
url[] = 42

25
flowblocks/termine.ini Normal file
View file

@ -0,0 +1,25 @@
[block]
name = Termin
button_label = Termin
[fields.start]
label = Start des Events [1970-01-23 13:37:23 Europe/Berlin]
type = datetime
[fields.start]
label = Ende des Events [1970-01-23 13:37:23 Europe/Berlin]
type = datetime
[fields.event]
label = Eventname
type = string
[fields.ort]
label = Veranstaltungsort
type = string
[fields.url]
label = Link zu weiteren Informationen
type = string

17
models/waffeln.ini Normal file
View file

@ -0,0 +1,17 @@
[model]
name = ICS Feed
label = {{ this.title }}
protected = yes
hidden = yes
;-----------
[fields.title]
label = Titel
addon_label = [[header]]
size = large
type = string

View file

@ -0,0 +1 @@
42

View file

@ -61,9 +61,24 @@
<header class="major"> <header class="major">
<h2>{{ this.icons_header }}</h2> <h2>{{ this.icons_header }}</h2>
{{ this.icons_text }} {{ this.icons_text }}
</header>{% if this.render_tourdaten %} </header>{%
{{ bag('termine', 'termine', 'ort[]') }} if this.render_tourdaten %}<div class="table-wrapper">
{% endif %} <div class="table-wrapper">
<thead>
<tr>
<th>Datum</th>
<th>Veranstaltung</th>
<th>Ort</th>
</tr>
</thead>
<tbody>{%
for x in range(0, 999) %}{%
if bag('termine', 'termine', 'start[' + x|string + ']') is not none %}
<tr>
<td>{% set start = bag('termine', 'termine', 'start[' + x|string + ']') %}{{ start }}
{% endif %}{%
endfor %}{%
endif %}
<div class="box alt"> <div class="box alt">
<div class="row uniform"> <div class="row uniform">
<section class="4u 6u(medium) 12u$(xsmall)"> <section class="4u 6u(medium) 12u$(xsmall)">

2
templates/waffeln.ics Normal file
View file

@ -0,0 +1,2 @@