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