Add (un)subscribing to vocabulary
This commit is contained in:
parent
cc3934b423
commit
4ba954a3cf
|
@ -29,7 +29,7 @@ export function answerboxSubscribeHandler(event: Event): void {
|
||||||
success: (data) => {
|
success: (data) => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
button.dataset.torpedo = ["yes", "no"][torpedo];
|
button.dataset.torpedo = ["yes", "no"][torpedo];
|
||||||
button.children[0].nextSibling.textContent = ' ' + (torpedo ? I18n.translate('views.actions.unsubscribe') : I18n.translate('views.actions.subscribe'));
|
button.children[0].nextSibling.textContent = ' ' + (torpedo ? I18n.translate('voc.unsubscribe') : I18n.translate('voc.subscribe'));
|
||||||
showNotification(I18n.translate(`frontend.subscription.${torpedo ? 'subscribe' : 'unsubscribe'}`));
|
showNotification(I18n.translate(`frontend.subscription.${torpedo ? 'subscribe' : 'unsubscribe'}`));
|
||||||
} else {
|
} else {
|
||||||
showErrorNotification(I18n.translate(`frontend.subscription.fail.${torpedo ? 'subscribe' : 'unsubscribe'}`));
|
showErrorNotification(I18n.translate(`frontend.subscription.fail.${torpedo ? 'subscribe' : 'unsubscribe'}`));
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
-# fun joke should subscribe?
|
-# fun joke should subscribe?
|
||||||
%a.dropdown-item{ href: "#", data: { a_id: answer.id, action: "ab-submarine", torpedo: "no" } }
|
%a.dropdown-item{ href: "#", data: { a_id: answer.id, action: "ab-submarine", torpedo: "no" } }
|
||||||
%i.fa.fa-fw.fa-anchor
|
%i.fa.fa-fw.fa-anchor
|
||||||
= t(".unsubscribe")
|
= t("voc.unsubscribe")
|
||||||
- else
|
- else
|
||||||
%a.dropdown-item{ href: "#", data: { a_id: answer.id, action: "ab-submarine", torpedo: "yes" } }
|
%a.dropdown-item{ href: "#", data: { a_id: answer.id, action: "ab-submarine", torpedo: "yes" } }
|
||||||
%i.fa.fa-fw.fa-anchor
|
%i.fa.fa-fw.fa-anchor
|
||||||
= t(".subscribe")
|
= 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
|
||||||
|
|
|
@ -71,8 +71,6 @@ en:
|
||||||
otp_attempt: "Please enter the code from your authenticator app"
|
otp_attempt: "Please enter the code from your authenticator app"
|
||||||
actions:
|
actions:
|
||||||
answer:
|
answer:
|
||||||
subscribe: "Subscribe"
|
|
||||||
unsubscribe: "Unsubscribe"
|
|
||||||
return: "Return to Inbox"
|
return: "Return to Inbox"
|
||||||
comment:
|
comment:
|
||||||
view_smiles: "View comment smiles"
|
view_smiles: "View comment smiles"
|
||||||
|
|
|
@ -14,6 +14,8 @@ en:
|
||||||
logout: "Sign out"
|
logout: "Sign out"
|
||||||
save: "Save changes"
|
save: "Save changes"
|
||||||
show_anonymous_questions: "Show all questions from this user"
|
show_anonymous_questions: "Show all questions from this user"
|
||||||
|
subscribe: "Subscribe"
|
||||||
|
unsubscribe: "Unsubscribe"
|
||||||
register: "Sign up"
|
register: "Sign up"
|
||||||
report: "Report"
|
report: "Report"
|
||||||
terms: "Terms of Service"
|
terms: "Terms of Service"
|
||||||
|
|
Loading…
Reference in New Issue