From 7ef2dacf0014b5e05c3f8ebdbc65266589152cd0 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Wed, 9 Oct 2013 05:22:04 +0000 Subject: [PATCH] Fix links in member module --- .../personal_book/app/models/writing_book.rb | 15 ++++++++------- .../app/models/writing_conference.rb | 14 ++++++-------- .../app/models/writing_journal.rb | 10 ++++++---- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/vendor/built_in_modules/personal_book/app/models/writing_book.rb b/vendor/built_in_modules/personal_book/app/models/writing_book.rb index 8e1de4963..39c81a6ff 100644 --- a/vendor/built_in_modules/personal_book/app/models/writing_book.rb +++ b/vendor/built_in_modules/personal_book/app/models/writing_book.rb @@ -83,13 +83,14 @@ class WritingBook end def create_link - - title = ["\"#{self.extracted_chapters}\""] - title << self.book_title - title << self.publisher - title << self.pages - # title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})" - title.join(', ') + 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 protected diff --git a/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb b/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb index 9031cfec7..173ec006e 100644 --- a/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb +++ b/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb @@ -84,15 +84,13 @@ 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(', ') - + title.join(', ') end protected diff --git a/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb b/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb index ac81abc06..6e810cd3c 100644 --- a/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb +++ b/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb @@ -90,11 +90,13 @@ class WritingJournal end def create_link - title = ["\"#{self.paper_title}\""] - title << self.journal_title - title.join(', ') + title = ["#{self.paper_title}"] + title << self.journal_title if self.journal_title.present? title << ( !self.journal_level_types.blank? ? "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})" : nil) - title.join(', ') + title << "Volume No: "+self.vol_no if (self.vol_no.present? && self.vol_no != "0") + title << "From Page: "+self.form_to_start if (self.form_to_start.present? && self.form_to_start != "0") + title << "To Page: "+self.form_to_end if (self.form_to_end.present? && self.form_to_end != "0") + title.join(', ') end def new_writing_journal_files=(var)