debian-mirror-gitlab/lib/sidebars/projects/menus/wiki_menu.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1 KiB
Ruby
Raw Normal View History

2021-06-08 01:23:25 +05:30
# 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
2023-05-27 22:25:52 +05:30
override :serialize_as_menu_item_args
def serialize_as_menu_item_args
super.merge({
super_sidebar_parent: ::Sidebars::Projects::SuperSidebarMenus::PlanMenu,
item_id: :project_wiki
})
end
2021-06-08 01:23:25 +05:30
end
end
end
end