Updated Books,Conference, Journal to display properly in the frontend

This commit is contained in:
saurabhbhatia 2013-09-24 15:07:49 +08:00
parent b535f2cf9c
commit d5bb2a1889
5 changed files with 31 additions and 16 deletions

View File

@ -137,7 +137,8 @@ class Admin::ImportDataController < OrbitBackendController
title: (cp_node>"PaperTitle").text, title: (cp_node>"PaperTitle").text,
conference: (cp_node>"PublishOn").text, conference: (cp_node>"PublishOn").text,
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i], 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 remarks: (cp_node>"Remarks").text
} }
end end
@ -151,6 +152,12 @@ class Admin::ImportDataController < OrbitBackendController
else else
@conference_paper.paper_title = b[:title] @conference_paper.paper_title = b[:title]
end 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.note = b[:remarks]
I18n.locale = :en I18n.locale = :en
@conference_paper.authors = b[:author] @conference_paper.authors = b[:author]
@ -159,9 +166,17 @@ class Admin::ImportDataController < OrbitBackendController
else else
@conference_paper.paper_title = b[:title] @conference_paper.paper_title = b[:title]
end 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.note = b[:remarks]
@conference_paper.location = b[:location]
@conference_paper.year = b[:year] @conference_paper.year = b[:year]
@conference_paper.create_user_id = hash.id @conference_paper.create_user_id = hash.id
@conference_paper.save! @conference_paper.save!
end end
else else
@ -209,7 +224,7 @@ class Admin::ImportDataController < OrbitBackendController
if b[:title].blank? if b[:title].blank?
@journal_paper.paper_title = "No Title Present" @journal_paper.paper_title = "No Title Present"
else else
@journal_paper.paper_title = b[:title].first @journal_paper.paper_title = b[:title]
end end
@journal_paper.note = b[:remarks] @journal_paper.note = b[:remarks]
I18n.locale = :en I18n.locale = :en

View File

@ -8,7 +8,7 @@ defaults: &defaults
development: development:
<<: *defaults <<: *defaults
database: test_site database: ntu_mb_orbit_test

View File

@ -83,11 +83,12 @@ class WritingBook
end end
def create_link def create_link
title = []
title = ["\"#{self.extracted_chapters}\""] # title = ["#{self.extracted_chapters}"] if self.extracted_chapters.present?
title << self.book_title title << self.paper_title if self.paper_title.present?
title << self.publisher title << self.book_title if self.book_title.present?
title << self.pages 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 << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
title.join(', ') title.join(', ')
end end

View File

@ -84,12 +84,11 @@ class WritingConference
end end
def create_link def create_link
title = ["#{self.paper_title}"]
title = ["\"#{self.paper_title}\""] title << self.conference_title if self.conference_title.present?
title << self.conference_title title << self.sponsor if self.sponsor.present?
title << self.sponsor title << self.location if self.location.present?
title << self.location title << "#{period_start_date}-#{period_end_date}" if (self.period_start_date.present? && self.period_end_date.present?)
title << "#{period_start_date}-#{period_end_date}"
# title << "(#{self.conference_paper_types.collect{|x| x.title}.join(', ')})" # title << "(#{self.conference_paper_types.collect{|x| x.title}.join(', ')})"
title.join(', ') title.join(', ')

View File

@ -90,8 +90,8 @@ class WritingJournal
end end
def create_link def create_link
title = ["\"#{self.paper_title}\""] title = ["#{self.paper_title}"]
title << self.journal_title title << self.journal_title if self.journal_title.present?
title.join(', ') title.join(', ')
title << ( !self.journal_level_types.blank? ? "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})" : nil) title << ( !self.journal_level_types.blank? ? "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})" : nil)
title.join(', ') title.join(', ')