Sha256: a49551ad5692f6f21556fdb307893e5aba52e6b35fb84999e2ea5b22b93022df

Contents?: true

Size: 1002 Bytes

Versions: 1

Compression:

Stored size: 1002 Bytes

Contents

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

      layout :current_layout

      helper :all
      helper_method :layout_content

      around_action :apply_segments

      def health_check
        render plain: 'ok'
      end

      def current_user_info
        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

1 entries across 1 versions & 1 rubygems

Version Path
workarea-storefront-3.5.0.beta.1 app/controllers/workarea/storefront/application_controller.rb