2013-12-29 20:42:00 +01:00
|
|
|
xml.instruct!
|
|
|
|
|
|
|
|
xml.tag! 'rdf:RDF', 'xmlns:rdf' => "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
|
|
|
'xmlns' => "http://purl.org/rss/1.0/", 'xmlns:dc' => "http://purl.org/dc/elements/1.1/",
|
|
|
|
'xmlns:sy' => "http://purl.org/rss/1.0/modules/syndication/",
|
|
|
|
'xmlns:admin' => "http://webns.net/mvcb/", 'xmlns:cc' => "http://web.resource.org/cc/",
|
|
|
|
'xmlns:content' => "http://purl.org/rss/1.0/modules/content/",
|
|
|
|
'xmlns:georss' => "http://www.georss.org/georss" do
|
|
|
|
xml.channel 'rdf:about' => root_url do
|
|
|
|
xml.title "Agenda du Libre [ #{params[:region].present? && params[:region] != 'all' ? Region.find(params[:region]).name : t('.all_regions')} ]"
|
|
|
|
xml.description 'Agenda des événements autour du Logiciel Libre'
|
|
|
|
xml.link 'http://www.agendadulibre.org'
|
|
|
|
xml.tag! 'dc:language', 'fr'
|
|
|
|
xml.tag! 'dc:creator', 'AgendaDuLibre.org'
|
|
|
|
|
|
|
|
xml.items do
|
|
|
|
xml.tag! 'rdf:Seq' do
|
|
|
|
for event in @events
|
|
|
|
xml.tag! 'rdf:li', 'rdf:resource' => event_url(event)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
for event in @events
|
|
|
|
xml.item 'rdf:about' => event_url(event) do
|
2014-01-02 00:21:49 +01:00
|
|
|
xml.title "#{event.city}: #{event.title}, le #{l event.start_time.to_date, format: :long}"
|
2013-12-29 20:42:00 +01:00
|
|
|
xml.link event_url event
|
|
|
|
xml.tag! 'dc:identifier', "#{event.id}@agendadulibre.org"
|
|
|
|
xml.tag! 'dc:date', event.start_time
|
2014-05-04 13:42:03 +02:00
|
|
|
city = event.related_city
|
2014-01-02 01:32:32 +01:00
|
|
|
xml.tag! 'georss:point', "#{city.latitude} #{city.longitude}" rescue nil
|
2013-12-29 20:42:00 +01:00
|
|
|
|
2014-01-02 01:32:32 +01:00
|
|
|
@event = event
|
|
|
|
content = render file: '/events/show.html', locals: { rss: true }
|
2013-12-29 20:42:00 +01:00
|
|
|
|
|
|
|
xml.description strip_tags(content)
|
|
|
|
xml.tag! 'content:encoded', content
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|