Move follow/unfollow user actions

This commit is contained in:
Karina Kwiatek 2022-07-30 19:58:49 +02:00
parent e887e8c4fc
commit 91df126132
4 changed files with 6 additions and 6 deletions

View File

@ -51,7 +51,7 @@ export function userActionHandler(event: Event): void {
switch (action) {
case 'follow':
button.dataset.action = 'unfollow';
button.innerText = I18n.translate('views.actions.unfollow');
button.innerText = I18n.translate('voc.unfollow');
button.classList.remove('btn-primary');
button.classList.add('btn-default');
break;
@ -82,7 +82,7 @@ export function userActionHandler(event: Event): void {
function resetFollowButton(button: HTMLButtonElement) {
button.dataset.action = 'follow';
button.innerText = I18n.translate('views.actions.follow');
button.innerText = I18n.translate('voc.follow');
button.classList.remove('btn-default');
button.classList.add('btn-primary');
}

View File

@ -5,10 +5,10 @@
- elsif user_signed_in?
- if current_user.following? user
%button.btn.btn-primary.btn-block{ type: :button, name: 'user-action', data: { action: :unfollow, type: type, target: user.screen_name } }
= t 'views.actions.unfollow'
= t("voc.unfollow")
- else
%button.btn.btn-primary.btn-block{ type: :button, name: 'user-action', data: { action: :follow, type: type, target: user.screen_name } }
= t 'views.actions.follow'
= t("voc.follow")
.btn-group.btn-block
%button.btn.btn-light.btn-block.btn-sm.dropdown-toggle{ data: { toggle: :dropdown }, aria: { expanded: false } }
= t(".title")

View File

@ -15,8 +15,6 @@ en:
title: "List"
members: "Members"
actions:
follow: "Follow"
unfollow: "Unfollow"
list: "Manage list memberships"
sessions:
destroy: "Logout"

View File

@ -7,6 +7,7 @@ en:
confirm: "Are you sure?"
delete: "Delete"
edit: "Edit"
follow: "Follow"
load: "Load more"
login: "Sign in"
save: "Save changes"
@ -14,6 +15,7 @@ en:
report: "Report"
terms: "Terms of Service"
unblock: "Unblock"
unfollow: "Unfollow"
update: "Update"
view_in_rails_admin: "View in Rails Admin"
y: Yes