debian-mirror-gitlab/lib/sidebars/groups/menus/scope_menu.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.1 KiB
Ruby
Raw Normal View History

2021-09-30 23:02:18 +05:30
# frozen_string_literal: true
module Sidebars
module Groups
module Menus
class ScopeMenu < ::Sidebars::Menu
override :link
def link
group_path(context.group)
end
override :title
def title
context.group.name
end
override :active_routes
def active_routes
2023-05-27 22:25:52 +05:30
{ path: %w[groups#show groups#details groups#new projects#new] }
2021-09-30 23:02:18 +05:30
end
override :extra_nav_link_html_options
def extra_nav_link_html_options
2021-11-18 22:05:49 +05:30
{
class: 'context-header has-tooltip',
title: context.group.name,
data: { container: 'body', placement: 'right' }
}
2021-09-30 23:02:18 +05:30
end
override :render?
def render?
true
end
2023-05-27 22:25:52 +05:30
override :serialize_as_menu_item_args
def serialize_as_menu_item_args
super.merge({
title: _('Group overview'),
sprite_icon: 'group',
super_sidebar_parent: ::Sidebars::StaticMenu,
item_id: :group_overview
})
end
2021-09-30 23:02:18 +05:30
end
end
end
end