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

scope_menu.rb « menus « organizations « sidebars « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 86f0a08373159dadd1657cf69e36b60c32017140 (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
# frozen_string_literal: true

module Sidebars
  module Organizations
    module Menus
      class ScopeMenu < ::Sidebars::Menu
        override :link
        def link
          organization_path(context.container)
        end

        override :title
        def title
          context.container.name
        end

        override :active_routes
        def active_routes
          { path: 'organizations/organizations#show' }
        end

        override :render?
        def render?
          true
        end

        override :extra_nav_link_html_options
        def extra_nav_link_html_options
          {
            class: 'context-header'
          }
        end

        override :serialize_as_menu_item_args
        def serialize_as_menu_item_args
          super.merge({
            title: s_('Organization|Organization overview'),
            sprite_icon: 'organization',
            super_sidebar_parent: ::Sidebars::StaticMenu,
            item_id: :organization_overview
          })
        end
      end
    end
  end
end