diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 431577f9a..666ee9c17 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -93,7 +93,15 @@ class MessagesController < ApplicationController end call_hook(:controller_messages_new_after_save, { :params => params, :message => @message}) render_attachment_warning_if_needed(@message) - redirect_to board_message_url(@board, @message) + if params[:is_board] + if @project + redirect_to project_boards_path(@project) + elsif @course + redirect_to course_boards_path(@course) + end + else + redirect_to board_message_url(@board, @message) + end else layout_file = @project ? 'base_projects' : 'base_courses' render :action => 'new', :layout => layout_file @@ -132,7 +140,15 @@ class MessagesController < ApplicationController else #render file: 'messages#show', layout: 'base_courses' end - redirect_to board_message_url(@board, @topic, :r => @reply) + if params[:is_board] + if @project + redirect_to project_boards_path(@project) + elsif @course + redirect_to course_boards_path(@course) + end + else + redirect_to board_message_url(@board, @topic, :r => @reply) + end end @@ -150,7 +166,15 @@ class MessagesController < ApplicationController render_attachment_warning_if_needed(@message) flash[:notice] = l(:notice_successful_update) @message.reload - redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)) + if params[:is_board] + if @project + redirect_to project_boards_path(@project) + elsif @course + redirect_to course_boards_path(@course) + end + else + redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)) + end elsif request.get? respond_to do |format| format.html { @@ -172,16 +196,20 @@ class MessagesController < ApplicationController @message.destroy # modify by nwb if @project - if @message.parent - redirect_to board_message_url(@board, @message.parent, :r => r) - else + if params[:is_board] redirect_to project_boards_url(@project) + else + redirect_to board_message_url(@board, @topic, :r => @reply) end elsif @course - if @message.parent - redirect_to board_message_url(@board, @message.parent, :r => r) + if params[:is_board] + redirect_to course_boards_url(@course) else - redirect_to course_board_url(@course, @board) + if @message.parent + redirect_to board_message_url(@board, @message.parent, :r => r) + else + redirect_to course_board_url(@course, @board) + end end end end diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 3962a5b12..ce3dd2091 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -38,7 +38,7 @@ <% author = topic.author.to_s + ":" %> <%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %> -
<%= h(topic.subject) %>
+<%= h(topic.subject) %>
<% if topic.course_editable_by?(User.current) %> <%= l(:button_edit) %> @@ -56,24 +56,30 @@ ) if topic.destroyable_by?(User.current) %> --
<%= topic.content %> -
+ -
- <% end %> + + + <% end %> <%= link_to_attachments_course topic, :author => false %> + <%= l(:label_activity_time)%>: <%= format_time topic.created_on %> + <%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %> + +