Sha256: 00fdb14d40e91a0e066f82ef7209903a5a9b2a8e1cdb14b651d3c6d305938314

Contents?: true

Size: 678 Bytes

Versions: 36

Compression:

Stored size: 678 Bytes

Contents

module Hyrax
  module ThemedLayoutController
    extend ActiveSupport::Concern

    included do
      class_attribute :theme
      self.theme = 'hyrax'
      helper_method :theme
      helper_method :show_site_actions?
      helper_method :show_site_search?
    end

    module ClassMethods
      def with_themed_layout(view_name = nil)
        case view_name
        when Symbol
          layout proc { |controller| controller.send(view_name) }
        when String
          layout("#{theme}/#{view_name}")
        else
          layout(theme)
        end
      end
    end

    def show_site_actions?
      true
    end

    def show_site_search?
      true
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.9.5 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.9.4 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.9.3 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.9.2 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.9.1 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.9.0 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.8.0 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.7.2 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.7.1 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.7.0 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.6.0 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-3.0.0.pre.rc1 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-3.0.0.pre.beta3 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.5.1 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.5.0 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-3.0.0.pre.beta2 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.4.1 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-3.0.0.pre.beta1 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-2.4.0 app/controllers/concerns/hyrax/themed_layout_controller.rb