Sha256: 13940d0e97677a83977081d092b59974af7f3182894baa876d957f8992ae6dbb

Contents?: true

Size: 708 Bytes

Versions: 25

Compression:

Stored size: 708 Bytes

Contents

# frozen_string_literal: true
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

25 entries across 25 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-5.0.0 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-5.0.0.rc3 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-5.0.0.rc2 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-5.0.0.rc1 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-3.6.0 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-4.0.0 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-4.0.0.rc3 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-4.0.0.rc2 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-4.0.0.rc1 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-3.5.0 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-4.0.0.beta2 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-3.4.2 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-4.0.0.beta1 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-3.4.1 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-3.4.0 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-3.3.0 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-3.2.0 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-3.1.0 app/controllers/concerns/hyrax/themed_layout_controller.rb
hyrax-3.0.2 app/controllers/concerns/hyrax/themed_layout_controller.rb