Class: ActiveAdminPrism::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/active_admin_prism/configuration.rb

Overview

Per-feature toggles, so a host can turn off individual pieces of the theme without forking it. Every flag defaults to the theme's normal, fully-on behavior — an app that never touches this class gets exactly what it got before this class existed.

ActiveAdminPrism.configure do |config|
config.sidebar = false               # keep AA's stock top nav
config.colorize_action_icons = false # plain text View/Edit/Delete
config.flash_auto_dismiss_seconds = 8
end

sidebar and colorize_action_icons are pure server-side toggles (they just change what Ruby renders). sidebar_footer is server-side for whether the sidebar renders its own footer, plus a body class (like styled_confirms/collapsible_filters) so the CSS knows whether to keep hiding ActiveAdmin's original #footer. The flash_* flags are read by the client-side prism.js via data attributes on ".flashes". See lib/active_admin/views/flash_messages.rb for all of the body class/data-attribute rendering.

Instance Attribute Summary collapse



162
163
164
# File 'lib/active_admin_prism/configuration.rb', line 162

def select2
  @select2
end

Whether ActiveAdminPrism.enable! swaps ActiveAdmin's top nav for the Prism sidebar. Set to false to keep AA's stock header/TabbedNavigation while still getting the rest of the theme (panels, tables, forms, buttons, icons, flash/confirm styling) — useful for adopting Prism incrementally, or reverting just the navigation without uninstalling the gem.



30
31
32
# File 'lib/active_admin_prism/configuration.rb', line 30

def sidebar
  @sidebar
end

Whether "Powered by Active Admin" (or your own config.footer text) moves from ActiveAdmin's page-level #footer into the sidebar, pinned below the account/logout area. false leaves the original #footer visible in its normal place instead (ActiveAdmin's own default).



69
70
71
# File 'lib/active_admin_prism/configuration.rb', line 69

def sidebar_footer
  @sidebar_footer
end

#styled_confirmsObject

Whether row-level data-confirm links (View/Edit/Delete, or any other rails-ujs confirm) are routed through ActiveAdmin's own styled jQuery UI dialog instead of the native browser confirm(). Batch Actions confirms are unaffected either way — they always use that dialog.



41
42
43
# File 'lib/active_admin_prism/configuration.rb', line 41

def styled_confirms
  @styled_confirms
end