Sha256: 1bd74cfded6d06a3e0753161c18565a8d43cec8acbe26b71edce9c2adf229221

Contents?: true

Size: 1.28 KB

Versions: 16

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

module Spotlight
  ##
  # Edit and update an exhibit's appearance
  class AppearancesController < Spotlight::ApplicationController
    before_action :authenticate_user!
    load_and_authorize_resource id_param: :exhibit_id, instance_name: 'exhibit', class: 'Spotlight::Exhibit', parent: false

    def edit
      add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit
      add_breadcrumb t(:'spotlight.configuration.sidebar.header'), exhibit_dashboard_path(@exhibit)
      add_breadcrumb t(:'spotlight.configuration.sidebar.appearance'), edit_exhibit_appearance_path(@exhibit)
    end

    def update
      if @exhibit.update(exhibit_params)
        notice = t(:'helpers.submit.spotlight_default.updated', model: @exhibit.class.model_name.human.downcase)
        redirect_to edit_exhibit_appearance_path(@exhibit), notice: notice
      else
        render 'edit'
      end
    end

    protected

    def exhibit_params
      params.require(:exhibit).permit(:theme,
                                      main_navigations_attributes: %i[id display label weight],
                                      masthead_attributes: featured_image_params,
                                      thumbnail_attributes: featured_image_params)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
blacklight-spotlight-4.1.2 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-4.1.1 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-4.1.0 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-4.0.3 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-4.0.2 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-4.0.1 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-4.0.0 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-3.6.0.beta10 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-3.6.0.beta9 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-3.6.0.beta8 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-3.6.0.beta7 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-3.6.0.beta6 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-3.6.0.beta5 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-3.6.0.beta4 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-3.6.0.beta3 app/controllers/spotlight/appearances_controller.rb
blacklight-spotlight-3.6.0.beta1 app/controllers/spotlight/appearances_controller.rb