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' %> -
- -
- <% end %> diff --git a/app/views/words/_new_respond.html.erb b/app/views/words/_new_respond.html.erb index 25d4b7fcf..d3f4145a8 100644 --- a/app/views/words/_new_respond.html.erb +++ b/app/views/words/_new_respond.html.erb @@ -1,9 +1,13 @@ + <%= form_tag({:controller => 'words', :action => 'create_reply'}, :remote => true) do %> -<%= text_area_tag 'user_notes', "", :class => 'noline', :style => "resize: none;", :rows => 4, :placeholder => l(:label_projects_feedback_respond_content) %> +<%= text_area_tag 'user_notes', "", :class => 'noline', + :style => "resize: none;", :rows => 4, + :placeholder => l(:label_projects_feedback_respond_content), + :maxlength => 250 %> <%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %> -<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => journal.user.id %> -<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id %> -<%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "enterprise", :style => "margin-top: 1px;"%> +<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %> +<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %> +<%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "enterprise", :style => "float: right; margin-top: 1px; margin-right: 4px;"%> <% end %> \ No newline at end of file diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb index 6d625bdc5..eb2ea7369 100644 --- a/app/views/words/create_reply.js.erb +++ b/app/views/words/create_reply.js.erb @@ -1,12 +1,14 @@ <% if @save_succ %> var pre_append = $('<%= j( render :partial => "words/journal_reply_items", - :locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm.id} + :locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm} ) %>').hide(); $('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append); pre_append.fadeIn(600); - $('#project_respond_form_<%=@jfm.m_reply_id.to_s%> textarea').val(''); + var textarea = $('#project_respond_form_<%=@jfm.m_reply_id.to_s%> textarea'); + textarea.val(''); $('#project_respond_form_<%=@jfm.m_reply_id.to_s%>').hide(); + setMaxLengthItem(pre_append.find('textarea')[0]); <% else %> alert("<%= l(:label_feedback_fail) %>"); <% end %> \ No newline at end of file diff --git a/public/stylesheets/welcome.css b/public/stylesheets/welcome.css index c3e021808..fcbe12d58 100644 --- a/public/stylesheets/welcome.css +++ b/public/stylesheets/welcome.css @@ -87,9 +87,13 @@ ul.welcome-message-list{ .welcome-message-list h3, .user-welcome-message-list h3 { border-bottom: 1.5px solid rgb(21, 165, 200); padding: 2px; - margin-left: 10px; + /*margin-left: 10px;*/ font-size: 16px; } + +.user-message-box-list { + margin-left: 6px; +} /*鍚勭鍒楄〃鏄剧ず*/ .d-p-index-box{ /*border: 1px solid #e6e6e6;*/ @@ -159,6 +163,7 @@ li { margin: 0px; padding: 0px; background-color: rgb(252, 252, 252); + margin-top: 6px; } .d-p-index-newsource li,.d-p-index-hotproject ul.d-p-projectlist li{ color: rgb(102, 102, 102); diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index 0dcca361b..25d46c7dd 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -2125,7 +2125,7 @@ ul.messages-for-user-reply li { display: none; width: 87%; margin: auto; - clear:both; + clear: both; } .outer-message-for-use p { @@ -2134,10 +2134,24 @@ ul.messages-for-user-reply li { margin-top: 5px; } -.body p { +.message-body p { margin: 0; padding: 0; margin-top: 4px; margin-left: 4px; font-size: 9pt; +} + +.message-body { + margin: 0; + padding: 0; + margin-left: 40px; +} + +.counter { + float: left; +} + +.toomuch { + color: red; } \ No newline at end of file