debian-mirror-gitlab/lib/sidebars/user_settings/menus/comment_templates_menu.rb

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

43 lines
789 B
Ruby
Raw Normal View History

2023-05-27 22:25:52 +05:30
# frozen_string_literal: true
module Sidebars
module UserSettings
module Menus
2023-06-20 00:43:36 +05:30
class CommentTemplatesMenu < ::Sidebars::Menu
2023-05-27 22:25:52 +05:30
include UsersHelper
override :link
def link
2023-06-20 00:43:36 +05:30
profile_comment_templates_path
2023-05-27 22:25:52 +05:30
end
override :title
def title
2023-06-20 00:43:36 +05:30
_('Comment Templates')
2023-05-27 22:25:52 +05:30
end
override :sprite_icon
def sprite_icon
2023-07-09 08:55:56 +05:30
'comment-lines'
2023-05-27 22:25:52 +05:30
end
override :render?
def render?
!!context.current_user && saved_replies_enabled?
end
override :active_routes
def active_routes
2023-06-20 00:43:36 +05:30
{ controller: :comment_templates }
2023-05-27 22:25:52 +05:30
end
private
def current_user
context.current_user
end
end
end
end
end