mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
XML export
This commit is contained in:
parent
0d6199058f
commit
70d0091fbf
3 changed files with 43 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ class ConferenceController < ApplicationController
|
|||
def schedule
|
||||
@rooms = @conference.venue.rooms if @conference.venue
|
||||
@events = @conference.program.events
|
||||
@events_xml = @conference.program.events.scheduled.group_by{ |event| event.start_time.to_date }
|
||||
@dates = @conference.start_date..@conference.end_date
|
||||
|
||||
if @dates == Date.current
|
||||
|
|
|
|||
|
|
@ -12,6 +12,13 @@ class EventType < ActiveRecord::Base
|
|||
|
||||
LENGTH_STEP = 15
|
||||
|
||||
##
|
||||
# Return the length in timestamp format (HH:MM)
|
||||
#
|
||||
def length_timestamp
|
||||
[length / 60, length % 60].map { |t| t.to_s.rjust(2, '0') }.join(':')
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
##
|
||||
|
|
|
|||
35
app/views/conference/schedule.xml.haml
Normal file
35
app/views/conference/schedule.xml.haml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
%schedule
|
||||
%version= @conference.revision
|
||||
%conference
|
||||
%acronym= @conference.short_title
|
||||
%title= @conference.title
|
||||
%start= @conference.start_date
|
||||
%end= @conference.end_date
|
||||
%days= (@conference.end_date - @conference.start_date).to_i + 1
|
||||
%timeslot_duration= '00:15' #FIXME
|
||||
|
||||
- if @events_xml.any?
|
||||
- @events_xml.keys.each.with_index(1) do |day, index|
|
||||
%day{ date: day, index: index }
|
||||
- events_in_rooms = @events_xml[day].group_by(&:room)
|
||||
- @rooms.each do |room|
|
||||
%room{ name: room.name }
|
||||
- events_in_rooms[room].each do |event|
|
||||
%event{ guid: event.guid, id: event.id }
|
||||
%date= event.start_time.iso8601
|
||||
%start= event.start_time.strftime('%H:%M')
|
||||
%duration= event.event_type.length_timestamp
|
||||
%room= event.room.name
|
||||
%type= event.event_type.name
|
||||
%language= 'en' #FIXME
|
||||
%slug= "#{event.id} #{event.title}".parameterize
|
||||
%title= event.title
|
||||
%subtitle= event.subtitle
|
||||
%track= event.track.name if event.track
|
||||
%abstract= event.abstract
|
||||
%recording
|
||||
%license/
|
||||
%optout=false #FIXME
|
||||
%persons
|
||||
- event.speakers.uniq.each do |speaker|
|
||||
%person{ id: speaker.id }= speaker.name
|
||||
Loading…
Add table
Add a link
Reference in a new issue