Placeholder for events without description

This commit is contained in:
Stefan Schlott 2015-02-19 22:50:28 +01:00
parent c47dba534c
commit 537178d991
3 changed files with 48 additions and 8 deletions

1
Rules
View file

@ -3,6 +3,7 @@
preprocess do
expand_event_list("/_data/chaosevents/")
expand_event_list("/_data/stammtisch/", "CCCS Stammtisch")
expand_event_list("/_data/platzhalter/", nil, true)
calculate_to_dates
fix_timezones
merge_location_data

View file

@ -0,0 +1,37 @@
---
events:
- title: CCCS Vortragsabend (Thema noch offen)
startdate: 2015-01-08T19:30:00Z
duration: 2h
location:
location: bib
- title: CCCS Vortragsabend (Thema noch offen)
startdate: 2015-02-12T19:30:00Z
duration: 2h
location:
location: bib
- title: CCCS Vortragsabend (Thema noch offen)
startdate: 2015-02-12T19:30:00Z
duration: 2h
location:
location: bib
- title: CCCS Vortragsabend (Thema noch offen)
startdate: 2015-03-12T19:30:00Z
duration: 2h
location:
location: bib
- title: CCCS Vortragsabend (Thema noch offen)
startdate: 2015-04-09T19:30:00Z
duration: 2h
location:
location: bib
- title: CCCS Vortragsabend (Thema noch offen)
startdate: 2015-05-14T19:30:00Z
duration: 2h
location:
location: bib
- title: CCCS Vortragsabend (Thema noch offen)
startdate: 2015-06-11T19:30:00Z
duration: 2h
location:
location: bib

View file

@ -1,5 +1,6 @@
def expand_event_list(itemId, defaultTitle = nil)
def expand_event_list(itemId, defaultTitle = nil, skipIfDatePresent = false)
@items[itemId][:events].each_with_index do |event,n|
if (!skipIfDatePresent || !@items.any?{ |i| i[:startdate]==event[:startdate] })
metadata = {
:title => defaultTitle,
:public => true
@ -8,5 +9,6 @@ def expand_event_list(itemId, defaultTitle = nil)
metadata[:kind]='event'
@items << Nanoc::Item.new("<%= render 'event_body' %>", metadata, "#{itemId}#{n}/")
end
end
end