2021-02-27 04:19:24 +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)
|
|
|
|
|
2021-03-08 11:19:10 +00:00
|
|
|
row = [t("personal_plugin_template.member_profile")]
|
2021-03-03 07:44:42 +00:00
|
|
|
parse_again_start
|
2021-02-27 04:19:24 +00:00
|
|
|
@site_in_use_locales.each do |locale|
|
2021-03-03 07:44:42 +00:00
|
|
|
row << t("personal_plugin_template.locale_fields") + " - " + t(locale.to_s)
|
2021-02-27 04:19:24 +00:00
|
|
|
end
|
2021-03-03 07:44:42 +00:00
|
|
|
parse_again_end
|
|
|
|
parse_again_start
|
|
|
|
row << t("personal_plugin_template.none_locale_fields")
|
|
|
|
parse_again_end
|
|
|
|
parse_again_start
|
|
|
|
row << t("personal_plugin_template.plugin_template_related.plugin_template_related_main_field")
|
|
|
|
parse_again_end
|
|
|
|
parse_again_start
|
|
|
|
row << t("personal_plugin_template.plugin_template_file")
|
2021-02-27 04:19:24 +00:00
|
|
|
@site_in_use_locales.each do |locale|
|
2021-03-03 07:44:42 +00:00
|
|
|
row << t("personal_plugin_template.plugin_template_file") + " " + t("description") + " - " + t(locale.to_s)
|
2021-02-27 04:19:24 +00:00
|
|
|
end
|
2021-03-03 07:44:42 +00:00
|
|
|
@site_in_use_locales.each do |locale|
|
|
|
|
row << t("personal_plugin_template.plugin_template_file") + " " + t("alternative") + " - " + t(locale.to_s)
|
|
|
|
end
|
|
|
|
parse_again_end
|
|
|
|
parse_again_start
|
|
|
|
row << t("personal_plugin_template.plugin_template_link")
|
|
|
|
@site_in_use_locales.each do |locale|
|
|
|
|
row << t("personal_plugin_template.plugin_template_link") + " " + t("url_alt") + " - " + t(locale.to_s)
|
|
|
|
end
|
|
|
|
parse_again_end
|
2021-02-27 04:19:24 +00:00
|
|
|
sheet.add_row row, :style => heading
|
|
|
|
|
2021-03-03 07:44:42 +00:00
|
|
|
data.each do |plugin_template|
|
|
|
|
row = [(plugin_template.member_profile.name rescue "")]
|
|
|
|
parse_again_start
|
|
|
|
@site_in_use_locales.each do |locale|
|
|
|
|
row << plugin_template.locale_fields_translations[locale.to_s]
|
|
|
|
end
|
|
|
|
parse_again_end
|
|
|
|
parse_again_start
|
|
|
|
row << plugin_template.display_field("none_locale_fields",true)
|
|
|
|
parse_again_end
|
|
|
|
parse_again_start
|
|
|
|
row << (plugin_template.plugin_template_related.plugin_template_related_main_field rescue "")
|
|
|
|
parse_again_end
|
|
|
|
parse_again_start
|
|
|
|
plugin_template_files = plugin_template.plugin_template_files.asc(:created_at)
|
|
|
|
row << plugin_template_files.collect{|f| (@host_url + f.file.url rescue nil)}.join(";")
|
|
|
|
@site_in_use_locales.each do |locale|
|
|
|
|
row << plugin_template_files.collect{|l| l.description_translations[locale]}.join(";")
|
|
|
|
end
|
2021-02-27 04:19:24 +00:00
|
|
|
@site_in_use_locales.each do |locale|
|
2021-03-03 07:44:42 +00:00
|
|
|
row << plugin_template_files.collect{|l| l.title_translations[locale]}.join(";")
|
2021-02-27 04:19:24 +00:00
|
|
|
end
|
2021-03-03 07:44:42 +00:00
|
|
|
parse_again_end
|
|
|
|
parse_again_start
|
|
|
|
plugin_template_links = plugin_template.plugin_template_links.asc(:created_at)
|
|
|
|
row << plugin_template_links.collect{|l| l.url}.join(";")
|
2021-02-27 04:19:24 +00:00
|
|
|
@site_in_use_locales.each do |locale|
|
2021-03-03 07:44:42 +00:00
|
|
|
row << plugin_template_links.collect{|l| l.title_translations[locale]}.join(";")
|
2021-02-27 04:19:24 +00:00
|
|
|
end
|
2021-03-03 07:44:42 +00:00
|
|
|
parse_again_end
|
2021-02-27 04:19:24 +00:00
|
|
|
sheet.add_row row
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|