Class: Spree::BackendConfiguration

Inherits:
Preferences::Configuration
  • Object
show all
Defined in:
lib/spree/backend_configuration.rb,
lib/spree/backend_configuration/menu_item.rb

Defined Under Namespace

Classes: MenuItem

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#admin_updated_navbarBoolean

Returns Should the updated navbar be used in admin (default: false).

Returns:

  • (Boolean)

    Should the updated navbar be used in admin (default: false)



28
# File 'lib/spree/backend_configuration.rb', line 28

versioned_preference :admin_updated_navbar, :boolean, initial_value: false, boundaries: { "4.2.0" => true }

Return the menu items which should be drawn in the menu



66
# File 'lib/spree/backend_configuration.rb', line 66

attr_writer :menu_items

#prefer_menu_item_partialsBoolean

Returns Whether or not to prefer menu item partials when both a partial and children are present.

Returns:

  • (Boolean)

    Whether or not to prefer menu item partials when both a partial and children are present.



42
# File 'lib/spree/backend_configuration.rb', line 42

versioned_preference :prefer_menu_item_partials, :boolean, initial_value: true, boundaries: { "4.2.0" => false }

#themeString

Returns Default admin theme name.

Returns:

  • (String)

    Default admin theme name



19
# File 'lib/spree/backend_configuration.rb', line 19

versioned_preference :theme, :string, initial_value: 'classic', boundaries: { "4.2.0" => "solidus_admin" }

#themesHash

Returns A hash containing the themes that are available for the admin panel.

Returns:

  • (Hash)

    A hash containing the themes that are available for the admin panel



12
13
14
15
# File 'lib/spree/backend_configuration.rb', line 12

preference :themes, :hash, default: {
  classic: 'spree/backend/all',
  solidus_admin: 'spree/backend/themes/solidus_admin'
}

Instance Method Details

#theme_path(user_theme = nil) ⇒ Object



21
22
23
# File 'lib/spree/backend_configuration.rb', line 21

def theme_path(user_theme = nil)
  user_theme ? themes.fetch(user_theme.to_sym) : themes.fetch(theme.to_sym)
end