Class: Marty::AuthApp

Inherits:
SimpleApp show all
Defined in:
app/components/marty/auth_app.rb

Overview

Basic Marty single-page application with authentication.

Extending Marty::AuthApp

DOCFIX

Direct Known Subclasses

MainAuthApp

Instance Method Summary collapse

Methods inherited from SimpleApp

#configure, #js_component_html, #js_component_render, #main_panel_config, #menu_bar_config, #status_bar_config

Methods inherited from Netzke::Base

#root_sess

Instance Method Details

Set the Logout button if current_user is set



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/components/marty/auth_app.rb', line 11

def menu
  [].tap do |menu|
    user = Mcfly.whodunnit
    if !user.nil?
      menu << "->" << {
        text: user.name,
        tooltip: 'Current user',
        menu: user_menu,
        name: "sign_out",
      }
    else
      menu << "->" << :sign_in
    end
  end
end

#user_menuObject



27
28
29
# File 'app/components/marty/auth_app.rb', line 27

def user_menu
  [:sign_out]
end