Commit fdb42073 authored by Alex Kalderimis's avatar Alex Kalderimis

Merge branch '335490-fj-add-scope-menu' into 'master'

Refactor group scope menu

See merge request gitlab-org/gitlab!65724
parents f9e527a1 dda2b9b4
= nav_link(path: ['groups#show', 'groups#details'], html_options: { class: 'context-header' }) do
= link_to group_path(@group), title: @group.name, data: { qa_selector: 'group_scope_link' } do
%span{ class: ['avatar-container', 'rect-avatar', 'group-avatar' , 's32'] }
= group_icon(@group, class: ['avatar', 'avatar-tile', 's32'])
%span.sidebar-context-title
= @group.name
# 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
{ path: %w[groups#show groups#details] }
end
override :extra_nav_link_html_options
def extra_nav_link_html_options
{ class: 'context-header' }
end
override :render?
def render?
true
end
end
end
end
end
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
module Sidebars module Sidebars
module Groups module Groups
class Panel < ::Sidebars::Panel class Panel < ::Sidebars::Panel
override :render_raw_scope_menu_partial override :configure_menus
def render_raw_scope_menu_partial def configure_menus
'layouts/nav/sidebar/group_scope_menu' set_scope_menu(Sidebars::Groups::Menus::ScopeMenu.new(context))
end end
override :render_raw_menus_partial override :render_raw_menus_partial
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment