From 317cfe19b4958c29898737fe40d55ea266b28e2a Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 16 Aug 2020 11:09:48 -0500 Subject: [PATCH] flags: only show current flag on flagged posts. * Only show the current pending flag on flagged posts. Don't show old flags. * Don't show both the "This post was flagged for review" and the "This post was flagged and is pending" notices. --- app/javascript/src/styles/base/040_colors.css | 2 - app/javascript/src/styles/specific/posts.scss | 1 - app/views/modqueue/_post.html.erb | 2 +- app/views/post_flags/_reasons.html.erb | 20 ++++---- .../posts/partials/show/_notices.html.erb | 49 ++++++++----------- 5 files changed, 30 insertions(+), 44 deletions(-) diff --git a/app/javascript/src/styles/base/040_colors.css b/app/javascript/src/styles/base/040_colors.css index 227c173bf..28eef86ec 100644 --- a/app/javascript/src/styles/base/040_colors.css +++ b/app/javascript/src/styles/base/040_colors.css @@ -104,7 +104,6 @@ --post-parent-notice-background: var(--success-background-color); --post-child-notice-background: var(--warning-background-color); --post-pending-notice-background: #D8D8FC; - --post-flagged-notice-background: var(--error-background-color); --post-banned-notice-background: var(--error-background-color); --post-deleted-notice-background: var(--error-background-color); --post-resized-notice-background: #EED8FC; @@ -382,7 +381,6 @@ body[data-current-user-theme="dark"] { --post-parent-notice-background: var(--green-0); --post-resized-notice-background: var(--purple-0); --post-pending-notice-background: var(--indigo-0); - --post-flagged-notice-background: var(--red-0); --post-deleted-notice-background: var(--red-0); --post-banned-notice-background: var(--red-0); diff --git a/app/javascript/src/styles/specific/posts.scss b/app/javascript/src/styles/specific/posts.scss index 2312b8476..9540eb0fc 100644 --- a/app/javascript/src/styles/specific/posts.scss +++ b/app/javascript/src/styles/specific/posts.scss @@ -266,7 +266,6 @@ div#c-posts { &.post-notice-parent { background: var(--post-parent-notice-background); } &.post-notice-child { background: var(--post-child-notice-background); } &.post-notice-pending { background: var(--post-pending-notice-background); } - &.post-notice-flagged { background: var(--post-flagged-notice-background); } &.post-notice-banned { background: var(--post-banned-notice-background); } &.post-notice-deleted { background: var(--post-deleted-notice-background); } &.post-notice-resized { background: var(--post-resized-notice-background); } diff --git a/app/views/modqueue/_post.html.erb b/app/views/modqueue/_post.html.erb index e90967391..242d7f550 100644 --- a/app/views/modqueue/_post.html.erb +++ b/app/views/modqueue/_post.html.erb @@ -64,7 +64,7 @@ <% if post.is_flagged? %> Flagged - <%= render "post_flags/reasons", flags: post.flags %> + <%= render "post_flags/reasons", flag: post.flags.select(&:pending?).last %> <% end %> diff --git a/app/views/post_flags/_reasons.html.erb b/app/views/post_flags/_reasons.html.erb index e0664076d..e9f8f1327 100644 --- a/app/views/post_flags/_reasons.html.erb +++ b/app/views/post_flags/_reasons.html.erb @@ -1,13 +1,11 @@ -