Class: Marty::AuthApp
Instance Method Summary
collapse
Methods inherited from SimpleApp
#js_component_html, #js_component_render, #main_panel_config, #menu_bar_config, #status_bar_config
#root_sess
Instance Method Details
8
9
10
11
12
13
|
# File 'app/components/marty/auth_app.rb', line 8
def configure(c)
super
enable_action_cable = Rails.application.config.marty.enable_action_cable
client_config[:marty_enable_action_cable] = enable_action_cable
end
|
38
39
40
41
42
43
44
45
|
# File 'app/components/marty/auth_app.rb', line 38
def (user)
{
text: user.name,
tooltip: 'Current user',
menu: ,
name: 'sign_out',
}
end
|
Set the Logout button if current_user is set
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'app/components/marty/auth_app.rb', line 20
def
[].tap do ||
user = Mcfly.whodunnit
if !user.nil?
<<
'->' <<
<<
(user)
else
<< '->' << :sign_in
end
end
end
|
34
35
36
|
# File 'app/components/marty/auth_app.rb', line 34
def
:notifications_window
end
|
#unread_notifications_count ⇒ Object
51
52
53
54
55
56
57
|
# File 'app/components/marty/auth_app.rb', line 51
def unread_notifications_count
user = Mcfly.whodunnit
return 0 if user.blank?
user.unread_web_notifications_count
end
|
47
48
49
|
# File 'app/components/marty/auth_app.rb', line 47
def
[:sign_out, :toggle_dark_mode]
end
|