forked from e621ng/e621ng
Clarify flags from deletions in the deletion/flag log
This commit is contained in:
parent
cef4d5df1d
commit
1d09ff5440
@ -5,6 +5,7 @@ module PostFlagsHelper
|
||||
|
||||
post.flags.each do |flag|
|
||||
html << '<li>'
|
||||
html << (flag.is_deletion ? "[DELETION] " : "[FLAG] ")
|
||||
html << format_text(flag.reason, inline: true)
|
||||
|
||||
if CurrentUser.can_view_flagger_on_post?(flag)
|
||||
|
@ -17,7 +17,6 @@ class PostFlag < ApplicationRecord
|
||||
validate :validate_post
|
||||
validates_uniqueness_of :creator_id, :scope => :post_id, :on => :create, :unless => :is_deletion, :message => "have already flagged this post"
|
||||
before_save :update_post
|
||||
attr_accessor :is_deletion
|
||||
|
||||
scope :by_users, -> { where.not(creator: User.system) }
|
||||
scope :by_system, -> { where(creator: User.system) }
|
||||
|
@ -15,7 +15,7 @@
|
||||
<% if post.is_deleted? %>
|
||||
<div class="ui-corner-all ui-state-highlight notice notice-deleted">
|
||||
<% if post.flags.any? %>
|
||||
<p>This post was deleted for the following reasons: </p>
|
||||
<p>This post was deleted or flagged for the following reasons: </p>
|
||||
<%= post_flag_reasons(post) %>
|
||||
<% else %>
|
||||
<p>This post was deleted</p>
|
||||
|
@ -0,0 +1,5 @@
|
||||
class AddIsDeletionToPostFlags < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :post_flags, :is_deletion, :bool, null: false, default: false
|
||||
end
|
||||
end
|
@ -1650,7 +1650,8 @@ CREATE TABLE public.post_flags (
|
||||
reason text,
|
||||
is_resolved boolean DEFAULT false NOT NULL,
|
||||
created_at timestamp without time zone,
|
||||
updated_at timestamp without time zone
|
||||
updated_at timestamp without time zone,
|
||||
is_deletion boolean DEFAULT false NOT NULL
|
||||
);
|
||||
|
||||
|
||||
@ -5182,6 +5183,7 @@ INSERT INTO "schema_migrations" (version) VALUES
|
||||
('20190623070654'),
|
||||
('20190714122705'),
|
||||
('20190717205018'),
|
||||
('20190718201354');
|
||||
('20190718201354'),
|
||||
('20190801210547');
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user