Add status messages for blocking/unblocking users

This commit is contained in:
Karina Kwiatek 2022-06-11 23:11:40 +02:00 committed by Karina Kwiatek
parent d67ae1eb19
commit 14dfef6a52
2 changed files with 10 additions and 3 deletions

View File

@ -16,7 +16,7 @@ class Ajax::RelationshipController < AjaxController
type: params[:type]
)
@response[:success] = true
@response[:message] = t("messages.friend.create.okay")
@response[:message] = t("messages.#{params[:type]}.create.okay")
rescue Errors::Base => e
@response[:message] = t(e.locale_tag)
ensure
@ -30,7 +30,7 @@ class Ajax::RelationshipController < AjaxController
type: params[:type]
)
@response[:success] = true
@response[:message] = t("messages.friend.destroy.okay")
@response[:message] = t("messages.#{params[:type]}.destroy.okay")
rescue Errors::Base => e
@response[:message] = t(e.locale_tag)
ensure

View File

@ -72,13 +72,20 @@ en:
destroy:
nopriv: "can't delete other people's comments"
okay: "Successfully deleted comment."
friend:
follow:
create:
fail: "You are already following that user."
okay: "Successfully followed user."
destroy:
fail: "You are not following that user."
okay: "Successfully unfollowed user."
block:
create:
fail: "You are already blocking that user."
okay: "Successfully blocked user."
destroy:
fail: "You are not blocking that user."
okay: "Successfully unblocked user."
list:
create:
noname: "Please give that list a name."