Sha256: 12539a80a47139b3726d53e800d5d528d69e6915e7a9e5a1702af85c11fb10b6

Contents?: true

Size: 977 Bytes

Versions: 36

Compression:

Stored size: 977 Bytes

Contents

module Hyrax
  module Admin
    class AppearancesController < ApplicationController
      before_action :require_permissions
      with_themed_layout 'dashboard'
      class_attribute :form_class
      self.form_class = Hyrax::Forms::Admin::Appearance

      def show
        add_breadcrumb t(:'hyrax.controls.home'), root_path
        add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
        add_breadcrumb t(:'hyrax.admin.sidebar.configuration'), '#'
        add_breadcrumb t(:'hyrax.admin.sidebar.appearance'), request.path
        @form = form_class.new
      end

      def update
        form_class.new(update_params).update!
        redirect_to({ action: :show }, notice: t('.flash.success'))
      end

      private

        def update_params
          params.require(:admin_appearance).permit(form_class.permitted_params)
        end

        def require_permissions
          authorize! :update, :appearance
        end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

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