From 14ea611f8ce4c40647a322e0907647dd57e0d526 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 14 Oct 2013 16:40:52 +0800 Subject: [PATCH] fixed file view on server for desktop --- .../panel/personal_book/desktop/personal_books_helper.rb | 4 ++-- .../personal_conference/desktop/conference_pages_helper.rb | 4 ++-- .../personal_diploma/desktop/personal_diplomas_helper.rb | 4 ++-- .../desktop/personal_experiences_helper.rb | 4 ++-- .../panel/personal_honor/desktop/personal_honors_helper.rb | 4 ++-- .../panel/personal_journal/desktop/journal_pages_helper.rb | 6 ++++-- .../panel/personal_lab/desktop/personal_labs_helper.rb | 4 ++-- .../personal_patent/desktop/personal_patents_helper.rb | 4 ++-- .../personal_project/desktop/personal_projects_helper.rb | 4 ++-- .../personal_research/desktop/personal_researchs_helper.rb | 4 ++-- 10 files changed, 22 insertions(+), 20 deletions(-) diff --git a/vendor/built_in_modules/personal_book/app/helpers/panel/personal_book/desktop/personal_books_helper.rb b/vendor/built_in_modules/personal_book/app/helpers/panel/personal_book/desktop/personal_books_helper.rb index 8ea06188..dcea2c10 100644 --- a/vendor/built_in_modules/personal_book/app/helpers/panel/personal_book/desktop/personal_books_helper.rb +++ b/vendor/built_in_modules/personal_book/app/helpers/panel/personal_book/desktop/personal_books_helper.rb @@ -71,11 +71,11 @@ module Panel::PersonalBook::Desktop::PersonalBooksHelper def link_publication_file publication publication.writing_book_files.map{|file| link_to(image_tag(check_file_type(file.file.url)) + \ - content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"), + content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"), file.file.url, :class => "file", "target" => "_blank", - "title" => file.title_translations[I18n.locale.to_s]) + "title" => (file.title_translations[I18n.locale.to_s] rescue nil)) }.inject(:+) end diff --git a/vendor/built_in_modules/personal_conference/app/helpers/panel/personal_conference/desktop/conference_pages_helper.rb b/vendor/built_in_modules/personal_conference/app/helpers/panel/personal_conference/desktop/conference_pages_helper.rb index c09f6b2a..c1afa89a 100644 --- a/vendor/built_in_modules/personal_conference/app/helpers/panel/personal_conference/desktop/conference_pages_helper.rb +++ b/vendor/built_in_modules/personal_conference/app/helpers/panel/personal_conference/desktop/conference_pages_helper.rb @@ -71,11 +71,11 @@ module Panel::PersonalConference::Desktop::ConferencePagesHelper def link_publication_file publication publication.writing_conference_files.map{|file| link_to(image_tag(check_file_type(file.file.url)) + \ - content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"), + content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"), file.file.url, :class => "file", "target" => "_blank", - "title" => file.title_translations[I18n.locale.to_s]) + "title" => (file.title_translations[I18n.locale.to_s] rescue nil)) }.inject(:+) end diff --git a/vendor/built_in_modules/personal_diploma/app/helpers/panel/personal_diploma/desktop/personal_diplomas_helper.rb b/vendor/built_in_modules/personal_diploma/app/helpers/panel/personal_diploma/desktop/personal_diplomas_helper.rb index d7703237..181daacb 100644 --- a/vendor/built_in_modules/personal_diploma/app/helpers/panel/personal_diploma/desktop/personal_diplomas_helper.rb +++ b/vendor/built_in_modules/personal_diploma/app/helpers/panel/personal_diploma/desktop/personal_diplomas_helper.rb @@ -71,11 +71,11 @@ module Panel::PersonalDiploma::Desktop::PersonalDiplomasHelper def link_publication_file publication publication.writing_conference_files.map{|file| link_to(image_tag(check_file_type(file.file.url)) + \ - content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"), + content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"), file.file.url, :class => "file", "target" => "_blank", - "title" => file.title_translations[I18n.locale.to_s]) + "title" => (file.title_translations[I18n.locale.to_s] rescue nil)) }.inject(:+) end diff --git a/vendor/built_in_modules/personal_experience/app/helpers/panel/personal_experience/desktop/personal_experiences_helper.rb b/vendor/built_in_modules/personal_experience/app/helpers/panel/personal_experience/desktop/personal_experiences_helper.rb index cc5f9f5a..cbd39362 100644 --- a/vendor/built_in_modules/personal_experience/app/helpers/panel/personal_experience/desktop/personal_experiences_helper.rb +++ b/vendor/built_in_modules/personal_experience/app/helpers/panel/personal_experience/desktop/personal_experiences_helper.rb @@ -71,11 +71,11 @@ module Panel::PersonalExperience::Desktop::PersonalExperiencesHelper def link_publication_file publication publication.writing_conference_files.map{|file| link_to(image_tag(check_file_type(file.file.url)) + \ - content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"), + content_tag(:span, file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"), file.file.url, :class => "file", "target" => "_blank", - "title" => file.title_translations[I18n.locale.to_s]) + "title" => file.title_translations[I18n.locale.to_s] rescue nil)) }.inject(:+) end diff --git a/vendor/built_in_modules/personal_honor/app/helpers/panel/personal_honor/desktop/personal_honors_helper.rb b/vendor/built_in_modules/personal_honor/app/helpers/panel/personal_honor/desktop/personal_honors_helper.rb index b349dd8d..6505de75 100644 --- a/vendor/built_in_modules/personal_honor/app/helpers/panel/personal_honor/desktop/personal_honors_helper.rb +++ b/vendor/built_in_modules/personal_honor/app/helpers/panel/personal_honor/desktop/personal_honors_helper.rb @@ -64,11 +64,11 @@ module Panel::PersonalHonor::Desktop::PersonalHonorsHelper def link_publication_file publication publication.writing_book_files.map{|file| link_to(image_tag(check_file_type(file.file.url)) + \ - content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"), + content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"), file.file.url, :class => "file", "target" => "_blank", - "title" => file.title_translations[I18n.locale.to_s]) + "title" => (file.title_translations[I18n.locale.to_s] rescue nil)) }.inject(:+) end diff --git a/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb b/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb index 89c82dbd..785cb0ca 100644 --- a/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb +++ b/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb @@ -1,5 +1,6 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper def publication_record publication, view + content_tag :li, "item" => "true", "data-id" => publication.id.to_s, @@ -88,12 +89,13 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper def link_publication_file publication publication.writing_journal_files.map{|file| + link_to(image_tag(check_file_type(file.file.url)) + \ - content_tag(:span, file.title[I18n.locale.to_s], :class => "filetitle"), + content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"), file.file.url, :class => "file", "target" => "_blank", - "title" => file.title[I18n.locale.to_s]) + "title" => (file.title_translations[I18n.locale.to_s] rescue nil)) }.inject(:+) end diff --git a/vendor/built_in_modules/personal_lab/app/helpers/panel/personal_lab/desktop/personal_labs_helper.rb b/vendor/built_in_modules/personal_lab/app/helpers/panel/personal_lab/desktop/personal_labs_helper.rb index 05d5d66d..874d5925 100644 --- a/vendor/built_in_modules/personal_lab/app/helpers/panel/personal_lab/desktop/personal_labs_helper.rb +++ b/vendor/built_in_modules/personal_lab/app/helpers/panel/personal_lab/desktop/personal_labs_helper.rb @@ -71,11 +71,11 @@ module Panel::PersonalLab::Desktop::PersonalLabsHelper def link_publication_file publication publication.lab_files.map{|file| link_to(image_tag(check_file_type(file.file.url)) + \ - content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"), + content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"), file.file.url, :class => "file", "target" => "_blank", - "title" => file.title_translations[I18n.locale.to_s]) + "title" => (file.title_translations[I18n.locale.to_s] rescue nil)) }.inject(:+) end diff --git a/vendor/built_in_modules/personal_patent/app/helpers/panel/personal_patent/desktop/personal_patents_helper.rb b/vendor/built_in_modules/personal_patent/app/helpers/panel/personal_patent/desktop/personal_patents_helper.rb index 8a6781d4..e1e7af4d 100644 --- a/vendor/built_in_modules/personal_patent/app/helpers/panel/personal_patent/desktop/personal_patents_helper.rb +++ b/vendor/built_in_modules/personal_patent/app/helpers/panel/personal_patent/desktop/personal_patents_helper.rb @@ -71,11 +71,11 @@ module Panel::PersonalPatent::Desktop::PersonalPatentsHelper def link_publication_file publication publication.writing_patent_files.map{|file| link_to(image_tag(check_file_type(file.file.url)) + \ - content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"), + content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"), file.file.url, :class => "file", "target" => "_blank", - "title" => file.title_translations[I18n.locale.to_s]) + "title" => (file.title_translations[I18n.locale.to_s] rescue nil)) }.inject(:+) end diff --git a/vendor/built_in_modules/personal_project/app/helpers/panel/personal_project/desktop/personal_projects_helper.rb b/vendor/built_in_modules/personal_project/app/helpers/panel/personal_project/desktop/personal_projects_helper.rb index b7ae89f4..38af0aa9 100644 --- a/vendor/built_in_modules/personal_project/app/helpers/panel/personal_project/desktop/personal_projects_helper.rb +++ b/vendor/built_in_modules/personal_project/app/helpers/panel/personal_project/desktop/personal_projects_helper.rb @@ -72,11 +72,11 @@ module Panel::PersonalProject::Desktop::PersonalProjectsHelper def link_publication_file publication publication.project_files.map{|file| link_to(image_tag(check_file_type(file.file.url)) + \ - content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"), + content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"), file.file.url, :class => "file", "target" => "_blank", - "title" => file.title_translations[I18n.locale.to_s]) + "title" => (file.title_translations[I18n.locale.to_s] rescue nil)) }.inject(:+) end diff --git a/vendor/built_in_modules/personal_research/app/helpers/panel/personal_research/desktop/personal_researchs_helper.rb b/vendor/built_in_modules/personal_research/app/helpers/panel/personal_research/desktop/personal_researchs_helper.rb index 27169d89..d625779c 100644 --- a/vendor/built_in_modules/personal_research/app/helpers/panel/personal_research/desktop/personal_researchs_helper.rb +++ b/vendor/built_in_modules/personal_research/app/helpers/panel/personal_research/desktop/personal_researchs_helper.rb @@ -72,11 +72,11 @@ module Panel::PersonalResearch::Desktop::PersonalResearchsHelper def link_publication_file publication publication.research_files.map{|file| link_to(image_tag(check_file_type(file.file.url)) + \ - content_tag(:span, file.title_translations[I18n.locale.to_s], :class => "filetitle"), + content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"), file.file.url, :class => "file", "target" => "_blank", - "title" => file.title_translations[I18n.locale.to_s]) + "title" => (file.title_translations[I18n.locale.to_s] rescue nil)) }.inject(:+) end