Sha256: 0dd90b82afd2d4d671011b35db80f1555ebd2ae789793b78eaa2294212e9c0f4

Contents?: true

Size: 1.05 KB

Versions: 34

Compression:

Stored size: 1.05 KB

Contents

module Workarea
  module Storefront
    class ApplicationController < Workarea::ApplicationController
      include HttpCaching
      include Authentication
      include AdminGuestBrowsing
      include Impersonation
      include CurrentCheckout
      include CurrentRelease
      include UserActivity
      include OrderLookup
      include CurrentReferrer

      layout :current_layout

      helper :all
      helper_method :layout_content

      def health_check
        render plain: 'ok'
      end

      def current_user_info
        touch_auth_cookie
        render 'workarea/storefront/users/current_user'
      end

      def layout_content
        @layout_content ||= ContentViewModel.new(
          Content.for('layout'),
          view_model_options
        )
      end

      def current_layout
        if request.xhr? && params[:layout].to_s != 'true'
          false
        else
          'workarea/storefront/application'
        end
      end

      private

      def view_model_options
        super.merge(user: current_user)
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-storefront-3.4.45 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.44 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.43 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.42 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.41 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.40 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.39 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.38 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.37 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.36 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.35 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.34 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.33 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.32 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.31 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.30 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.29 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.28 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.27 app/controllers/workarea/storefront/application_controller.rb
workarea-storefront-3.4.26 app/controllers/workarea/storefront/application_controller.rb