From 7eb9f0b75e2a574c3d14b1341d7f2563445ca98d Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 16 Aug 2020 10:54:59 -0500 Subject: [PATCH] appeals: only show current appeal on appealed posts. * Only show the current pending appeal in the "This post was appealed" notice. Don't show old appeals. * Don't show both the "This post was deleted" and the "This post was appealed" notice on appealed posts. Only show the "This post was appealed" notice. * Show "no reason" if no appeal reason was given. --- app/javascript/src/styles/base/040_colors.css | 2 -- app/javascript/src/styles/specific/posts.scss | 1 - app/views/modqueue/_post.html.erb | 4 ++-- app/views/post_appeals/_reasons.html.erb | 16 +++++++++------- app/views/posts/partials/show/_notices.html.erb | 11 ++--------- 5 files changed, 13 insertions(+), 21 deletions(-) diff --git a/app/javascript/src/styles/base/040_colors.css b/app/javascript/src/styles/base/040_colors.css index 6d32823ae..227c173bf 100644 --- a/app/javascript/src/styles/base/040_colors.css +++ b/app/javascript/src/styles/base/040_colors.css @@ -107,7 +107,6 @@ --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-appealed-notice-background: #D8F2FC; --post-resized-notice-background: #EED8FC; --post-search-notice-background: #EEE; @@ -386,7 +385,6 @@ body[data-current-user-theme="dark"] { --post-flagged-notice-background: var(--red-0); --post-deleted-notice-background: var(--red-0); --post-banned-notice-background: var(--red-0); - --post-appealed-notice-background: var(--blue-0); --post-tooltip-background-color: var(--grey-3); --post-tooltip-border-color: var(--grey-4); diff --git a/app/javascript/src/styles/specific/posts.scss b/app/javascript/src/styles/specific/posts.scss index 22962fc86..2312b8476 100644 --- a/app/javascript/src/styles/specific/posts.scss +++ b/app/javascript/src/styles/specific/posts.scss @@ -269,7 +269,6 @@ div#c-posts { &.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-appealed { background: var(--post-appealed-notice-background); } &.post-notice-resized { background: var(--post-resized-notice-background); } &.post-notice-search { background: var(--post-search-notice-background); } } diff --git a/app/views/modqueue/_post.html.erb b/app/views/modqueue/_post.html.erb index ce523b029..e90967391 100644 --- a/app/views/modqueue/_post.html.erb +++ b/app/views/modqueue/_post.html.erb @@ -68,10 +68,10 @@ <% end %> - <% if (post.is_flagged? || post.is_deleted?) && post.appeals.any? %> + <% if post.is_appealed? %> Appeals - <%= render "post_appeals/reasons", appeals: post.appeals %> + <%= render "post_appeals/reasons", appeal: post.appeals.select(&:pending?).last %> <% end %> diff --git a/app/views/post_appeals/_reasons.html.erb b/app/views/post_appeals/_reasons.html.erb index b5430b2d7..9e6fb87a1 100644 --- a/app/views/post_appeals/_reasons.html.erb +++ b/app/views/post_appeals/_reasons.html.erb @@ -1,9 +1,11 @@ -