diff --git a/app/controllers/personal_conferences_controller.rb b/app/controllers/personal_conferences_controller.rb index f3fe739..648fc1e 100644 --- a/app/controllers/personal_conferences_controller.rb +++ b/app/controllers/personal_conferences_controller.rb @@ -27,26 +27,27 @@ class PersonalConferencesController < ApplicationController plugin = WritingConference.where(:is_hidden=>false).find_by(uid: params[:uid]) fields_to_show = [ - "paper_title", - "conference_title", - "paper_level", - "paper_type", - "author_name", - "authors", - "number_of_authors", - "author_type", - "year", - "language", - "isi_number", - "period_start_date", - "period_end_date", - "url", - "isbn", - "note", - "location", - "sponsor", - "file" - ] + "year", + "author_name", + "authors", + "paper_title", + "conference_title", + "location", + "period_start_date", + "period_end_date", + "paper_type", + "paper_level", + "sponsor", + "author_type", + "number_of_authors", + "abstract", + "url", + "file", + "publication_date", + "isbn", + "isi_number" , + "language" + ] {"plugin_datas"=>plugin.get_plugin_data(fields_to_show)} end diff --git a/app/models/writing_conference.rb b/app/models/writing_conference.rb index 3c1d0da..2db43f4 100644 --- a/app/models/writing_conference.rb +++ b/app/models/writing_conference.rb @@ -4,6 +4,7 @@ class WritingConference include OrbitModel::Status include OrbitTag::Taggable + include MemberHelper include Slug field :paper_title, as: :slug_title, localize: true @@ -42,17 +43,23 @@ class WritingConference def create_link title = [] + title << self.member_profile.name if self.member_profile_id.present? title << self.authors if self.authors.present? - if !self.publication_date.nil? - pd = self.publication_date.strftime("%Y-%m-%d").split('-') - title << pd[0] - end - title << self.paper_title if self.paper_title.present? title << self.conference_title if self.conference_title.present? title << self.location if self.location.present? + paper_types = ( !self.conference_paper_types.blank? ? self.conference_paper_types.collect{|x| x.title}.join(', ') : "") + paper_levels = ( !self.conference_paper_levels.blank? ? "(#{self.conference_paper_levels.collect{|x| x.title}.join(', ')})" : "") + title << paper_types + paper_levels title << "#{period_start_date}-#{period_end_date}" if (self.period_start_date.present? && self.period_end_date.present?) + + # if !self.publication_date.nil? + # pd = self.publication_date.strftime("%Y-%m-%d").split('-') + # title << pd[0] + # end + title << self.year + title.join(', ') end @@ -84,6 +91,8 @@ class WritingConference value = value.join(" / ") when "publication_date" value = self.publication_date.to_date.strftime("%Y-%m-%d") rescue "" + when "abstract" + value = nl2br(self.abstract) when "language" value = I18n.t(self.language) rescue "" when "file" diff --git a/app/views/admin/writing_conferences/_form.html.erb b/app/views/admin/writing_conferences/_form.html.erb index 1c85919..69e7ee0 100644 --- a/app/views/admin/writing_conferences/_form.html.erb +++ b/app/views/admin/writing_conferences/_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,193 +16,6 @@
- - - - - -
- - -
- -
- -
- <%= @member.name rescue ''%> - <%= f.hidden_field :member_profile_id, :value => @member.id if !@member.nil? %> -
-
- - -
- -
- <%= select_year((@writing_conference.year ? @writing_conference.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_conference[year]',:class => 'span1'} ) %> -
-
- - -
- -
- <% @paper_types.each do |paper_type| %> - <%= content_tag :label,:class => "checkbox inline" do -%> - <%= check_box_tag 'writing_conference[conference_paper_type_ids][]', paper_type.id, @writing_conference.conference_paper_type_ids.include?(paper_type.id)%> - <%= paper_type.title %> - <%= hidden_field_tag 'writing_conference[conference_paper_type_ids][]', '' %> - <% end %> - <% end %> -
-
- - -
- -
- <% @paper_levels.each do |paper_level| %> - <%= content_tag :label,:class => "checkbox inline" do -%> - <%= check_box_tag 'writing_conference[conference_paper_level_ids][]', paper_level.id, @writing_conference.conference_paper_level_ids.include?(paper_level.id)%> - <%= paper_level.title %> - <%= hidden_field_tag 'writing_conference[conference_paper_level_ids][]', '' %> - <% end %> - <% end %> -
-
- - -
- -
- <% @author_types.each do |author_type| %> - <%= content_tag :label,:class => "checkbox inline" do -%> - <%= check_box_tag 'writing_conference[conference_author_type_ids][]', author_type.id, @writing_conference.conference_author_type_ids.include?(author_type.id)%> - <%= author_type.title %> - <%= hidden_field_tag 'writing_conference[conference_author_type_ids][]', '' %> - <% end %> - <% end %> -
-
- - -
- -
- <%= f.text_field :number_of_authors, :class=>'span1' %> -
-
- - -
- -
- <%= f.datetime_picker :period_start_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %> -
-
- - -
- -
- <%= f.datetime_picker :period_end_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %> -
-
- - -
- -
- <%= f.datetime_picker :publication_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %> -
-
- - -
- -
- -
-
- - -
- -
- <%= f.text_field :isbn %> -
-
- - -
- -
- <%= f.text_field :isi_number %> -
-
- - -
- -
- <%= f.text_field :url , :class => "span6" %> -
-
- - -
- -
- <%= f.text_field :keywords, :class => "span6" %> -
-
- - -
- -
- <%= f.text_area :abstract, rows: 2, class: "input-block-level" %> -
-
- - -
- -
- <%= 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((@writing_conference.year ? @writing_conference.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_conference[year]',:class => 'span1'} ) %> +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ <%= f.datetime_picker :period_start_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %> +
+
+ + +
+ +
+ <%= f.datetime_picker :period_end_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %> +
+
+ + +
+ +
+ <% @paper_levels.each do |paper_level| %> + <%= content_tag :label,:class => "checkbox inline" do -%> + <%= check_box_tag 'writing_conference[conference_paper_level_ids][]', paper_level.id, @writing_conference.conference_paper_level_ids.include?(paper_level.id)%> + <%= paper_level.title %> + <%= hidden_field_tag 'writing_conference[conference_paper_level_ids][]', '' %> + <% end %> + <% end %> +
+
+ + +
+ +
+ <% @paper_types.each do |paper_type| %> + <%= content_tag :label,:class => "checkbox inline" do -%> + <%= check_box_tag 'writing_conference[conference_paper_type_ids][]', paper_type.id, @writing_conference.conference_paper_type_ids.include?(paper_type.id)%> + <%= paper_type.title %> + <%= hidden_field_tag 'writing_conference[conference_paper_type_ids][]', '' %> + <% end %> + <% end %> +
+
+ + +
+ +
+ <% @author_types.each do |author_type| %> + <%= content_tag :label,:class => "checkbox inline" do -%> + <%= check_box_tag 'writing_conference[conference_author_type_ids][]', author_type.id, @writing_conference.conference_author_type_ids.include?(author_type.id)%> + <%= author_type.title %> + <%= hidden_field_tag 'writing_conference[conference_author_type_ids][]', '' %> + <% end %> + <% end %> +
+
+ + +
+ +
+ <%= f.text_field :number_of_authors, :class=>'span1' %> +
+
+ + +
+ +
+ <%= f.text_field :isbn %> +
+
+ + +
+ +
+ <%= f.datetime_picker :publication_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %> +
+
+ + +
+ +
+ <%= f.text_field :isi_number %> +
+
+ + +
+ +
+ <%= f.text_field :url , :class => "span6" %> +
+
+ + +
+ +
+ <%= f.text_field :keywords, :class => "span6" %> +
+
+ + +
+ +
+ <%= f.text_area :abstract, rows: 2, class: "input-block-level" %> +
+
+ + +
+ +
+ <%= f.text_area :note, rows: 2, class: "input-block-level" %> +
+
+ +
+ + +
+ + +
+ +
+ +
+
+ +
+ +
+ diff --git a/app/views/admin/writing_conferences/_writing_conference.html.erb b/app/views/admin/writing_conferences/_writing_conference.html.erb index d4b8cfc..a1c507b 100644 --- a/app/views/admin/writing_conferences/_writing_conference.html.erb +++ b/app/views/admin/writing_conferences/_writing_conference.html.erb @@ -2,7 +2,7 @@ "> <%= writing_conference.year %> - <%= link_to writing_conference.paper_title, OrbitHelper.url_to_plugin_show(writing_conference.to_param,'personal_conference'), target: "blank"%> + <%= link_to writing_conference.create_link, OrbitHelper.url_to_plugin_show(writing_conference.to_param,'personal_conference'), target: "blank"%>