Module: AdminBarHelper

Included in:
Www::AdminBarController
Defined in:
app/helpers/admin_bar_helper.rb

Overview

Renders the WWW admin bar based on the apex-domain admin presence cookie set
by CRM (see AdminPresence). The bar appears anywhere this helper is mixed
in, without requiring the user to log into WWW separately — they just need
an active CRM session as an @warmlyyours.com admin.

Instance Method Summary collapse

Instance Method Details

#admin_bar_payloadHash?

Returns decoded admin presence payload.

Returns:

  • (Hash, nil)

    decoded admin presence payload



14
15
16
# File 'app/helpers/admin_bar_helper.rb', line 14

def admin_bar_payload
  @admin_bar_payload ||= AdminPresence.decode(cookies)
end

#admin_bar_visible?Boolean

Returns whether the admin bar should be shown.

Returns:

  • (Boolean)

    whether the admin bar should be shown



9
10
11
# File 'app/helpers/admin_bar_helper.rb', line 9

def admin_bar_visible?
  admin_bar_payload.present?
end