From 299875a130ce40c44c2d6f8bf6cca341f2933ace Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 14 Dec 2015 16:12:52 +0800 Subject: [PATCH] small fixes for excel import --- app/helpers/admin/personal_honors_helper.rb | 14 ++++++++++---- app/views/admin/honors/excel_format.xlsx.axlsx | 4 ---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/helpers/admin/personal_honors_helper.rb b/app/helpers/admin/personal_honors_helper.rb index c266b96..025622a 100644 --- a/app/helpers/admin/personal_honors_helper.rb +++ b/app/helpers/admin/personal_honors_helper.rb @@ -29,12 +29,20 @@ module Admin::PersonalHonorsHelper when 2 value = {"en" => val} when 3 - value["zh_tw"] = val rescue value = {"zh_tw" => val} + begin + value["zh_tw"] = val + rescue + value = {"zh_tw" => val} + end honor.award_name_translations = value when 4 value = {"en" => val} when 5 - value["zh_tw"] = val rescue value = {"zh_tw" => val} + begin + value["zh_tw"] = val + rescue + value = {"zh_tw" => val} + end honor.awarding_unit_translations = value when 6 honor.year = val @@ -48,8 +56,6 @@ module Admin::PersonalHonorsHelper when 10 honor.keywords = val when 11 - # honor.abstract = val - when 12 honor.note = val end end diff --git a/app/views/admin/honors/excel_format.xlsx.axlsx b/app/views/admin/honors/excel_format.xlsx.axlsx index a1264c1..7bc4e25 100644 --- a/app/views/admin/honors/excel_format.xlsx.axlsx +++ b/app/views/admin/honors/excel_format.xlsx.axlsx @@ -59,10 +59,6 @@ wb.add_worksheet(name: "Honor") do |sheet| row1 << "textfield" row2 << "Example: keyword1,keyword2" - row << t("personal_honor.abstract") - row1 << "textarea" - row2 << "" - row << t("personal_honor.note") row1 << "textarea" row2 << ""