@@ -10,18 +10,6 @@ class BlogpostsController < ApplicationController
|
|||||||
def show
|
def show
|
||||||
@comment = Comment.new(blogpost: @post)
|
@comment = Comment.new(blogpost: @post)
|
||||||
@comments = @post.comments.page(params[:page])
|
@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
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="comments">
|
<div id="comments">
|
||||||
<h3><%= "#{pluralize(@comments.size, 'comment')}." %></h3>
|
<h3><%= "#{pluralize(@post.comments.size, 'comment')}." %></h3>
|
||||||
<% @comments.each do |c| %>
|
<% @comments.each do |c| %>
|
||||||
<%= render "comments/comment", c: c %>
|
<%= render "comments/comment", c: c %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user