ical export
This commit is contained in:
parent
cb3ffbd96e
commit
3db77d4afa
5 changed files with 40 additions and 1 deletions
1
Gemfile
1
Gemfile
|
|
@ -11,4 +11,5 @@ gem 'rdiscount'
|
||||||
gem 't'
|
gem 't'
|
||||||
gem 'nokogiri'
|
gem 'nokogiri'
|
||||||
gem 'feedzirra'
|
gem 'feedzirra'
|
||||||
|
gem 'ri_cal'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,7 @@ GEM
|
||||||
rdoc (3.12.2)
|
rdoc (3.12.2)
|
||||||
json (~> 1.4)
|
json (~> 1.4)
|
||||||
retryable (1.3.2)
|
retryable (1.3.2)
|
||||||
|
ri_cal (0.8.8)
|
||||||
sass (3.2.10)
|
sass (3.2.10)
|
||||||
sax-machine (0.1.0)
|
sax-machine (0.1.0)
|
||||||
nokogiri (> 0.0.0)
|
nokogiri (> 0.0.0)
|
||||||
|
|
@ -135,6 +136,7 @@ DEPENDENCIES
|
||||||
nanoc3
|
nanoc3
|
||||||
nokogiri
|
nokogiri
|
||||||
rdiscount
|
rdiscount
|
||||||
|
ri_cal
|
||||||
sass
|
sass
|
||||||
systemu
|
systemu
|
||||||
t
|
t
|
||||||
|
|
|
||||||
8
Rules
8
Rules
|
|
@ -28,6 +28,10 @@ compile '/styles/*' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
compile "/ical" do
|
||||||
|
filter :erb
|
||||||
|
end
|
||||||
|
|
||||||
compile "/htaccess" do
|
compile "/htaccess" do
|
||||||
filter :erb
|
filter :erb
|
||||||
end
|
end
|
||||||
|
|
@ -73,6 +77,10 @@ route '/styles/*' do
|
||||||
item.identifier.chop + '.css'
|
item.identifier.chop + '.css'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
route "/ical" do
|
||||||
|
"/cccs.ical"
|
||||||
|
end
|
||||||
|
|
||||||
route "/htaccess" do
|
route "/htaccess" do
|
||||||
"/.htaccess"
|
"/.htaccess"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
28
content/ical.txt
Normal file
28
content/ical.txt
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
<% require 'ri_cal'
|
||||||
|
|
||||||
|
upcomingEvents = get_public_events().select { |e| e[:startdate].to_datetime > DateTime.now }
|
||||||
|
upcomingEvents.sort! { |a,b| a[:startdate].to_datetime <=> b[:startdate].to_datetime }
|
||||||
|
|
||||||
|
cal = RiCal.Calendar do |cal|
|
||||||
|
upcomingEvents.each do |e|
|
||||||
|
cal.event do |event|
|
||||||
|
event.summary = e[:title]
|
||||||
|
event.description = ""
|
||||||
|
event.dtstart = e[:startdate]
|
||||||
|
event.dtend = e[:enddate]
|
||||||
|
if e[:location]
|
||||||
|
if e[:location][:details]
|
||||||
|
event.location = "#{e[:location][:name]}, #{e[:location][:details]}"
|
||||||
|
else
|
||||||
|
event.location = e[:location][:name]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if e[:url]
|
||||||
|
event.url = e[:url]
|
||||||
|
elsif e.identifier.start_with?('/events')
|
||||||
|
event.url = e.path
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
%><%= cal.to_s %>
|
||||||
|
|
@ -21,7 +21,7 @@ feed:
|
||||||
stehen die Termine von uns veranstalteter Aktionen. Zusätzlich sind wir
|
stehen die Termine von uns veranstalteter Aktionen. Zusätzlich sind wir
|
||||||
mitunter bei fremden Veranstaltungen eingeladen, die findest Du unter
|
mitunter bei fremden Veranstaltungen eingeladen, die findest Du unter
|
||||||
<a href="/activities/">Aktivitäten</a> (möglicherweise sind nicht alle öffentlich).
|
<a href="/activities/">Aktivitäten</a> (möglicherweise sind nicht alle öffentlich).
|
||||||
Du kannst all diese Termine auch <a href="#">per ical abonnieren</a>.
|
Du kannst all diese Termine auch <a href="/cccs.ical">per ical abonnieren</a>.
|
||||||
<p>
|
<p>
|
||||||
<strong>Aktuelle Informationen?</strong> Unten auf der Seite stehen blog-artig
|
<strong>Aktuelle Informationen?</strong> Unten auf der Seite stehen blog-artig
|
||||||
Artikel und Notizen. Wenn Du diese automatisch beziehen möchtest, kannst
|
Artikel und Notizen. Wenn Du diese automatisch beziehen möchtest, kannst
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue