Ajout de l'adresse dans les flux rss et ical
This commit is contained in:
parent
dad2e7daab
commit
144737b54d
@ -12,7 +12,7 @@ class EventsController < ApplicationController
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.rss do
|
||||
@events = @events.includes(:related_city).future_in params[:daylimit]
|
||||
@events = @events.future_in params[:daylimit]
|
||||
end
|
||||
format.ics { @events = @events.last_year.order :id }
|
||||
format.xml { @events = @events.includes(:related_region).order :id }
|
||||
|
@ -17,9 +17,10 @@ module EventsHelper
|
||||
keywords: @event.tags,
|
||||
DC: { title: @event.title, date: @event.start_time.to_s },
|
||||
geo: {
|
||||
region: @event.related_region,
|
||||
placename: @event.city,
|
||||
position: "#{@event.latitude};#{@event.longitude}"
|
||||
region: @event.related_region,
|
||||
position: "#{@event.latitude};#{@event.longitude}",
|
||||
ICBM: "#{@event.latitude}, #{@event.longitude}"
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -13,7 +13,7 @@ UID:<%= event.id %>@agendadulibre.org
|
||||
SUMMARY:<%= event.title %>
|
||||
URL:<%= event_url event %>
|
||||
DESCRIPTION:Un événement de l'Agenda du Libre
|
||||
LOCATION:<%= event.city.gsub('-', ' ') %>
|
||||
LOCATION:<%= event.address %> <%= event.city.gsub('-', ' ') %>
|
||||
END:VEVENT
|
||||
<% end %>
|
||||
END:VCALENDAR
|
||||
|
@ -1,7 +1,8 @@
|
||||
json.array!(@events) do |event|
|
||||
json.extract! event, :id, :title, :description, :start_time, :end_time,
|
||||
:city, :region_id, :locality, :url, :contact, :contact,
|
||||
:submitter, :moderated, :tags, :secret, :decision_time,
|
||||
:submission_time, :moderator_mail_id, :submitter_mail_id
|
||||
:address, :city, :region_id, :locality, :url, :contact,
|
||||
:contact, :submitter, :moderated, :tags, :secret,
|
||||
:decision_time, :submission_time, :moderator_mail_id,
|
||||
:submitter_mail_id
|
||||
json.url event_url(event, format: :json)
|
||||
end
|
||||
|
@ -39,12 +39,8 @@ xml.rdf :RDF,
|
||||
domain = root_url.gsub(/www/, '').gsub(/http.?:../, '').gsub(/:.*/, '')
|
||||
xml.dc :identifier, "#{event.id}@#{domain}"
|
||||
xml.dc :date, event.start_time.iso8601
|
||||
if event.related_city && event.related_city.latitude &&
|
||||
event.related_city.longitude
|
||||
xml.georss :point,
|
||||
event.related_city.latitude,
|
||||
' ',
|
||||
event.related_city.longitude
|
||||
if event.latitude && event.longitude
|
||||
xml.georss :point, event.latitude, ' ', event.longitude
|
||||
end
|
||||
|
||||
@event = event
|
||||
|
@ -1,11 +1,12 @@
|
||||
xml.instruct!
|
||||
|
||||
xml.events do
|
||||
for event in @events
|
||||
@events.each do |event|
|
||||
xml.event do
|
||||
xml.title event.title
|
||||
xml.start_time event.start_time.strftime '%Y/%m/%d %T'
|
||||
xml.end_time event.end_time.strftime '%Y/%m/%d %T'
|
||||
xml.address event.address
|
||||
xml.city event.city
|
||||
xml.region event.related_region
|
||||
xml.locality event.locality
|
||||
|
Loading…
Reference in New Issue
Block a user