fix for import

This commit is contained in:
rulingcom 2025-08-05 18:15:07 +08:00
parent bef8995307
commit 0b1c690ecf
2 changed files with 9 additions and 3 deletions

View File

@ -145,7 +145,6 @@ end
end
def import_data_from_excel
site_in_use_locales = @site_in_use_locales.sort
workbook = RubyXL::Parser.parse(params["import_data"].tempfile)
response = {}
current_locale = I18n.locale
@ -162,8 +161,7 @@ end
uploaded_io = params[:import_data]
safe_filename = uploaded_io.original_filename.gsub(/[^0-9A-Za-z.\-_]/, '_')
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
render json: { success: false, msg: "No file uploaded." } and return
end

View File

@ -81,6 +81,7 @@
<%= f.check_box :is_searchable %> Searchable
</label>
</span>
<% if defined?(i) %>
<% if column.type == "file" || column.type == "editor" %>
<span class="link_to_show2">
<label class="checkbox inline attributes-checkbox ">
@ -88,6 +89,13 @@
</label>
</span>
<% 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]} %>
<label class="checkbox date_format inline attributes-checkbox <%= column.type == "date" || column.type == "period" ? "" : "hide" %>">
Date Format <%= f.select :date_format, select_values%>