From 40bdcaf16b33a28e1287f1e8301529d1c2a4a5e6 Mon Sep 17 00:00:00 2001 From: jomo Date: Thu, 2 Apr 2015 10:30:15 +0200 Subject: [PATCH] Revert "blog comment improvements" This reverts commit 320cfa56f9e051d8539e50400c3b427f54e0dd10. --- app/controllers/blogposts_controller.rb | 12 ------------ app/views/blogposts/show.html.erb | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/app/controllers/blogposts_controller.rb b/app/controllers/blogposts_controller.rb index e1fae78..79c9e5d 100644 --- a/app/controllers/blogposts_controller.rb +++ b/app/controllers/blogposts_controller.rb @@ -10,18 +10,6 @@ class BlogpostsController < ApplicationController def show @comment = Comment.new(blogpost: @post) @comments = @post.comments.page(params[:page]) - @comments = @comments.select do |c| - # shadowban april fool comments - if c.author.is?(current_user) || !["april", "hoax", "fool", "troll", "joke", "prank", "legit"].any? { |word| c.content.downcase.include? word } - true - elsif current_user && current_user.mod? - c.content = "[HIDDEN] " + c.content - true - else - false - end - end - @comments = Kaminari.paginate_array(@comments).page(params[:page]).per(25) end def new diff --git a/app/views/blogposts/show.html.erb b/app/views/blogposts/show.html.erb index dc60e66..71a4b07 100644 --- a/app/views/blogposts/show.html.erb +++ b/app/views/blogposts/show.html.erb @@ -20,7 +20,7 @@
-

<%= "#{pluralize(@comments.size, 'comment')}." %>

+

<%= "#{pluralize(@post.comments.size, 'comment')}." %>

<% @comments.each do |c| %> <%= render "comments/comment", c: c %> <% end %>