This commit is contained in:
BoHung Chiu 2022-08-23 18:40:15 +08:00
parent 5cba3dcf8b
commit 415f79314c
4 changed files with 22 additions and 13 deletions

View File

@ -13,8 +13,8 @@ class PersonalJournalsController < ApplicationController
journal_title journal_title
authors authors
year year
issue_no
vol_no vol_no
issue_no
level_type level_type
] ]
end end
@ -134,8 +134,7 @@ class PersonalJournalsController < ApplicationController
journal_title journal_title
vol_no vol_no
issue_no issue_no
form_to_start form_to
form_to_end
level_type level_type
paper_type paper_type
total_pages total_pages
@ -160,8 +159,7 @@ class PersonalJournalsController < ApplicationController
journal_title journal_title
vol_no vol_no
issue_no issue_no
form_to_start form_to
form_to_end
level_type level_type
paper_type paper_type
total_pages total_pages

View File

@ -57,9 +57,9 @@ class JournalPaper
title << self.authors if !self.authors.blank? title << self.authors if !self.authors.blank?
title << self.paper_title if self.paper_title.present? title << self.paper_title if self.paper_title.present?
title << self.journal_title if self.journal_title.present? title << self.journal_title if self.journal_title.present?
title << self.vol_no if (self.vol_no.present? && self.vol_no != "0") title << "vol. " + self.vol_no.strip if (self.vol_no.present? && self.vol_no != "0")
title << self.issue_no if (self.issue_no.present? && self.issue_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 << "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) # title << ( !self.journal_levels.blank? ? "(#{self.journal_levels.collect{|x| x.title}.join(', ')})" : nil)
if !self.publication_date.nil? if !self.publication_date.nil?
title << (self.publication_date.strftime("%b. %Y") rescue nil) title << (self.publication_date.strftime("%b. %Y") rescue nil)
@ -68,7 +68,13 @@ class JournalPaper
title.delete(nil) title.delete(nil)
title.join(', ').sub(/^\\s*,/,'').gsub(/,(\s*,)+/,',').strip title.join(', ').sub(/^\\s*,/,'').gsub(/,(\s*,)+/,',').strip
end end
def form_to
if (self.form_to_start.present? && self.form_to_start != "0")
self.form_to_start.to_s+"-"+self.form_to_end.to_s
else
""
end
end
def self.get_plugin_datas_to_member(datas) def self.get_plugin_datas_to_member(datas)
page = Page.where(:module => "personal_journal").first rescue nil page = Page.where(:module => "personal_journal").first rescue nil
@ -101,9 +107,14 @@ class JournalPaper
if (self.fields[t].type.to_s == "String" rescue false) if (self.fields[t].type.to_s == "String" rescue false)
fields_to_remove << t if (datas.where(t.to_sym.ne => nil).or(t.to_sym.ne => "").count == 0 rescue false) fields_to_remove << t if (datas.where(t.to_sym.ne => nil).or(t.to_sym.ne => "").count == 0 rescue false)
else else
t = "journal_paper_author_types" if t == "author_type" t2 = t
fields_to_remove << t if (datas.where(t.to_sym.ne => nil).count == 0 rescue false) case t
t = "author_type" if t == "journal_paper_author_types" when "form_to"
t2 = "form_to_start"
when "author_type"
t2 = "journal_paper_author_types"
end
fields_to_remove << t if (datas.where(t2.to_sym.ne => nil).count == 0 rescue false)
end end
pd_title << { pd_title << {
"plugin_data_title" => I18n.t("personal_journal.#{t}") "plugin_data_title" => I18n.t("personal_journal.#{t}")

View File

@ -24,7 +24,7 @@ en:
isbn : "ISSN(ISBN)" isbn : "ISSN(ISBN)"
vol_no : "Vol.No" vol_no : "Vol.No"
issue_no : "Issue.No" issue_no : "Issue.No"
form_to: "From To" form_to: "Page(s)"
form_to_start : "From" form_to_start : "From"
form_to_end : "To" form_to_end : "To"
total_pages : "Total Pages" total_pages : "Total Pages"

View File

@ -22,7 +22,7 @@ zh_tw:
isbn : "ISSN(ISBN)" isbn : "ISSN(ISBN)"
vol_no : "卷數" vol_no : "卷數"
issue_no : "期數" issue_no : "期數"
form_to: "From To" form_to: "頁碼"
form_to_start : "起頁" form_to_start : "起頁"
form_to_end : "迄頁" form_to_end : "迄頁"
total_pages : "總頁數" total_pages : "總頁數"