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

wiki_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: 3980b193fd12c160860957d7cc06c7dc68cf66d3 (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
# frozen_string_literal: true

module Sidebars
  module Projects
    module Menus
      class WikiMenu < ::Sidebars::Menu
        override :link
        def link
          wiki_path(context.project.wiki)
        end

        override :extra_container_html_options
        def extra_container_html_options
          {
            class: 'shortcuts-wiki'
          }
        end

        override :title
        def title
          _('Wiki')
        end

        override :sprite_icon
        def sprite_icon
          'book'
        end

        override :render?
        def render?
          can?(context.current_user, :read_wiki, context.project)
        end

        override :active_routes
        def active_routes
          { controller: :wikis }
        end
      end
    end
  end
end