From 88429982295c2c63acb096f34ec1c376a4753bd8 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Wed, 25 Oct 2023 02:52:38 +0200 Subject: [PATCH] Render shared subscription actions in answerbox actions --- app/views/actions/_answer.html.haml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/views/actions/_answer.html.haml b/app/views/actions/_answer.html.haml index e63e452b..78b81363 100644 --- a/app/views/actions/_answer.html.haml +++ b/app/views/actions/_answer.html.haml @@ -1,13 +1,8 @@ .dropdown-menu.dropdown-menu-end{ role: :menu } - if subscribed_answer_ids&.include?(answer.id) - -# fun joke should subscribe? - %a.dropdown-item{ href: "#", data: { a_id: answer.id, action: "ab-submarine", torpedo: "no" } } - %i.fa.fa-fw.fa-anchor - = t("voc.unsubscribe") + = render "subscriptions/destroy", answer: answer - else - %a.dropdown-item{ href: "#", data: { a_id: answer.id, action: "ab-submarine", torpedo: "yes" } } - %i.fa.fa-fw.fa-anchor - = t("voc.subscribe") + = render "subscriptions/create", answer: answer - if privileged? answer.user %a.dropdown-item.text-danger{ href: "#", data: { a_id: answer.id, action: "ab-destroy" } } %i.fa.fa-fw.fa-trash-o