diff --git a/app/controllers/personal_honors_controller.rb b/app/controllers/personal_honors_controller.rb index 72c1e7a..5fd9ce2 100644 --- a/app/controllers/personal_honors_controller.rb +++ b/app/controllers/personal_honors_controller.rb @@ -28,11 +28,11 @@ class PersonalHonorsController < ApplicationController params = OrbitHelper.params plugin = Honor.where(:is_hidden=>false).find_by(uid: params[:uid]) fields_to_show = [ + "year", + "honor_type", "award_name", "honoree", "awarding_unit", - "year", - "honor_type", "keywords", "url", "note" diff --git a/app/models/honor.rb b/app/models/honor.rb index 1a6bd1a..96df36a 100644 --- a/app/models/honor.rb +++ b/app/models/honor.rb @@ -36,6 +36,41 @@ class Honor plugin_datas end + def self.get_plugin_datas_to_member(datas) + + fields_to_show = [ + "year", + "award_name", + "awarding_unit" + ] + + pd_title = fields_to_show.collect do |t| + { + "plugin_data_title" => I18n.t("personal_honor.#{t}") + } + end + + plugin_datas = datas.where(:is_hidden=>false).order_by(:year=>'desc').collect do |p| + + pd_data = [] + fields_to_show.collect do |t| + if t == "award_name" + pd_data << { "data_title" => "#{p.send(t)}" } + else + pd_data << { "data_title" => p.send(t) } + end + end + + { + "pd_datas" => pd_data + } + + end + + return [pd_title,plugin_datas] + + end + def get_plugin_field_data(field) case field when "honoree" diff --git a/app/views/admin/honors/_form.html.erb b/app/views/admin/honors/_form.html.erb index fcafb67..f2a3c11 100644 --- a/app/views/admin/honors/_form.html.erb +++ b/app/views/admin/honors/_form.html.erb @@ -2,6 +2,7 @@ <% content_for :page_specific_css do %> <%= stylesheet_link_tag "lib/main-forms" %> <%= stylesheet_link_tag "lib/main-list" %> + <%= stylesheet_link_tag "lib/main-form-col2" %> <% end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "lib/file-type" %> @@ -11,101 +12,6 @@
- - - - - -
- - -
- -
- -
- <%= @member.name rescue ''%> - <%= f.hidden_field :member_profile_id, :value => @member.id if !@member.nil? %> -
-
- - -
- -
- <%= select_year((@honor.year ? @honor.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'honor[year]', :class => "span1"} ) %> -
-
- - -
- -
- <%= f.select :honor_type_id, @honor_types.collect {|t| [ t.title, t.id ]} %> -
-
- - -
- -
- <%= f.text_field :url , :class => "span6" %> -
-
- - -
- -
- <%= f.text_field :keywords %> -
-
- - -
- -
- -
-
- - -
- -
- <%= f.text_area :note, rows: 2, class: "input-block-level" %> -
-
- -
- - -
-
- -
- -
-
-
- -
- -
+ + + + + +
+ + +
+ +
+ +
+ <%= @member.name rescue ''%> + <%= f.hidden_field :member_profile_id, :value => @member.id if !@member.nil? %> +
+
+ + +
+ +
+ <%= select_year((@honor.year ? @honor.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'honor[year]', :class => "span1"} ) %> +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ <%= f.select :honor_type_id, @honor_types.collect {|t| [ t.title, t.id ]} %> +
+
+ + +
+ +
+ <%= f.text_field :url , :class => "span6" %> +
+
+ + +
+ +
+ <%= f.text_field :keywords %> +
+
+ + +
+ +
+ <%= f.text_area :note, rows: 2, class: "input-block-level" %> +
+
+ +
+ + +
+
+ +
+ +
+
+
+ +
+ diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index b98684c..66603ab 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -18,7 +18,7 @@ zh_tw: vol_no : "卷數" issue_no : "期數" form_to_start : "起" - form_to_end : "訖" + form_to_end : "迄" total_pages : "總頁數" keywords : "關鍵字" abstract : "摘要" @@ -28,7 +28,7 @@ zh_tw: level_type : "期刊類別" author_type : "作者類別" from : "起" - to : "訖" + to : "迄" file : "檔案" file_name : "檔案名稱" description : "描述"