mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-17 06:52:27 +01:00
improve RSS with project author and image + event dates image and category
This commit is contained in:
parent
7960964aed
commit
8531168ba2
@ -4,6 +4,7 @@
|
||||
|
||||
- Ability for admins to create users as organizations
|
||||
- Invoices object will contain the organization name if any (#64)
|
||||
- RSS feeds will return more data about events and projects, especially images
|
||||
|
||||
## v2.5.5 2017 May 15
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#encoding: UTF-8
|
||||
|
||||
xml.instruct! :xml, version: '1.0'
|
||||
xml.rss version: '2.0' do
|
||||
xml.rss version: '2.0', 'xmlns:xCal' => 'urn:ietf:params:xml:ns:xcal' do
|
||||
xml.channel do
|
||||
xml.title "#{t('app.public.events_list.the_fablab_s_events')} - #{@fab_name}"
|
||||
xml.description t('app.public.home.fablab_s_next_events')
|
||||
@ -12,10 +12,18 @@ xml.rss version: '2.0' do
|
||||
@events.each do |event|
|
||||
xml.item do
|
||||
xml.guid event.id
|
||||
xml.pubDate event.created_at.strftime('%F %T')
|
||||
xml.pubDate event.created_at.strftime('%FT%T%:z')
|
||||
xml.title event.name
|
||||
xml.link root_url + '#!/events/' + event.id.to_s
|
||||
xml.description event.description
|
||||
xml.xCal :dtstart do
|
||||
xml.text! event.availability.start_at.strftime('%FT%T%:z')
|
||||
end
|
||||
xml.xCal :dtend do
|
||||
xml.text! event.availability.end_at.strftime('%FT%T%:z')
|
||||
end
|
||||
xml.enclosure url: root_url + event.event_image.attachment.large.url, length: event.event_image.attachment.large.size, type: event.event_image.attachment.content_type if event.event_image
|
||||
xml.category event.category.name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -15,8 +15,9 @@ xml.rss version: '2.0' do
|
||||
xml.pubDate project.created_at.strftime('%F %T')
|
||||
xml.title project.name
|
||||
xml.link root_url + '#!/projects/' + project.slug
|
||||
xml.author project.author.first_name
|
||||
xml.author project.author.profile.full_name
|
||||
xml.description project.description
|
||||
xml.enclosure url: root_url + project.project_image.attachment.large.url, length: project.project_image.attachment.large.size, type: project.project_image.attachment.content_type if project.project_image
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user