Changements pour avoir un flux rss valide

This commit is contained in:
echarp 2014-06-27 10:35:42 +02:00
parent e742e7b8e6
commit 6e152f0d43

View File

@ -10,8 +10,8 @@ xml.tag! 'rdf:RDF', 'xmlns:rdf' => "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
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.dc :language, 'fr'
xml.dc :creator, 'AgendaDuLibre.org'
xml.items do
xml.tag! 'rdf:Seq' do
@ -26,15 +26,15 @@ xml.tag! 'rdf:RDF', 'xmlns:rdf' => "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xml.item 'rdf:about' => event_url(event) do
xml.title "#{event.city}: #{event.title}, le #{l event.start_time.to_date, format: :long}"
xml.link event_url event
xml.tag! 'dc:identifier', "#{event.id}@agendadulibre.org"
xml.tag! 'dc:date', event.start_time
xml.tag! 'georss:point', "#{event.related_city.latitude} #{event.related_city.longitude}" rescue nil
xml.dc :identifier, "#{event.id}@agendadulibre.org"
xml.dc :date, event.start_time.iso8601
xml.dc :point, "#{event.related_city.latitude} #{event.related_city.longitude}" rescue nil
@event = event
content = render file: '/events/show.html', locals: { rss: true }
xml.description strip_tags(content)
xml.tag! 'content:encoded', content
xml.tag!('content:encoded') { xml.cdata!(content) }
end
end
end