osem-fcy/app/views/admin/booths/_confirmed_booths.xlsx.axlsx
Rahul 8c38de6cfd add alias for booth
Booth can be replaced with any alias by replacing it in alias.en.yml. This change is introduced as some events do not use booth but uses other words such as stand.
2019-08-10 01:51:53 +05:30

29 lines
824 B
Text

# frozen_string_literal: true
wb.add_worksheet(name: "all #{(t 'booth').pluralize}") do |sheet|
bold_style = wb.styles.add_style(b: true)
wrap_text = wb.styles.add_style alignment: {wrap_text: true}
row = ["#{(t 'booth').capitalize} ID",
'Title',
'Description',
'Reasoning',
'Submitter Name',
'Submitter Relationship',
'Website Url',
'State']
sheet.add_row row, style: bold_style
@booths.confirmed.each do |booth|
row = []
row << booth.id
row << booth.title
row << booth.description
row << booth.reasoning
row << booth.submitter.name
row << booth.submitter_relationship
row << booth.website_url
row << booth.state
sheet.add_row row , style: wrap_text
sheet.column_widths 10,20,35,35,20,30,35,10
end
end