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

19 lines
771 B
Plaintext
Raw Normal View History

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//AgendaDuLibre.org
X-WR-CALNAME:<%= t('title', scope: [:layouts, :application]).gsub(/'/, '') %>
X-WR-CALDESC:<%= t 'subtitle', scope: [:layouts, :application] %>
X-WR-TIMEZONE:<%= Time.now.zone %>
2014-08-25 17:55:14 +02:00
<% @events.find_each do |event| %>
BEGIN:VEVENT
DTSTART;TZID=<%= Time.now.zone %>:<%= event.start_time.strftime '%Y%m%dT%H%M%S' %>
DTEND;TZID=<%= Time.now.zone %>:<%= event.end_time.strftime '%Y%m%dT%H%M%S' %>
UID:<%= event.id %>@agendadulibre.org
SUMMARY:<%= event.title.gsub(',', '\,').gsub(';', '\;') %>
URL:<%= event_url event %>
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