blob: d37ffadb57903b173bc4aff9d17e06b870fe3345 (
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
47
|
# frozen_string_literal: true
module Sidebars
module YourWork
module Menus
class TodosMenu < ::Sidebars::Menu
include Gitlab::Utils::StrongMemoize
override :link
def link
dashboard_todos_path
end
override :title
def title
_('To-Do List')
end
override :sprite_icon
def sprite_icon
'todo-done'
end
override :render?
def render?
!!context.current_user
end
override :active_routes
def active_routes
{ path: 'dashboard/todos#index' }
end
override :has_pill?
def has_pill?
pill_count > 0
end
override :pill_count
def pill_count
context.current_user.todos_pending_count
end
strong_memoize_attr :pill_count
end
end
end
end
|