gitlab-org--gitlab-foss/app/helpers/groups_helper.rb
Jason Hollingsworth 2f69213e3f Allow access to groups with public projects.
Fixed Group avatars to only display when user has read
permissions to at least one project in the group.
2014-02-20 09:26:38 -06:00

36 lines
861 B
Ruby

module GroupsHelper
def remove_user_from_group_message(group, user)
"Are you sure you want to remove \"#{user.name}\" from \"#{group.name}\"?"
end
def leave_group_message(group)
"Are you sure you want to leave \"#{group}\" group?"
end
def should_user_see_group_roles?(user, group)
if user
user.is_admin? || group.members.exists?(user_id: user.id)
else
false
end
end
def group_head_title
title = @group.name
title = if current_action?(:issues)
"Issues - " + title
elsif current_action?(:merge_requests)
"Merge requests - " + title
elsif current_action?(:members)
"Members - " + title
elsif current_action?(:edit)
"Settings - " + title
else
title
end
title
end
end