diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index fc19ccaa0..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 @@ -109,13 +112,13 @@ module WelcomeHelper # resultSet = Memo.where('memos.parent_id IS NULL').includes(:last_reply).order('COALESCE (last_replies_memos.created_at, memos.created_at) DESC').limit(limit) # resultSet += Message.where('messages.parent_id IS NULL').includes(:last_reply).order('COALESCE (last_replies_messages.created_on, messages.created_on) DESC').limit(limit) - resultSet = Memo.where('parent_id IS NULL').order('updated_at DESC').limit(limit) - resultSet += Message.where('parent_id IS NULL').order('updated_on DESC').limit(limit) - # resultSet = resultSet.to_a + resultSet = Memo.includes(:children).where('parent_id IS NULL').order('updated_at DESC').limit(limit) + resultSet += Message.includes(:children).where('parent_id IS NULL').order('updated_on DESC').limit(limit) resultSet.sort! {|x,y| y.event_datetime <=> x.event_datetime} - # for i in 0..(resultSet.size-1) - # resultSet[i] = resultSet[i].parent if resultSet[i].parent - # end + resultSet = resultSet.to_a + for i in 0..(resultSet.size-1) + resultSet[i] = resultSet[i].children.last if resultSet[i].children.count > 0 + end resultSet.take(limit) end diff --git a/app/models/journal_observer.rb b/app/models/journal_observer.rb index 32d0f8d01..0357fb74d 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 diff --git a/app/models/journals_for_message_observer.rb b/app/models/journals_for_message_observer.rb index 8a8589c99..e5fdfb187 100644 --- a/app/models/journals_for_message_observer.rb +++ b/app/models/journals_for_message_observer.rb @@ -1,9 +1,9 @@ # Added by young class JournalsForMessageObserver < ActiveRecord::Observer - def after_create(journals_for_message) - thread4=Thread.new do - Mailer.journals_for_message_add(User.current, journals_for_message).deliver - end - end + def after_create(journals_for_message) + Thread.new do + Mailer.journals_for_message_add(User.current, journals_for_message).deliver + end + end end diff --git a/app/views/projects/_new_respond.html.erb b/app/views/projects/_new_respond.html.erb index e6b072399..da9185d0c 100644 --- a/app/views/projects/_new_respond.html.erb +++ b/app/views/projects/_new_respond.html.erb @@ -1,5 +1,9 @@ <%= form_tag({:controller => 'projects', :action => 'project_respond'}) do %> -<%= text_area_tag 'project_respond', "", :class => 'noline', :required => true, :style => "resize: none;", :rows => 6, :placeholder => l(:label_projects_feedback_respond_content) %> +<%= text_area_tag 'project_respond', "", + :class => 'noline', :required => true, + :style => "resize: none;", :rows => 6, + :placeholder => l(:label_projects_feedback_respond_content), + :maxlength => 250 %> <%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %> <%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "bid_btn"%> diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 2f0279578..85cd06eef 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -74,7 +74,11 @@ $('#' + id).val(''); } } - + + $(function(){ + $("a").attr("target", "_blank"); + }); + function showInfo(id, content) { var text = $('#' + id); if (text.val() == '') { @@ -90,16 +94,14 @@ <%= stylesheet_link_tag 'welcome' %> -