agenda-libre-ruby/app/views/events/index.ics.erb

20 lines
674 B
Plaintext
Raw Normal View History

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//AgendaDuLibre.org
X-WR-CALNAME:Agenda du Libre
X-WR-TIMEZONE:Europe/Paris
CALSCALE:GREGORIAN
X-WR-CALDESC:<%= t 'title', scope: [:layouts, :application] %>
2014-08-25 17:55:14 +02:00
<% @events.find_each do |event| %>
BEGIN:VEVENT
2014-08-25 23:37:47 +02:00
DTSTART:<%= event.start_time.strftime '%Y%m%dT%H%M%S' %>
DTEND:<%= event.end_time.strftime '%Y%m%dT%H%M%S' %>
UID:<%= event.id %>@agendadulibre.org
2014-08-26 00:00:45 +02:00
SUMMARY:<%= event.title.gsub(/,/, '\,').gsub(/;/, '\;') %>
URL:<%= event_url event %>
2014-08-26 00:26:15 +02:00
DESCRIPTION:<%= strip_tags(event.description).gsub(/'/, '').gsub(/,/, '\,').gsub(/;/, '\;').gsub /^/, ' ' %>
2014-08-25 23:57:57 +02:00
LOCATION:<%= event.full_address.gsub(/,/, '\,') %>
END:VEVENT
<% end %>
END:VCALENDAR