show expected message after add member error
This commit is contained in:
parent
4d58ff5019
commit
21a32fba6c
|
@ -38,13 +38,13 @@ class Groups::MembersController < Groups::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def add
|
def add
|
||||||
if params['user_id'].present?
|
@user = User.find_by_uname(params[:user_id])
|
||||||
@user = User.find_by_uname(params['user_id'])
|
if !@user
|
||||||
if parent.add_member(@user, params[:role])
|
flash[:error] = t("flash.collaborators.wrong_user", :uname => params[:user_id])
|
||||||
flash[:notice] = t("flash.members.successfully_added")
|
elsif parent.add_member(@user, params[:role])
|
||||||
else
|
flash[:notice] = t("flash.members.successfully_added")
|
||||||
flash[:error] = t("flash.members.error_in_adding")
|
else
|
||||||
end
|
flash[:error] = t("flash.members.error_in_adding")
|
||||||
end
|
end
|
||||||
redirect_to group_members_path(parent)
|
redirect_to group_members_path(parent)
|
||||||
end
|
end
|
||||||
|
|
|
@ -96,12 +96,13 @@ class Platforms::PlatformsController < Platforms::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_member
|
def add_member
|
||||||
if member = User.where(:id => params[:member_id]).first
|
member = User.where(:id => params[:member_id]).first
|
||||||
if @platform.add_member(member)
|
if !member
|
||||||
flash[:notice] = t('flash.platform.members.successfully_added', :name => member.uname)
|
flash[:error] = t("flash.collaborators.wrong_user", :uname => params[:member_id])
|
||||||
else
|
elsif @platform.add_member(member)
|
||||||
flash[:error] = t('flash.platform.members.error_in_adding', :name => member.uname)
|
flash[:notice] = t('flash.platform.members.successfully_added', :name => member.uname)
|
||||||
end
|
else
|
||||||
|
flash[:error] = t('flash.platform.members.error_in_adding', :name => member.uname)
|
||||||
end
|
end
|
||||||
redirect_to members_platform_url(@platform)
|
redirect_to members_platform_url(@platform)
|
||||||
end
|
end
|
||||||
|
|
|
@ -148,6 +148,7 @@ en:
|
||||||
group_already_added: Group already added
|
group_already_added: Group already added
|
||||||
successfully_added: Member %s successfully added
|
successfully_added: Member %s successfully added
|
||||||
error_in_adding: Member %s adding error
|
error_in_adding: Member %s adding error
|
||||||
|
wrong_user: User with nickname '%{uname}' not found!
|
||||||
|
|
||||||
blob:
|
blob:
|
||||||
successfully_updated: File '%{name}' successfully updated
|
successfully_updated: File '%{name}' successfully updated
|
||||||
|
|
|
@ -148,6 +148,7 @@ ru:
|
||||||
group_already_added: Группа уже добавлена
|
group_already_added: Группа уже добавлена
|
||||||
successfully_added: Участник %s успешно добавлен
|
successfully_added: Участник %s успешно добавлен
|
||||||
error_in_adding: Ошибка при добавлении участника %s
|
error_in_adding: Ошибка при добавлении участника %s
|
||||||
|
wrong_user: Пользователь с ником '%{uname}' не найден.
|
||||||
|
|
||||||
blob:
|
blob:
|
||||||
successfully_updated: Файл '%{name}' успешно обновлен
|
successfully_updated: Файл '%{name}' успешно обновлен
|
||||||
|
|
Loading…
Reference in New Issue