export fix
This commit is contained in:
parent
8879598540
commit
16a3b54942
|
@ -44,9 +44,12 @@ wb.add_worksheet(name: "Structure") do |sheet|
|
|||
row1 << column.key
|
||||
row2 << "Separate the files by ;"
|
||||
|
||||
row << "#{column.title} 註解"
|
||||
row1 << column.key
|
||||
row2 << "file_title-#{locale}"
|
||||
site_in_use_locales.sort.each do |locale|
|
||||
# URL 欄位
|
||||
row << "#{column.title} (註解) - #{t(locale.to_s)}"
|
||||
row1 << column.key
|
||||
row2 << "file_title - #{locale} ;"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -102,27 +105,35 @@ wb.add_worksheet(name: "Structure") do |sheet|
|
|||
row << "#{from} ~ #{to}"
|
||||
when "file"
|
||||
file_links = []
|
||||
file_titles = []
|
||||
locale = "zh_tw"
|
||||
file_titles = {}
|
||||
site_in_use_locales.sort.each do |locale|
|
||||
file_titles[locale.to_s] = []
|
||||
end
|
||||
if column
|
||||
column.column_entry_files.desc(:sort_number).each do |entry_file|
|
||||
next unless entry_file.choose_lang_display(locale)
|
||||
# next unless entry_file.choose_lang_display(locale)
|
||||
file_links << (url + entry_file.get_link)
|
||||
|
||||
title = if entry_file.respond_to?(:file_title_translations) && entry_file.file_title_translations.is_a?(Hash)
|
||||
entry_file.file_title_translations[locale]
|
||||
elsif entry_file.file_title.is_a?(Hash)
|
||||
entry_file.file_title[locale]
|
||||
else
|
||||
entry_file.file_title
|
||||
end
|
||||
# title = if entry_file.respond_to?(:file_title_translations) && entry_file.file_title_translations.is_a?(Hash)
|
||||
# entry_file.file_title_translations[locale]
|
||||
# elsif entry_file.file_title.is_a?(Hash)
|
||||
# entry_file.file_title[locale]
|
||||
# else
|
||||
# entry_file.file_title
|
||||
# end
|
||||
|
||||
title = entry_file.file.filename.to_s if title.blank?
|
||||
file_titles << title
|
||||
# title = entry_file.file.filename.to_s if title.blank?
|
||||
# file_titles << title
|
||||
|
||||
site_in_use_locales.sort.each do |locale|
|
||||
file_titles[locale.to_s] << entry_file.file_title_translations[locale]
|
||||
end
|
||||
end
|
||||
end
|
||||
row << file_links.join(";")
|
||||
row << file_titles.join(";")
|
||||
file_titles.each_key do |locale|
|
||||
row << file_titles[locale.to_s].join(";")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue