From 5cba3dcf8b83390ab1ab449c43a02198d3c5b7d1 Mon Sep 17 00:00:00 2001 From: bohung Date: Tue, 23 Aug 2022 16:23:25 +0800 Subject: [PATCH] Fix bug. --- app/models/journal_paper.rb | 11 +++++------ app/views/admin/journal_papers/_form.html.erb | 16 ++++++++-------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/app/models/journal_paper.rb b/app/models/journal_paper.rb index 6a43f3c..2016ea2 100644 --- a/app/models/journal_paper.rb +++ b/app/models/journal_paper.rb @@ -60,14 +60,13 @@ class JournalPaper title << self.vol_no if (self.vol_no.present? && self.vol_no != "0") title << self.issue_no if (self.issue_no.present? && self.issue_no != "0") title << "pp"+self.form_to_start.to_s+"-"+self.form_to_end.to_s if (self.form_to_start.present? && self.form_to_start != "0") - title << ( !self.journal_levels.blank? ? "(#{self.journal_levels.collect{|x| x.title}.join(', ')})" : nil) - # if !self.publication_date.nil? - # pd = self.publication_date.strftime("%Y-%m-%d").split('-') - # title << pd[0] - # end + # title << ( !self.journal_levels.blank? ? "(#{self.journal_levels.collect{|x| x.title}.join(', ')})" : nil) + if !self.publication_date.nil? + title << (self.publication_date.strftime("%b. %Y") rescue nil) + end # title << self.year title.delete(nil) - title.join(', ').gsub(', ,',',') + title.join(', ').sub(/^\\s*,/,'').gsub(/,(\s*,)+/,',').strip end def self.get_plugin_datas_to_member(datas) diff --git a/app/views/admin/journal_papers/_form.html.erb b/app/views/admin/journal_papers/_form.html.erb index 59268a3..bd346b9 100644 --- a/app/views/admin/journal_papers/_form.html.erb +++ b/app/views/admin/journal_papers/_form.html.erb @@ -155,33 +155,33 @@
- <%= f.text_field :vol_no %> + <%= f.text_field :vol_no %>
-
+
- <%= f.text_field :issue_no %> + <%= f.text_field :issue_no %>
-
+
- <%= f.text_field :form_to_start, :class=>'span1' %> ~ <%= f.text_field :form_to_end, :class=>'span1' %> + <%= f.text_field :form_to_start, :class=>'span1' %> ~ <%= f.text_field :form_to_end, :class=>'span1' %>
-
+
- <%= f.text_field :total_pages %> + <%= f.text_field :total_pages %>
-
+