diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index bab5dfb4c..fd1266095 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -165,7 +165,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 { diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 045ff90f3..c55bb8336 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -16,7 +16,7 @@
讨论区共有<%= @topic_count %>个帖子
<% if @topics.any? %> <% @topics.each do |topic| %> -<%= h(topic.subject) %>
+ <% if topic.editable_by?(User.current) %> + <%= l(:button_edit) %> + <% end %> <% if topic.sticky? %> - <%= l(:label_board_sticky)%> + <%= l(:label_board_sticky)%> <% end %> + <%= link_to( + l(:button_delete), + {:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'}, + :method => :post, + :data => {:confirm => l(:text_are_you_sure)}, + :class => 'talk_edit fr', + :style => ' margin-right: 10px;' + ) if topic.destroyable_by?(User.current) %>讨论区共有<%= @topic_count %>个帖子
<% if @topics.any? %> <% @topics.each do |topic| %> -<%= h(topic.subject) %>
- <% if topic.sticky? %> - <%= l(:label_board_sticky)%> - <% end %> + +<%= h(topic.subject) %>
+ <% if topic.editable_by?(User.current) %> + <%= l(:button_edit) %> + <% end %> + <% if topic.sticky? %> + <%= l(:label_board_sticky)%> + <% end %> + <%= link_to( + l(:button_delete), + {:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'}, + :method => :post, + :data => {:confirm => l(:text_are_you_sure)}, + :class => 'talk_edit fr', + :style => ' margin-right: 10px;' + ) if topic.destroyable_by?(User.current) %> + -+
<%= topic.content %> -
+
+
@@ -62,6 +77,12 @@
<%= textAreailizable message,:content,:attachments => message.attachments %>
+<%= textAreailizable message,:content,:attachments => message.attachments %>
<%= textAreailizable message,:content,:attachments => message.attachments %>
+<%= textAreailizable message,:content,:attachments => message.attachments %>