remove html char

This commit is contained in:
yanxd 2013-12-28 10:48:22 +08:00
parent c3cbf87b3d
commit 997c546083
2 changed files with 11 additions and 9 deletions

View File

@ -77,7 +77,10 @@ module WelcomeHelper
when 'news' , 'issue', 'message' , 'bid' , 'wiki-page' , 'document' when 'news' , 'issue', 'message' , 'bid' , 'wiki-page' , 'document'
str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ':&nbsp;'.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url, :target => "_blank" ) str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ':&nbsp;'.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url, :target => "_blank" )
when 'reply' ,'Reply', 'Memo' when 'reply' ,'Reply', 'Memo'
str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ':&nbsp;'.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)) <<
':&nbsp;'.html_safe <<
link_to(truncate(strip_tags(event.event_description).gsub(/&nbsp;/,''), length: 30, omission:'...'), event.event_url, :target => "_blank" )
when 'attachment' when 'attachment'
str << content_tag('span', '上传了') << content_tag('span', find_all_event_type(event)) << ':&nbsp;'.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) << link_to(('&nbsp;['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container)) str << content_tag('span', '上传了') << content_tag('span', find_all_event_type(event)) << ':&nbsp;'.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) << link_to(('&nbsp;['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container))
else else

View File

@ -18,15 +18,14 @@
class JournalObserver < ActiveRecord::Observer class JournalObserver < ActiveRecord::Observer
def after_create(journal) def after_create(journal)
if journal.notify? && if journal.notify? &&
(Setting.notified_events.include?('issue_updated') || (Setting.notified_events.include?('issue_updated') ||
(Setting.notified_events.include?('issue_note_added') && journal.notes.present?) || (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_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_priority_updated') && journal.new_value_for('priority_id').present?)
) )
##by senluo # Thread.new do
thread4=Thread.new do Mailer.issue_edit(journal).deliver
Mailer.issue_edit(journal).deliver # end
end
end end
end end
end end