diff --git a/app/controllers/at_controller.rb b/app/controllers/at_controller.rb index 9d7b1fb59..50fddc18e 100644 --- a/app/controllers/at_controller.rb +++ b/app/controllers/at_controller.rb @@ -136,8 +136,14 @@ class AtController < ApplicationController #Message def find_message(id) message = Message.find(id) - at_persons = message.board.messages.map(&:author) - (at_persons || []) + (find_project(message.board.project_id)||[]) + if message.board.course_id.nil? + at_persons = message.board.messages.map(&:author) + (at_persons || []) + (find_project(message.board.project_id)||[]) + else + type = 'Course' + course_id = message.board.course_id + find_at_users(type, course_id) + end end #News diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index f15114d20..67008ba1c 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -121,7 +121,7 @@ class ForumsController < ApplicationController order = "" @order_str = "" if(params[:reorder_complex]) - order = "last_replies_memos.created_at #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}" + order = "replies_count #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}" @order_str = "reorder_complex="+params[:reorder_complex] elsif(params[:reorder_popu]) order = "replies_count #{params[:reorder_popu]}" diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index c2dfdaa0c..6be6ca460 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -318,6 +318,8 @@ len = t.length; for(var i=0;i - <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> + <%= import_ke(enable_at: true, prettify: false, init_activity: true) %> <% end %> @@ -105,11 +105,18 @@
- <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %> - <%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %> - <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "grey_btn fr c_white mt10 mr5 ml10" %> - <%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'course_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %> - <% end %> +
+ <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %> + +
+
+ +
+ + +
+ <% end %> +
diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index a4b47a646..474812371 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -88,7 +88,7 @@ } } $(function() { - sd_create_editor_from_data(<%= @topic.id%>,null,"100%", "<%=@topic.class.to_s%>"); + sd_create_editor_from_data(<%= @topic.id%>,null,"100%", "<%= @topic.class.to_s %>"); showNormalImage('message_description_<%= @topic.id %>'); }); diff --git a/app/views/messages/reply.js.erb b/app/views/messages/reply.js.erb index 17a482c37..1722b0b61 100644 --- a/app/views/messages/reply.js.erb +++ b/app/views/messages/reply.js.erb @@ -1,15 +1,29 @@ -<%if @project%> -<% if params[:is_project] %> -$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/act_messages', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>"); -<% else %> -$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); -<% end %> +<% if @project %> + <% if params[:is_project] %> + $("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'projects/act_messages', + :locals => { :activity => @topic, + :user_activity_id => @user_activity_id, + :is_course => @is_course, + :is_board => @is_board}) %>"); + // ForgeActivity是具体项目的动态;UserActivity是社区的动态 + // sd_create_editor_from_data(<%#= @user_activity_id %>, "", "100%", "ForgeActivity"); + <% else %> + $("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply', + :locals => { :activity => @topic, + :user_activity_id => @user_activity_id}) %>"); -<%elsif @course%> -$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); -<%elsif @contest%> -$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/contest_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); + <% end %> +<% elsif @course %> + $("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply', + :locals => { :activity => @topic, + :user_activity_id => @user_activity_id}) %>"); +<% elsif @contest %> + $("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/contest_message_post_reply', + :locals => { :activity => @topic, + :user_activity_id => @user_activity_id}) %>"); <% elsif @org_subfield %> -$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'organizations/org_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); -<%end%> -sd_create_editor_from_data(<%= @user_activity_id %>,"","100%", "UserActivity"); + $("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'organizations/org_message_post_reply', + :locals => { :activity => @topic, + :user_activity_id => @user_activity_id}) %>"); +<% end %> +sd_create_editor_from_data(<%= @user_activity_id %>, "", "100%", "UserActivity"); \ No newline at end of file diff --git a/app/views/projects/_act_messages.html.erb b/app/views/projects/_act_messages.html.erb index 8e5aa4961..daa2aff4b 100644 --- a/app/views/projects/_act_messages.html.erb +++ b/app/views/projects/_act_messages.html.erb @@ -1,3 +1,6 @@ +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: true, prettify: false, init_activity: true) %> +<% end %>
diff --git a/app/views/users/_course_message_post_reply.html.erb b/app/views/users/_course_message_post_reply.html.erb index 0684a57da..72d7fe5b3 100644 --- a/app/views/users/_course_message_post_reply.html.erb +++ b/app/views/users/_course_message_post_reply.html.erb @@ -1,3 +1,6 @@ +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: true, prettify: false, init_activity: true) %> +<% end %> <% all_replies = Message.where("root_id = #{activity.id}").reorder("created_on desc") %> <% count = all_replies.count %> <% no_children_comments = get_no_children_comments all_replies %>