From 2fed62454d63e8c526b6900d20dbe24738f4ea1e Mon Sep 17 00:00:00 2001 From: Arit Amana <32520970+msarit@users.noreply.github.com> Date: Tue, 24 May 2022 16:49:22 -0400 Subject: [PATCH] Reposition 'Feature Post' button on Mod Panel (#17735) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * physically move btn * fix styling * actually fix styling 😅 * remove old button * add cypress seed and specs * fix E2E seeds to fix Travis failures * refactor specs --- app/views/moderations/actions_panel.html.erb | 31 ++++--- .../articleFlows/postModerationTools.spec.js | 88 ++++++++++++++----- spec/support/seeds/seeds_e2e.rb | 20 +++++ 3 files changed, 99 insertions(+), 40 deletions(-) diff --git a/app/views/moderations/actions_panel.html.erb b/app/views/moderations/actions_panel.html.erb index e785d708d..3f7fce89d 100644 --- a/app/views/moderations/actions_panel.html.erb +++ b/app/views/moderations/actions_panel.html.erb @@ -48,6 +48,21 @@ <%= crayons_icon_tag(:checkmark, class: "vomit-checkmark", title: t("views.moderations.actions.checkmark")) %> + <% if current_user.any_admin? && @moderatable.published %> + <% @recent_featured_count = Article.where(featured: true).where("published_at > ?", 1.day.ago).size %> + + <%= @moderatable.featured ? t("views.moderations.actions.unfeature") : t("views.moderations.actions.feature") %> + +