Welcome to mirror list, hosted at ThFree Co, Russian Federation.

scope_menu.rb « menus « projects « sidebars « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 35502c7ea09260723369ad1ac6a56b5008b7221b (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
# 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 rspec-project-link'
          }
        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
      end
    end
  end
end