diff --git a/app/controllers/personal_researches_controller.rb b/app/controllers/personal_researches_controller.rb index 22ad2e8..6dae448 100644 --- a/app/controllers/personal_researches_controller.rb +++ b/app/controllers/personal_researches_controller.rb @@ -28,12 +28,12 @@ class PersonalResearchesController < ApplicationController params = OrbitHelper.params plugin = Research.where(:is_hidden=>false).find_by(uid: params[:uid]) fields_to_show =[ + "year", + "publish_date", "research_title", "authors", "extracted_chapters", - "year", "language", - "publish_date", "keywords", "url", "note", diff --git a/app/models/research.rb b/app/models/research.rb index a14063d..0d7c738 100644 --- a/app/models/research.rb +++ b/app/models/research.rb @@ -38,6 +38,42 @@ class Research plugin_datas end + def self.get_plugin_datas_to_member(datas) + + fields_to_show = [ + "year", + "research_title", + "publish_date", + "authors" + ] + + pd_title = fields_to_show.collect do |t| + { + "plugin_data_title" => I18n.t("personal_research.#{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 == "research_title" + 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 "language" diff --git a/app/views/admin/researchs/_form.html.erb b/app/views/admin/researchs/_form.html.erb index 353877b..a3528c1 100644 --- a/app/views/admin/researchs/_form.html.erb +++ b/app/views/admin/researchs/_form.html.erb @@ -3,6 +3,7 @@ <%= stylesheet_link_tag "lib/main-forms" %> <%= stylesheet_link_tag "lib/fileupload" %> <%= stylesheet_link_tag "lib/main-list" %> + <%= stylesheet_link_tag "lib/main-form-col2" %> <% end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "lib/bootstrap-datetimepicker" %> @@ -15,100 +16,6 @@
- - - - - -
- - -
- -
- -
- <%= @member.name rescue ''%> - <%= f.hidden_field :member_profile_id, :value => @member.id if !@member.nil? %> -
-
- - -
- -
- <%= select_year((@research.year ? @research.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'research[year]',:class => 'span1'} ) %> -
-
- - -
- -
- <%= f.datetime_picker :publish_date, :no_label => true, :format=>"yyyy/MM" %> -
-
- - -
- -
- <%= f.text_field :keywords %> -
-
- - -
- -
- -
-
- - -
- -
- <%= f.text_field :url , :class => "span6" %> -
-
- - -
- -
- <%= 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((@research.year ? @research.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'research[year]',:class => 'span1'} ) %> +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ <%= f.datetime_picker :publish_date, :no_label => true, :format=>"yyyy/MM" %> +
+
+ + +
+ +
+ <%= 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 6621eed..31a18fa 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -6,7 +6,7 @@ zh_tw: research_title : "名稱" extracted_chapters : "摘要" publishers : "Publishers" - authors : "作者" + authors : "全部作者" tags : "領域" year : "年度" language : "語言" @@ -14,7 +14,7 @@ zh_tw: vol_no : "卷數" issue_no : "期數" form_to_start : "起" - form_to_end : "訖" + form_to_end : "迄" total_pages : "總頁數" keywords : "關鍵字" abstract : "摘要" @@ -25,7 +25,7 @@ zh_tw: level_type : "期刊類別" author_type : "作者類別" from : "起" - to : "訖" + to : "迄" file : "檔案" file_name : "檔案名稱" description : "描述"