blob: d03abfdfb7edc51a7df2bd68f002c05bf6fb4dd9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# 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
override :active_routes
def active_routes
{ path: 'projects#show' }
end
override :extra_container_html_options
def extra_container_html_options
{
class: 'shortcuts-project'
}
end
override :extra_nav_link_html_options
def extra_nav_link_html_options
{
class: 'context-header has-tooltip',
title: context.project.name,
data: { container: 'body', placement: 'right' }
}
end
override :render?
def render?
true
end
override :serialize_as_menu_item_args
def serialize_as_menu_item_args
super.merge({
avatar: context.project.avatar_url,
entity_id: context.project.id,
super_sidebar_parent: ::Sidebars::StaticMenu,
item_id: :project_overview
})
end
end
end
end
end
|