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

View File

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

View File

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

View File

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