academic_advising/app/views/admin/academic_advisings/download_excel.xlsx.axlsx

49 lines
1.3 KiB
Plaintext
Raw Normal View History

2016-06-06 09:15:12 +00:00
# encoding: utf-8
wb = xlsx_package.workbook
@data.each_with_index do |role,idx|
data = role["data"]
wb.add_worksheet(name: role["name"] + "-" + idx.to_s) do |sheet|
heading = sheet.styles.add_style(:b => true, :locked => true)
row = ["Name"]
@site_in_use_locales.each do |locale|
2021-02-07 14:56:22 +00:00
row << t("academic_advising.award_name") + " - " + t(locale.to_s)
2016-06-06 09:15:12 +00:00
end
@site_in_use_locales.each do |locale|
2021-02-07 14:56:22 +00:00
row << t("academic_advising.awarding_unit") + " - " + t(locale.to_s)
2016-06-06 09:15:12 +00:00
end
2021-02-07 14:56:22 +00:00
row << t("academic_advising.year")
2016-06-06 09:15:12 +00:00
2021-02-07 14:56:22 +00:00
row << t("academic_advising.language")
2016-06-06 09:15:12 +00:00
2021-02-07 14:56:22 +00:00
row << t("academic_advising.academic_advising_category")
2016-06-06 09:15:12 +00:00
2021-02-07 14:56:22 +00:00
row << t("academic_advising.url")
2016-06-06 09:15:12 +00:00
2021-02-07 14:56:22 +00:00
row << t("academic_advising.keywords")
2016-06-06 09:15:12 +00:00
2021-02-07 14:56:22 +00:00
row << t("academic_advising.note")
2016-06-06 09:15:12 +00:00
sheet.add_row row, :style => heading
data.each do |hon|
row = [hon.member_profile.name]
@site_in_use_locales.each do |locale|
row << hon.award_name_translations[locale.to_s]
end
@site_in_use_locales.each do |locale|
row << hon.awarding_unit_translations[locale.to_s]
end
row << hon.year
row << hon.language
2021-02-07 14:56:22 +00:00
row << hon.academic_advising_type.title rescue ""
2016-06-06 09:15:12 +00:00
row << hon.url
row << hon.keywords
row << hon.note
sheet.add_row row
end
end
end