From 68744f110ecb6d94bc12c3df2a74d77af68b6d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 11 Oct 2024 17:48:52 +0200 Subject: [PATCH] Use CSS to add separators to the debates featured action Just like we do in the moderation actions displayed next to id. --- .../debates/mark_featured_action.scss | 7 ++++ .../mark_featured_action_component.html.erb | 33 ++++++++++--------- 2 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 app/assets/stylesheets/debates/mark_featured_action.scss diff --git a/app/assets/stylesheets/debates/mark_featured_action.scss b/app/assets/stylesheets/debates/mark_featured_action.scss new file mode 100644 index 000000000..f43861a6b --- /dev/null +++ b/app/assets/stylesheets/debates/mark_featured_action.scss @@ -0,0 +1,7 @@ +.debate-show .mark-featured-action { + display: inline; + + &::before { + @include vertical-separator; + } +} diff --git a/app/components/debates/mark_featured_action_component.html.erb b/app/components/debates/mark_featured_action_component.html.erb index 3eb392fcf..9e2023e42 100644 --- a/app/components/debates/mark_featured_action_component.html.erb +++ b/app/components/debates/mark_featured_action_component.html.erb @@ -1,16 +1,17 @@ - |  -<% if debate.featured? %> - <%= link_to t("admin.actions.unmark_featured").capitalize, - unmark_featured_debate_path(debate), - method: :put, - data: { confirm: t("admin.actions.confirm_action", - action: t("admin.actions.unmark_featured"), - name: debate.title) } %> -<% else %> - <%= link_to t("admin.actions.mark_featured").capitalize, - mark_featured_debate_path(debate), - method: :put, - data: { confirm: t("admin.actions.confirm_action", - action: t("admin.actions.mark_featured"), - name: debate.title) } %> -<% end %> +