diff --git a/app/controllers/admin/seminars_controller.rb b/app/controllers/admin/seminars_controller.rb index 625a307..b994219 100644 --- a/app/controllers/admin/seminars_controller.rb +++ b/app/controllers/admin/seminars_controller.rb @@ -61,7 +61,13 @@ class Admin::SeminarsController < OrbitAdminController end if @seminar.enable_summary_choice @fields << "seminar_signup_contributes.description" - @fields_translations << I18n.t("seminar_signup.description") + begin + data2 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='description'}[0] + name2 = data2['name'][I18n.locale] + @fields_translations << (name2.present? ? name2 : I18n.t("seminar_signup.description")) + rescue + @fields_translations << I18n.t("seminar_signup.description") + end @fields_values << @seminar.summary_chioices.map.with_index{|v,i| [i.to_s,{I18n.locale=>v}]}.to_h end @fields_values = @fields_values.collect.with_index{|fields_values,i| [i, fields_values.values.map{|v| v[I18n.locale]} ] }.to_h diff --git a/app/models/seminar_main.rb b/app/models/seminar_main.rb index fd1565f..cf7d3f2 100644 --- a/app/models/seminar_main.rb +++ b/app/models/seminar_main.rb @@ -15,7 +15,7 @@ class SeminarMain field :enable_summary_choice, :type => Boolean, :default => false field :summary_chioice_type, :type => String, :default => "checkbox" field :summary_chioices, :type => Array, :default => ["A. Energy Conversion","B. Biocatalysis","C. Electrocatalysis", - " D. Photocatalysis","E. Catalytic and Porous Materials", + "D. Photocatalysis","E. Catalytic and Porous Materials", "F. Environmental and Reaction Engineering","G. Industrial Applications", "H. Student Oral Presentation Contest (in English)","I. Student Poster Competition" ] diff --git a/app/views/seminars/con_upload.html.erb b/app/views/seminars/con_upload.html.erb index 9470034..d7e357b 100644 --- a/app/views/seminars/con_upload.html.erb +++ b/app/views/seminars/con_upload.html.erb @@ -6,6 +6,15 @@ @seminar = data["seminar"] @seminar_signup = data["seminar_signup"] @time_now = data["time_now"] + data1 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='title'}[0] + data2 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='description'}[0] + data3 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='file'}[0] + show1 = !(data1.disabled) rescue false + show2 = !(data2.disabled) rescue false + show3 = !(data3.disabled) rescue false + name1 = data1['name'][I18n.locale] + name2 = data2['name'][I18n.locale] + name3 = data3['name'][I18n.locale] %> <% if @seminar.contribute_start_date <= @time_now and ( @seminar.contribute_end_date.nil? or @seminar.contribute_end_date+1 >= @time_now ) %> <% begin %> @@ -19,9 +28,15 @@ - <%= t('seminar_signup.file_name') %> - <%= t('seminar_signup.file_note') %> - <%= t('seminar_signup.files') %> + <% if show1 %> + <%= name1 %> + <% end %> + <% if show2 %> + <%= name2 %> + <% end %> + <% if show3 %> + <%= name3 %> + <% end %> <%= t(:action) %>