summaryrefslogtreecommitdiff
path: root/app/controllers/forumthreads_controller.rb
diff options
context:
space:
mode:
authorLogan Fick <logaldeveloper@protonmail.com>2019-02-24 13:01:53 -0500
committerLogan Fick <logaldeveloper@protonmail.com>2019-02-24 13:01:53 -0500
commit32e7b99b6da9bc5397e65dc4d2a146d7d2da510f (patch)
tree52a5aa2f203653d6dbe573cb1ede477a12fc8100 /app/controllers/forumthreads_controller.rb
parent244a047cad85690a29af12c2f3d7866fe9f79e40 (diff)
parent2fe1cead68d3f66be5a9c6003990362e99bc1307 (diff)
Merged pull request #56.
Diffstat (limited to 'app/controllers/forumthreads_controller.rb')
-rw-r--r--app/controllers/forumthreads_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/forumthreads_controller.rb b/app/controllers/forumthreads_controller.rb
index d40ce58..4a3a5c1 100644
--- a/app/controllers/forumthreads_controller.rb
+++ b/app/controllers/forumthreads_controller.rb
@@ -10,6 +10,7 @@ class ForumthreadsController < ApplicationController
@threads = Forumthread.filter(current_user, params[:title].try(:slice, 0..255), params[:content].try(:slice, 0..255), params[:reply].try(:slice, 0..255), params[:label], User.find_by(ign: params[:author].to_s.strip) || params[:author], params[:query].try(:slice, 0..255), Forum.find_by(id: params[:forum]))
.page(params[:page]).per(30)
end
+
def show
if params[:reverse] == "true"
@replies = @thread.replies.order(id: :desc).page(params[:page])
@@ -72,7 +73,7 @@ class ForumthreadsController < ApplicationController
end
def destroy
- if mod? || @thread.author.is?(current_user)
+ if mod? || (@thread.author.is?(current_user) && !@thread.forum.disable_deletion)
if @thread.destroy
flash[:notice] = "Thread deleted!"
else