fix for import
This commit is contained in:
parent
bef8995307
commit
0b1c690ecf
|
@ -145,7 +145,6 @@ end
|
||||||
end
|
end
|
||||||
|
|
||||||
def import_data_from_excel
|
def import_data_from_excel
|
||||||
site_in_use_locales = @site_in_use_locales.sort
|
|
||||||
workbook = RubyXL::Parser.parse(params["import_data"].tempfile)
|
workbook = RubyXL::Parser.parse(params["import_data"].tempfile)
|
||||||
response = {}
|
response = {}
|
||||||
current_locale = I18n.locale
|
current_locale = I18n.locale
|
||||||
|
@ -162,8 +161,7 @@ end
|
||||||
uploaded_io = params[:import_data]
|
uploaded_io = params[:import_data]
|
||||||
safe_filename = uploaded_io.original_filename.gsub(/[^0-9A-Za-z.\-_]/, '_')
|
safe_filename = uploaded_io.original_filename.gsub(/[^0-9A-Za-z.\-_]/, '_')
|
||||||
table_id = params[:universal_table_id]
|
table_id = params[:universal_table_id]
|
||||||
site_locales = @site_in_use_locales.join(":") # e.g., "en,zh"
|
site_locales = Site.first.in_use_locales.join(":") # e.g., "en,zh"
|
||||||
|
|
||||||
unless uploaded_io
|
unless uploaded_io
|
||||||
render json: { success: false, msg: "No file uploaded." } and return
|
render json: { success: false, msg: "No file uploaded." } and return
|
||||||
end
|
end
|
||||||
|
|
|
@ -81,6 +81,7 @@
|
||||||
<%= f.check_box :is_searchable %> Searchable
|
<%= f.check_box :is_searchable %> Searchable
|
||||||
</label>
|
</label>
|
||||||
</span>
|
</span>
|
||||||
|
<% if defined?(i) %>
|
||||||
<% if column.type == "file" || column.type == "editor" %>
|
<% if column.type == "file" || column.type == "editor" %>
|
||||||
<span class="link_to_show2">
|
<span class="link_to_show2">
|
||||||
<label class="checkbox inline attributes-checkbox ">
|
<label class="checkbox inline attributes-checkbox ">
|
||||||
|
@ -88,6 +89,13 @@
|
||||||
</label>
|
</label>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<span class="link_to_show2 hide">
|
||||||
|
<label class="checkbox inline attributes-checkbox ">
|
||||||
|
<%= f.check_box :is_searchable %> Searchable
|
||||||
|
</label>
|
||||||
|
</span>
|
||||||
|
<% end %>
|
||||||
<% select_values = UTable::DATE_FORMATS.collect{|ft| [ft.upcase,ft]} %>
|
<% select_values = UTable::DATE_FORMATS.collect{|ft| [ft.upcase,ft]} %>
|
||||||
<label class="checkbox date_format inline attributes-checkbox <%= column.type == "date" || column.type == "period" ? "" : "hide" %>">
|
<label class="checkbox date_format inline attributes-checkbox <%= column.type == "date" || column.type == "period" ? "" : "hide" %>">
|
||||||
Date Format <%= f.select :date_format, select_values%>
|
Date Format <%= f.select :date_format, select_values%>
|
||||||
|
|
Loading…
Reference in New Issue