fixes #920
This commit is contained in:
@@ -54,7 +54,7 @@ class ForumPostsController < ApplicationController
|
||||
|
||||
def destroy
|
||||
@forum_post = ForumPost.find(params[:id])
|
||||
raise User::PrivilegeError unless @forum_post.editable_by?(CurrentUser.user)
|
||||
check_privilege(@forum_post)
|
||||
@forum_post.update_column(:is_deleted, true)
|
||||
respond_with(@forum_post)
|
||||
end
|
||||
|
||||
@@ -49,6 +49,7 @@ class ForumTopicsController < ApplicationController
|
||||
@forum_topic = ForumTopic.find(params[:id])
|
||||
check_privilege(@forum_topic)
|
||||
@forum_topic.update_column(:is_deleted, true)
|
||||
flash[:notice] = "Topic deleted"
|
||||
respond_with(@forum_topic)
|
||||
end
|
||||
|
||||
@@ -56,6 +57,7 @@ class ForumTopicsController < ApplicationController
|
||||
@forum_topic = ForumTopic.find(params[:id])
|
||||
check_privilege(@forum_topic)
|
||||
@forum_topic.update_column(:is_deleted, false)
|
||||
flash[:notice] = "Topic undeleted"
|
||||
respond_with(@forum_topic)
|
||||
end
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<% if CurrentUser.is_member? && @forum_topic %>
|
||||
<li><%= link_to "Quote", new_forum_post_path(:post_id => forum_post.id), :method => :get, :remote => true %></li>
|
||||
<% end %>
|
||||
<% if CurrentUser.is_janitor? %>
|
||||
<% if CurrentUser.is_janitor? && !forum_post.is_original_post? %>
|
||||
<% if forum_post.is_deleted %>
|
||||
<li><%= link_to "Undelete", undelete_forum_post_path(forum_post.id), :method => :post, :remote => true %></li>
|
||||
<% else %>
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
<% if !@forum_topic.new_record? && @forum_topic.editable_by?(CurrentUser.user) %>
|
||||
<li><%= link_to "Edit", edit_forum_topic_path(@forum_topic) %></li>
|
||||
<% if CurrentUser.is_janitor? %>
|
||||
<li><%= link_to "Delete", forum_topic_path(@forum_topic), :remote => true, :method => :delete, :confirm => "Are you sure you want to delete this forum topic?" %></li>
|
||||
<% if @forum_topic.is_deleted? %>
|
||||
<li><%= link_to "Undelete", undelete_forum_topic_path(@forum_topic), :method => :post %></li>
|
||||
<% else %>
|
||||
<li><%= link_to "Delete", forum_topic_path(@forum_topic), :method => :delete, :confirm => "Are you sure you want to delete this forum topic?" %></li>
|
||||
<% end %>
|
||||
<% if @forum_topic.is_locked? %>
|
||||
<li><%= link_to "Unlock", forum_topic_path(@forum_topic, :forum_topic => {:is_locked => false}), :method => :put %></li>
|
||||
<% else %>
|
||||
|
||||
Reference in New Issue
Block a user