Events from list files; next Stammtisch

This commit is contained in:
Stefan Schlott 2013-08-27 17:38:25 +02:00
parent ca3b00f0bb
commit 0ae50c117c
6 changed files with 115 additions and 10 deletions

2
Rules
View file

@ -1,6 +1,8 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
preprocess do preprocess do
expand_event_list("/_data/chaosevents/")
expand_event_list("/_data/stammtisch/", "CCCS Stammtisch")
merge_location_data merge_location_data
generate_event_pages generate_event_pages
generate_activity_pages generate_activity_pages

View file

@ -0,0 +1,34 @@
---
events:
-
#kind: event
startdate: 2013-09-06
duration: 2d
title: "MRMCD2013 - Security Advice"
url: http://mrmcd.net/
location:
name: Hochschule Darmstadt
url: https://www.fbi.h-da.de/fbi.html
strasse: Schöfferstr. 8b
plz: 64295
ort: Darmstadt
#public: true
-
startdate: 2013-12-27
duration: 3d
title: "30C3"
url: https://events.ccc.de/
location:
name: CCH
ort: Hamburg
-
startdate: 2014-04-17
duration: 4d
title: "Easterhegg 14 - Codename kEHrwoche"
url: https://eh14.easterhegg.eu/
location:
name: Kulturhaus-Arena Wangen
ort: Stuttgart
lon: 48.777764
lat: 9.235627

View file

@ -0,0 +1,56 @@
---
events:
-
#kind: event
startdate: 2013-08-06T18:00:00
duration: 4h
#title:
location:
location: zadu
#public: true
-
startdate: 2013-08-21T18:00:00
duration: 4h
location:
location: shack
-
startdate: 2013-09-03T18:00:00
duration: 4h
location:
location: zadu
-
startdate: 2013-09-18T18:00:00
duration: 4h
location:
location: shack
-
startdate: 2013-10-01T18:00:00
duration: 4h
location:
location: zadu
-
startdate: 2013-10-16T18:00:00
duration: 4h
location:
location: shack
-
startdate: 2013-11-05T18:00:00
duration: 4h
location:
location: zadu
-
startdate: 2013-11-20T18:00:00
duration: 4h
location:
location: shack
-
startdate: 2013-12-03T18:00:00
duration: 4h
location:
location: zadu
-
startdate: 2013-12-18T18:00:00
duration: 4h
location:
location: shack

View file

@ -47,26 +47,22 @@ feed:
</div> </div>
</div> </div>
<% end %> <% end %>
<% upcomingRegularsTable = get_regulars_tables().select { |e| e[:startdate] > Time.now }
if (upcomingRegularsTable.size>0)
upcomingRegularsTable.sort! { |a,b| a[:startdate] <=> b[:startdate] }
%>
<div class="span6"> <div class="span6">
<div class="well well-large"> <div class="well well-large">
<article itemscope itemtype="http://schema.org/SocialEvent"> <article itemscope itemtype="http://schema.org/SocialEvent">
<h1><a href="#">Nächster <span itemprop="name">CCCS Stammtisch</span></a></h1> <h1><a href="#">Nächster <span itemprop="name">CCCS Stammtisch</span></a></h1>
<p> <%= render 'event_header', :item => upcomingRegularsTable[0], :heading => false, :link => false %>
<strong>Termin:</strong>
<span itemprop="startDate" content="2013-02-05T18:00">Dienstag, 5. Februar 2013, ab 18:00 Uhr</span>
</p>
<p>
<strong>Ort:</strong>
<span itemprop="location" itemscope itemtype="http://schema.org/Location">
<span itemprop="name">Zadu-Bar</span>
</span>
</p>
<p> <p>
<a itemprop="url" href="#">Unsere Stammtische</a> <a itemprop="url" href="#">Unsere Stammtische</a>
</p> </p>
</article> </article>
</div> </div>
</div> </div>
<% end %>
</div> </div>
<div class="row"> <div class="row">
<div class="span8"> <div class="span8">

View file

@ -16,3 +16,8 @@ def generate_activity_pages()
generate_yearly_archive(articles, :startdate, '/activities', 'Aktionen und Aktivitäten', 'event_archive') generate_yearly_archive(articles, :startdate, '/activities', 'Aktionen und Aktivitäten', 'event_archive')
end end
def get_regulars_tables()
items.select { |i| (i[:kind]=='event') && i.identifier.start_with?('/_data/stammtisch/') }
end

12
lib/eventlists.rb Normal file
View file

@ -0,0 +1,12 @@
def expand_event_list(itemId, defaultTitle = nil)
@items[itemId][:events].each_with_index do |event,n|
metadata = {
:title => defaultTitle,
:public => true
}
metadata.merge!(event)
metadata[:kind]='event'
@items << Nanoc::Item.new("<%= render 'event_body' %>", metadata, "#{itemId}#{n}/")
end
end