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

View File

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