mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
31 lines
883 B
Text
31 lines
883 B
Text
# frozen_string_literal: true
|
||
|
||
wb = xlsx_package.workbook
|
||
wb.add_worksheet(name: 'registrations') do |sheet|
|
||
bold_style = wb.styles.add_style(b: true)
|
||
row = ['Attended', 'Name', 'Nickname', 'Affilιation', 'Email', 'Ticket Token']
|
||
|
||
@conference.questions.each do |question|
|
||
row << question.title
|
||
end
|
||
|
||
sheet.add_row row, :style => bold_style
|
||
|
||
@registrations.each do |registration|
|
||
row = []
|
||
row << ( registration.attended ? 'X' : '' )
|
||
row << registration.name
|
||
row << registration.nickname
|
||
row << registration.affiliation
|
||
row << registration.email
|
||
row << registration.user.physical_tickets.by_conference(@conference).first&.token
|
||
@conference.questions.each do |question|
|
||
qa = registration.qanswers.find_by(question: question)
|
||
answer = ( qa ? qa.answer.title : '' )
|
||
|
||
row << answer
|
||
end
|
||
|
||
sheet.add_row row
|
||
end
|
||
end
|