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

manage_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: 7c342002c31850a7a339f9ee44f21544ea3925c8 (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 ManageMenu < ::Sidebars::Menu
        override :title
        def title
          s_('Navigation|Manage')
        end

        override :sprite_icon
        def sprite_icon
          'users'
        end

        override :pick_into_super_sidebar?
        def pick_into_super_sidebar?
          true
        end

        override :configure_menu_items
        def configure_menu_items
          add_item(
            ::Sidebars::MenuItem.new(
              title: _('Groups and projects'),
              link: groups_and_projects_organization_path(context.container),
              super_sidebar_parent: ::Sidebars::Organizations::Menus::ManageMenu,
              active_routes: { path: 'organizations/organizations#groups_and_projects' },
              item_id: :organization_groups_and_projects
            )
          )
          add_item(
            ::Sidebars::MenuItem.new(
              title: _('Users'),
              link: users_organization_path(context.container),
              super_sidebar_parent: ::Sidebars::Organizations::Menus::ManageMenu,
              active_routes: { path: 'organizations/organizations#users' },
              item_id: :organization_users
            )
          )
        end
      end
    end
  end
end