Sha256: 25f2f2eaa16bc832100cebb21108d3b6ab885a66a5597be4c288712354b80e4f

Contents?: true

Size: 922 Bytes

Versions: 19

Compression:

Stored size: 922 Bytes

Contents

module Spina
  module Admin
    class AdminController < ActionController::Base
      include Spina.config.authentication.constantize
      include Spina::CurrentAccount, Spina::CurrentTheme
      
      helper Spina::Engine.helpers
      
      before_action :add_view_path
      before_action :set_admin_locale
      before_action :authenticate
      
      admin_section :content
      
      def current_admin_path
        request.fullpath[%r{/#{ Spina.config.backend_path }(.*)}, 1]
      end
      helper_method :current_admin_path

      private
      
        def render_flash
          render turbo_stream: turbo_stream.update("flash", partial: "spina/admin/shared/flash")
        end

        def set_admin_locale
          I18n.locale = I18n.default_locale
        end
        
        def add_view_path
          prepend_view_path Spina::Engine.root.join('app/views/spina/admin')
        end

    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
spina-2.11.0 app/controllers/spina/admin/admin_controller.rb
spina-2.10.0 app/controllers/spina/admin/admin_controller.rb
spina-2.9.1 app/controllers/spina/admin/admin_controller.rb
spina-2.9.0 app/controllers/spina/admin/admin_controller.rb
spina-2.8.1 app/controllers/spina/admin/admin_controller.rb
spina-2.8.0 app/controllers/spina/admin/admin_controller.rb
spina-2.7.0 app/controllers/spina/admin/admin_controller.rb
spina-2.6.2 app/controllers/spina/admin/admin_controller.rb
spina-2.6.1 app/controllers/spina/admin/admin_controller.rb
spina-2.6.0 app/controllers/spina/admin/admin_controller.rb
spina-2.5.0 app/controllers/spina/admin/admin_controller.rb
spina-2.4.0 app/controllers/spina/admin/admin_controller.rb
spina-2.3.5 app/controllers/spina/admin/admin_controller.rb
spina-2.3.4 app/controllers/spina/admin/admin_controller.rb
spina-2.3.3 app/controllers/spina/admin/admin_controller.rb
spina-2.3.2 app/controllers/spina/admin/admin_controller.rb
spina-2.3.1 app/controllers/spina/admin/admin_controller.rb
spina-2.3.0 app/controllers/spina/admin/admin_controller.rb
spina-2.2.0 app/controllers/spina/admin/admin_controller.rb