forked from saurabh/personal-journal
fix for frontend
This commit is contained in:
parent
3091fc2aa2
commit
6c151f981f
|
@ -87,7 +87,7 @@ module Admin::JournalPapersHelper
|
||||||
end
|
end
|
||||||
when 14
|
when 14
|
||||||
jpts = JournalPaperType.asc(:created_at).all.to_a
|
jpts = JournalPaperType.asc(:created_at).all.to_a
|
||||||
jp.journal_paper_type = jpts[val.to_i] if val.is_i? && val.to_s.to_i < jpts.count
|
jp.journal_paper_type = jpts[val.to_i] if val.to_s.is_i? && val.to_i < jpts.count
|
||||||
when 15
|
when 15
|
||||||
jpas = JournalPaperAuthorType.asc(:created_at).all.to_a
|
jpas = JournalPaperAuthorType.asc(:created_at).all.to_a
|
||||||
ts = val.to_s.split(",")
|
ts = val.to_s.split(",")
|
||||||
|
|
|
@ -64,11 +64,42 @@ class JournalPaper
|
||||||
# pd = self.publication_date.strftime("%Y-%m-%d").split('-')
|
# pd = self.publication_date.strftime("%Y-%m-%d").split('-')
|
||||||
# title << pd[0]
|
# title << pd[0]
|
||||||
# end
|
# end
|
||||||
title << self.year
|
# title << self.year
|
||||||
title.delete(nil)
|
title.delete(nil)
|
||||||
title.join(', ').gsub(', ,',',')
|
title.join(', ').gsub(', ,',',')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.get_plugin_datas_to_member(datas)
|
||||||
|
fields_to_show = [
|
||||||
|
"year",
|
||||||
|
"paper_title"
|
||||||
|
]
|
||||||
|
|
||||||
|
pd_title = fields_to_show.collect do |t|
|
||||||
|
{
|
||||||
|
"plugin_data_title" => I18n.t("personal_journal.#{t}")
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
plugin_datas = datas.sort_for_frontend.collect do |p|
|
||||||
|
|
||||||
|
pd_data = []
|
||||||
|
fields_to_show.collect do |t|
|
||||||
|
if t == "paper_title"
|
||||||
|
pd_data << { "data_title" => "<a href='#{OrbitHelper.url_to_plugin_show(p.to_param,'personal_journal')}' target='_blank'>#{p.create_link}</a>" }
|
||||||
|
else
|
||||||
|
pd_data << { "data_title" => p.send(t) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
{
|
||||||
|
"pd_datas" => pd_data
|
||||||
|
}
|
||||||
|
|
||||||
|
end
|
||||||
|
return [pd_title,plugin_datas]
|
||||||
|
end
|
||||||
|
|
||||||
# def self.member_data
|
# def self.member_data
|
||||||
# members = MemberProfile.all
|
# members = MemberProfile.all
|
||||||
# member_data = []
|
# member_data = []
|
||||||
|
|
Loading…
Reference in New Issue