Render shared subscription actions in answerbox actions

This commit is contained in:
Andreas Nedbal 2023-10-25 02:52:38 +02:00
parent 42b5b6ccc2
commit 8842998229
1 changed files with 2 additions and 7 deletions

View File

@ -1,13 +1,8 @@
.dropdown-menu.dropdown-menu-end{ role: :menu } .dropdown-menu.dropdown-menu-end{ role: :menu }
- if subscribed_answer_ids&.include?(answer.id) - if subscribed_answer_ids&.include?(answer.id)
-# fun joke should subscribe? = render "subscriptions/destroy", answer: answer
%a.dropdown-item{ href: "#", data: { a_id: answer.id, action: "ab-submarine", torpedo: "no" } }
%i.fa.fa-fw.fa-anchor
= t("voc.unsubscribe")
- else - else
%a.dropdown-item{ href: "#", data: { a_id: answer.id, action: "ab-submarine", torpedo: "yes" } } = render "subscriptions/create", answer: answer
%i.fa.fa-fw.fa-anchor
= t("voc.subscribe")
- if privileged? answer.user - if privileged? answer.user
%a.dropdown-item.text-danger{ href: "#", data: { a_id: answer.id, action: "ab-destroy" } } %a.dropdown-item.text-danger{ href: "#", data: { a_id: answer.id, action: "ab-destroy" } }
%i.fa.fa-fw.fa-trash-o %i.fa.fa-fw.fa-trash-o