alchemy_module = {
  engine_name: 'spree',
  name: 'solidus',
  navigation: {
    controller: 'spree/admin/orders',
    action: 'index',
    name: 'Store',
    image: 'alchemy/solidus/alchemy_module_icon.png',
    sub_navigation: [
      {
        controller: 'spree/admin/orders',
        action: 'index',
        name: 'Orders'
      },
      {
        controller: 'spree/admin/products',
        action: 'index',
        name: 'Products'
      },
      {
        controller: 'spree/admin/reports',
        action: 'index',
        name: 'Reports'
      },
      {
        controller: 'spree/admin/promotions',
        action: 'index',
        name: 'Promotions'
      },
      {
        controller: 'spree/admin/stock_items',
        action: 'index',
        name: 'Stock'
      }
    ]
  }
}

if defined?(Spree::Auth::Engine)
  alchemy_module[:navigation][:sub_navigation].push(
    {
      controller: 'spree/admin/users',
      action: 'index',
      name: 'Users'
    }
  )
end

Alchemy::Modules.register_module(alchemy_module)

alchemy_module = {
  engine_name: 'spree',
  name: 'solidus',
  navigation: {
    controller: 'spree/admin/orders',
    action: 'index',
    name: 'Store',
    image: 'alchemy/solidus/alchemy_module_icon.png',
    data: { turbolinks: false },
    sub_navigation: [
      {
        controller: 'spree/admin/orders',
        action: 'index',
        name: 'Orders'
      },
      {
        controller: 'spree/admin/products',
        action: 'index',
        name: 'Products'
      },
      {
        controller: 'spree/admin/reports',
        action: 'index',
        name: 'Reports'
      },
      {
        controller: 'spree/admin/promotions',
        action: 'index',
        name: 'Promotions'
      },
      {
        controller: 'spree/admin/stock_items',
        action: 'index',
        name: 'Stock'
      }
    ]
  }
}

if defined?(Spree::Auth::Engine)
  alchemy_module[:navigation][:sub_navigation].push(
    {
      controller: 'spree/admin/users',
      action: 'index',
      name: 'Users'
    }
  )
end

Alchemy::Modules.register_module(alchemy_module)

Add data-turbolinks='false' to Solidus Subnav
Add data-turbolinks='false' to Solidus Subnav

This adds a `data` key specifying that the Solidus submenu should not
be using Turbolinks. It's harmless with Alchemy versions that don't
support it, and beneficial for ones that do.
