mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
exporting events to pdf, excel, and csv format
This commit is contained in:
parent
7cc2609662
commit
3da3fcccbb
6 changed files with 139 additions and 4 deletions
|
|
@ -23,11 +23,18 @@ module Admin
|
|||
@tracks_distribution_confirmed = @conference.tracks_distribution(:confirmed)
|
||||
@event_distribution = @conference.event_distribution
|
||||
@scheduled_event_distribution = @conference.scheduled_event_distribution
|
||||
@pdf_filename = "events_for_#{@conference.short_title}.pdf"
|
||||
@file_name = "events_for_#{@conference.short_title}"
|
||||
@csv_filename = "events_for_#{@conference.short_title}.csv"
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
# Explicity call #to_json to avoid the use of EventSerializer
|
||||
format.json { render json: Event.where(state: :confirmed, program: @program).to_json }
|
||||
format.xlsx { render xlsx: 'index', filename: "#{@file_name}.xlsx" }
|
||||
format.pdf
|
||||
format.csv
|
||||
# format.csv { send_data @events, filename:"#{@file_name}.csv" }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue