add file upload
This commit is contained in:
parent
718b62be7f
commit
b160624e4e
|
@ -174,6 +174,21 @@ end
|
||||||
ce.text_translations = v
|
ce.text_translations = v
|
||||||
when "integer"
|
when "integer"
|
||||||
ce.number = (val.blank? ? nil : val)
|
ce.number = (val.blank? ? nil : val)
|
||||||
|
when "image"
|
||||||
|
ce.remote_image_url = val
|
||||||
|
when "file"
|
||||||
|
val.split("\;").each do |remote_file|
|
||||||
|
file = ColumnEntryFile.new
|
||||||
|
file.remote_file_url = remote_file
|
||||||
|
filename = {}
|
||||||
|
file.choose_lang.choose_lang.reject(&:empty?).each do |lang|
|
||||||
|
filename[lang] = file.file.file.filename
|
||||||
|
end
|
||||||
|
file.file_title = filename
|
||||||
|
# file.column_entry_id = ce.id
|
||||||
|
file.save
|
||||||
|
ce.column_entry_files << file
|
||||||
|
end
|
||||||
when "editor"
|
when "editor"
|
||||||
v = {}
|
v = {}
|
||||||
@site_in_use_locales.sort.each_with_index do |locale,x|
|
@site_in_use_locales.sort.each_with_index do |locale,x|
|
||||||
|
|
|
@ -31,7 +31,7 @@ wb.add_worksheet(name: "Structure") do |sheet|
|
||||||
when "image"
|
when "image"
|
||||||
row << column.title
|
row << column.title
|
||||||
row1 << column.key
|
row1 << column.key
|
||||||
row2 << "Please leave this column blank. Upload the image manually."
|
row2 << "Public URL"
|
||||||
when "date"
|
when "date"
|
||||||
row << column.title
|
row << column.title
|
||||||
row1 << column.key
|
row1 << column.key
|
||||||
|
@ -46,17 +46,17 @@ wb.add_worksheet(name: "Structure") do |sheet|
|
||||||
when "file"
|
when "file"
|
||||||
row << column.title
|
row << column.title
|
||||||
row1 << column.key
|
row1 << column.key
|
||||||
row2 << "Please leave this column blank. Upload the files manually."
|
row2 << "Separate the files by ;"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
row << t("universal_table.hashtags")
|
row << t("universal_table.hashtags")
|
||||||
row1 << "table_tags"
|
row1 << "table_tags"
|
||||||
row2 << "table_tags"
|
row2 << "Separate tags by ;"
|
||||||
|
|
||||||
row << t("universal_table.related_entries")
|
row << t("universal_table.related_entries")
|
||||||
row1 << "related_entries"
|
row1 << "related_entries"
|
||||||
row2 << "related_entries"
|
row2 << "Separate UIDs with ;"
|
||||||
|
|
||||||
sheet.add_row row, :style => heading
|
sheet.add_row row, :style => heading
|
||||||
sheet.add_row row1
|
sheet.add_row row1
|
||||||
|
|
|
@ -36,7 +36,7 @@ wb.add_worksheet(name: "Structure") do |sheet|
|
||||||
when "image"
|
when "image"
|
||||||
row << column.title
|
row << column.title
|
||||||
row1 << column.key
|
row1 << column.key
|
||||||
row2 << "Please leave this column blank. Upload the image manually."
|
row2 << "Public URL"
|
||||||
when "date"
|
when "date"
|
||||||
row << column.title
|
row << column.title
|
||||||
row1 << column.key
|
row1 << column.key
|
||||||
|
@ -48,17 +48,17 @@ wb.add_worksheet(name: "Structure") do |sheet|
|
||||||
when "file"
|
when "file"
|
||||||
row << column.title
|
row << column.title
|
||||||
row1 << column.key
|
row1 << column.key
|
||||||
row2 << "Please leave this column blank. Upload the files manually."
|
row2 << "Separate the files by ;"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
row << t("universal_table.hashtags")
|
row << t("universal_table.hashtags")
|
||||||
row1 << "table_tags"
|
row1 << "table_tags"
|
||||||
row2 << "table_tags"
|
row2 << "Separate tags by ;"
|
||||||
|
|
||||||
row << t("universal_table.related_entries")
|
row << t("universal_table.related_entries")
|
||||||
row1 << "related_entries"
|
row1 << "related_entries"
|
||||||
row2 << "related_entries"
|
row2 << "Separate UIDs with ;"
|
||||||
|
|
||||||
sheet.add_row row, :style => heading
|
sheet.add_row row, :style => heading
|
||||||
sheet.add_row row1
|
sheet.add_row row1
|
||||||
|
|
Loading…
Reference in New Issue