added events, confirmed events and events with comments export features with xlsx, pdf and csv format
This commit is contained in:
parent
3da3fcccbb
commit
68d447f023
14 changed files with 245 additions and 67 deletions
23
app/views/admin/events/_all_with_comments.csv.haml
Normal file
23
app/views/admin/events/_all_with_comments.csv.haml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
- headers = ['Event ID',
|
||||
'Title',
|
||||
'Abstract',
|
||||
'Start time',
|
||||
'Submitter',
|
||||
'Speaker',
|
||||
'Event Type',
|
||||
'Track',
|
||||
'Difficulty Level',
|
||||
'Room',
|
||||
'State',
|
||||
'Comments']
|
||||
= CSV.generate_line ["Events with Comments"]
|
||||
= CSV.generate_line headers
|
||||
- @events.each do |event|
|
||||
- all_comments = ''
|
||||
- event.root_comments.each do |comment|
|
||||
- all_comments << "#{comment.created_at.strftime("%Y-%m-%d")} #{comment.created_at.strftime("%I:%M%p")} #{comment.user.name}: #{comment.body}\n"
|
||||
= CSV.generate_line([event.id, event.title, event.abstract, (event.time.present? ? "#{event.time.strftime("%Y-%m-%d")} #{event.time.strftime("%I:%M%p")} " : ''),
|
||||
event.submitter.name, event.speaker_names, event.event_type.title,
|
||||
(event.track.present? ? event.track.name : ''),
|
||||
(event.difficulty_level.present? ? event.difficulty_level.title : ''),
|
||||
(event.room.present? ? event.room.name : ''), event.state, all_comments]).html_safe
|
||||
Loading…
Add table
Add a link
Reference in a new issue