Sha256: f19d1cd15d97f1b9480929c6deaf82bcca338776c2bcd261ab710e39ca20b48a

Contents?: true

Size: 995 Bytes

Versions: 25

Compression:

Stored size: 995 Bytes

Contents

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

25 entries across 25 versions & 1 rubygems

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