remove trailing space

This commit is contained in:
EricTYL 2020-01-20 10:25:26 +08:00
parent 7c36fc514d
commit db8b0311a6
1 changed files with 10 additions and 10 deletions

View File

@ -70,8 +70,8 @@ module Admin::JournalPapersHelper
value = {"en" => val} value = {"en" => val}
when 3 when 3
begin begin
value["zh_tw"] = val value["zh_tw"] = val
rescue rescue
value = {"zh_tw" => val} value = {"zh_tw" => val}
end end
jp.paper_title_translations = value jp.paper_title_translations = value
@ -80,7 +80,7 @@ module Admin::JournalPapersHelper
when 5 when 5
begin begin
value["zh_tw"] = val value["zh_tw"] = val
rescue rescue
value = {"zh_tw" => val} value = {"zh_tw" => val}
end end
jp.journal_title_translations = value jp.journal_title_translations = value
@ -89,7 +89,7 @@ module Admin::JournalPapersHelper
when 7 when 7
begin begin
value["zh_tw"] = val value["zh_tw"] = val
rescue rescue
value = {"zh_tw" => val} value = {"zh_tw" => val}
end end
jp.authors_translations = value jp.authors_translations = value
@ -99,7 +99,7 @@ module Admin::JournalPapersHelper
jp.language = val jp.language = val
when 10 when 10
jp.vol_no = val jp.vol_no = val
when 11 when 11
jp.issue_no = val jp.issue_no = val
when 12 when 12
jp.form_to_start = val jp.form_to_start = val
@ -111,7 +111,7 @@ module Admin::JournalPapersHelper
when 15 when 15
jls = JournalLevel.asc(:created_at).all.to_a jls = JournalLevel.asc(:created_at).all.to_a
ts = val.to_s.split(",") ts = val.to_s.split(",")
ts.each do |t| ts.each do |t|
jp.journal_level_ids << jls[t.to_i].id if t.to_s.is_i? && t.to_i < jls.count jp.journal_level_ids << jls[t.to_i].id if t.to_s.is_i? && t.to_i < jls.count
end end
when 16 when 16
@ -131,7 +131,7 @@ module Admin::JournalPapersHelper
jp.publication_date = val jp.publication_date = val
when 21 when 21
jp.url = val jp.url = val
when 22 when 22
jp.keywords = val jp.keywords = val
when 23 when 23
jp.abstract = val jp.abstract = val
@ -153,7 +153,7 @@ module Admin::JournalPapersHelper
d["name"] = role.title d["name"] = role.title
mps = role.member_profile_ids mps = role.member_profile_ids
d1 = DateTime.new(year_start,1,1,0,0) d1 = DateTime.new(year_start,1,1,0,0)
d2 = DateTime.new(year_end,12,31,23,59) d2 = DateTime.new(year_end,12,31,23,59)
d["data"] = JournalPaper.where(:publication_date.gte => d1, :publication_date.lte => d2, :member_profile_id.in => mps) rescue [] d["data"] = JournalPaper.where(:publication_date.gte => d1, :publication_date.lte => d2, :member_profile_id.in => mps) rescue []
data << d data << d
end end
@ -182,7 +182,7 @@ module Admin::JournalPapersHelper
data["data"] = {} data["data"] = {}
(year_start..year_end).each do |year| (year_start..year_end).each do |year|
d1 = DateTime.new(year,1,1,0,0) d1 = DateTime.new(year,1,1,0,0)
d2 = DateTime.new(year,12,31,23,59) d2 = DateTime.new(year,12,31,23,59)
t = jl.journal_papers.where(:publication_date.gte => d1, :publication_date.lte => d2, :member_profile_id.in => mps).count rescue 0 t = jl.journal_papers.where(:publication_date.gte => d1, :publication_date.lte => d2, :member_profile_id.in => mps).count rescue 0
data["data"][year.to_s] = t data["data"][year.to_s] = t
end end
@ -200,7 +200,7 @@ module Admin::JournalPapersHelper
when "author_type" when "author_type"
t = JournalPaper.where(:publication_date.gte => d1, :publication_date.lte => d2, :member_profile_id.in => mps, :journal_paper_author_type_ids => nil).count rescue 0 t = JournalPaper.where(:publication_date.gte => d1, :publication_date.lte => d2, :member_profile_id.in => mps, :journal_paper_author_type_ids => nil).count rescue 0
end end
data["data"][year.to_s] = t data["data"][year.to_s] = t
end end
finaldata << data finaldata << data