gitlab-org--gitlab-foss/app/helpers/groups_helper.rb
Rémy Coutable d26f81239a Add request access for groups
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:07:26 +02:00

26 lines
626 B
Ruby

module GroupsHelper
def can_change_group_visibility_level?(group)
can?(current_user, :change_visibility_level, group)
end
def group_icon(group)
if group.is_a?(String)
group = Group.find_by(path: group)
end
if group && group.avatar.present?
group.avatar.url
else
image_path('no_group_avatar.png')
end
end
def group_title(group, name = nil, url = nil)
full_title = link_to(simple_sanitize(group.name), group_path(group))
full_title += ' &middot; '.html_safe + link_to(simple_sanitize(name), url) if name
content_tag :span do
full_title
end
end
end