From 997c5460839bb1ea4ce510ac16f9a789184d2127 Mon Sep 17 00:00:00 2001 From: yanxd Date: Sat, 28 Dec 2013 10:48:22 +0800 Subject: [PATCH] remove html char --- app/helpers/welcome_helper.rb | 5 ++++- app/models/journal_observer.rb | 15 +++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index c39f1f543..e67726d34 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -77,7 +77,10 @@ module WelcomeHelper when 'news' , 'issue', 'message' , 'bid' , 'wiki-page' , 'document' str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url, :target => "_blank" ) when 'reply' ,'Reply', 'Memo' - str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << link_to(truncate(strip_tags(event.event_description), length: 30, omission:'...'), event.event_url, :target => "_blank" ) + str << content_tag("span", "发表了") << + content_tag("span", find_all_event_type(event)) << + ': '.html_safe << + link_to(truncate(strip_tags(event.event_description).gsub(/ /,''), length: 30, omission:'...'), event.event_url, :target => "_blank" ) when 'attachment' str << content_tag('span', '上传了') << content_tag('span', find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) << link_to((' ['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container)) else diff --git a/app/models/journal_observer.rb b/app/models/journal_observer.rb index 32d0f8d01..29a754ff9 100644 --- a/app/models/journal_observer.rb +++ b/app/models/journal_observer.rb @@ -18,15 +18,14 @@ class JournalObserver < ActiveRecord::Observer def after_create(journal) if journal.notify? && - (Setting.notified_events.include?('issue_updated') || - (Setting.notified_events.include?('issue_note_added') && journal.notes.present?) || - (Setting.notified_events.include?('issue_status_updated') && journal.new_status.present?) || - (Setting.notified_events.include?('issue_priority_updated') && journal.new_value_for('priority_id').present?) + (Setting.notified_events.include?('issue_updated') || + (Setting.notified_events.include?('issue_note_added') && journal.notes.present?) || + (Setting.notified_events.include?('issue_status_updated') && journal.new_status.present?) || + (Setting.notified_events.include?('issue_priority_updated') && journal.new_value_for('priority_id').present?) ) - ##by senluo - thread4=Thread.new do - Mailer.issue_edit(journal).deliver - end + # Thread.new do + Mailer.issue_edit(journal).deliver + # end end end end