diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 738077fd7..8e7e883ff 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -73,29 +73,20 @@ class BoardsController < ApplicationController def show # 顶部导航 @project_menu_type = 3 - # 讨论区消息状态更新(已读和未读) - @order, @b_sort,@type = params[:order] || 1, params[:sort] || 1, params[:type] || 1 + @order, @b_sort,@type = params[:order] || 1, params[:sort] || 1, params[:type] || 1 #确定 sort_type 1升序 2 降序 if @order.to_i == @type.to_i @b_sort = @b_sort.to_i == 1 ? 2 : 1 else @b_sort = 2 end - sort_name = "updated_on" - sort_type = @b_sort == 1 ? "asc" : "desc" + # 讨论区消息状态更新(已读和未读) if @project ForgeMessage.where("user_id =? and project_id =? and viewed =?", User.current.id, @project.id, 0).update_all(:viewed => true) - # 更新@消息为已读 - # 注释掉这句是因为和上面的方法代码重复,一个类型的消息,已经更新就不需要再更新 - # @project.boards.each do |board| - # board.messages.each do |m| - # User.current.at_messages.unviewed('Message', m.id).each {|x| x.viewed!} - # end - # end elsif @course CourseMessage.where("user_id =? and course_id =? and viewed =?", User.current.id, @course.id, 0).update_all(:viewed => true) end diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index f93599ee5..0c7eb570f 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -37,6 +37,9 @@ class MessagesController < ApplicationController # Show a topic and its replies def show + # 顶部导航 + @project_menu_type = 3 + @isReply = true # page = params[:page] # # Find the page of the requested reply diff --git a/app/views/messages/_project_rereply_message.html.erb b/app/views/messages/_project_rereply_message.html.erb new file mode 100644 index 000000000..d4bb74e4c --- /dev/null +++ b/app/views/messages/_project_rereply_message.html.erb @@ -0,0 +1,23 @@ +