2021-06-08 01:23:25 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Sidebars
|
|
|
|
module Projects
|
|
|
|
module Menus
|
|
|
|
class ScopeMenu < ::Sidebars::Menu
|
|
|
|
override :link
|
|
|
|
def link
|
|
|
|
project_path(context.project)
|
|
|
|
end
|
|
|
|
|
|
|
|
override :title
|
|
|
|
def title
|
|
|
|
context.project.name
|
|
|
|
end
|
2021-09-04 01:27:46 +05:30
|
|
|
|
|
|
|
override :active_routes
|
|
|
|
def active_routes
|
|
|
|
{ path: 'projects#show' }
|
|
|
|
end
|
|
|
|
|
|
|
|
override :extra_container_html_options
|
|
|
|
def extra_container_html_options
|
|
|
|
{
|
|
|
|
class: 'shortcuts-project rspec-project-link'
|
|
|
|
}
|
|
|
|
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.project.name,
|
|
|
|
data: { container: 'body', placement: 'right' }
|
|
|
|
}
|
2021-09-04 01:27:46 +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: _('Project overview'),
|
|
|
|
sprite_icon: 'project',
|
|
|
|
super_sidebar_parent: ::Sidebars::StaticMenu,
|
|
|
|
item_id: :project_overview
|
|
|
|
})
|
|
|
|
end
|
2021-06-08 01:23:25 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|