Updated Books,Conference, Journal to display properly in the frontend
This commit is contained in:
parent
b535f2cf9c
commit
d5bb2a1889
|
@ -137,7 +137,8 @@ class Admin::ImportDataController < OrbitBackendController
|
|||
title: (cp_node>"PaperTitle").text,
|
||||
conference: (cp_node>"PublishOn").text,
|
||||
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i],
|
||||
location: (cp_node>"Location").text,
|
||||
location: "#{(cp_node>"Country").text} #{(cp_node>"location").text}",
|
||||
conference_title: (cp_node>"PublishOn").text,
|
||||
remarks: (cp_node>"Remarks").text
|
||||
}
|
||||
end
|
||||
|
@ -151,6 +152,12 @@ class Admin::ImportDataController < OrbitBackendController
|
|||
else
|
||||
@conference_paper.paper_title = b[:title]
|
||||
end
|
||||
if b[:conference_title].blank?
|
||||
@conference_paper.conference_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.conference_title = b[:conference_title]
|
||||
end
|
||||
|
||||
@conference_paper.note = b[:remarks]
|
||||
I18n.locale = :en
|
||||
@conference_paper.authors = b[:author]
|
||||
|
@ -159,9 +166,17 @@ class Admin::ImportDataController < OrbitBackendController
|
|||
else
|
||||
@conference_paper.paper_title = b[:title]
|
||||
end
|
||||
if b[:conference_title].blank?
|
||||
@conference_paper.conference_title = "No Title Present"
|
||||
else
|
||||
@conference_paper.conference_title = b[:conference_title]
|
||||
end
|
||||
@conference_paper.note = b[:remarks]
|
||||
|
||||
@conference_paper.location = b[:location]
|
||||
@conference_paper.year = b[:year]
|
||||
@conference_paper.create_user_id = hash.id
|
||||
|
||||
@conference_paper.save!
|
||||
end
|
||||
else
|
||||
|
@ -209,7 +224,7 @@ class Admin::ImportDataController < OrbitBackendController
|
|||
if b[:title].blank?
|
||||
@journal_paper.paper_title = "No Title Present"
|
||||
else
|
||||
@journal_paper.paper_title = b[:title].first
|
||||
@journal_paper.paper_title = b[:title]
|
||||
end
|
||||
@journal_paper.note = b[:remarks]
|
||||
I18n.locale = :en
|
||||
|
|
|
@ -8,7 +8,7 @@ defaults: &defaults
|
|||
|
||||
development:
|
||||
<<: *defaults
|
||||
database: test_site
|
||||
database: ntu_mb_orbit_test
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -83,11 +83,12 @@ class WritingBook
|
|||
end
|
||||
|
||||
def create_link
|
||||
|
||||
title = ["\"#{self.extracted_chapters}\""]
|
||||
title << self.book_title
|
||||
title << self.publisher
|
||||
title << self.pages
|
||||
title = []
|
||||
# title = ["#{self.extracted_chapters}"] if self.extracted_chapters.present?
|
||||
title << self.paper_title if self.paper_title.present?
|
||||
title << self.book_title if self.book_title.present?
|
||||
title << self.publisher if self.publisher.present?
|
||||
title << self.pages if self.pages.present?
|
||||
# title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
|
||||
title.join(', ')
|
||||
end
|
||||
|
|
|
@ -84,12 +84,11 @@ class WritingConference
|
|||
end
|
||||
|
||||
def create_link
|
||||
|
||||
title = ["\"#{self.paper_title}\""]
|
||||
title << self.conference_title
|
||||
title << self.sponsor
|
||||
title << self.location
|
||||
title << "#{period_start_date}-#{period_end_date}"
|
||||
title = ["#{self.paper_title}"]
|
||||
title << self.conference_title if self.conference_title.present?
|
||||
title << self.sponsor if self.sponsor.present?
|
||||
title << self.location if self.location.present?
|
||||
title << "#{period_start_date}-#{period_end_date}" if (self.period_start_date.present? && self.period_end_date.present?)
|
||||
# title << "(#{self.conference_paper_types.collect{|x| x.title}.join(', ')})"
|
||||
title.join(', ')
|
||||
|
||||
|
|
|
@ -90,8 +90,8 @@ class WritingJournal
|
|||
end
|
||||
|
||||
def create_link
|
||||
title = ["\"#{self.paper_title}\""]
|
||||
title << self.journal_title
|
||||
title = ["#{self.paper_title}"]
|
||||
title << self.journal_title if self.journal_title.present?
|
||||
title.join(', ')
|
||||
title << ( !self.journal_level_types.blank? ? "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})" : nil)
|
||||
title.join(', ')
|
||||
|
|
Loading…
Reference in New Issue