Sha256: 245a6014b6b35dbf81f6c0eb0dc060817a3991798ec959efc93fe218a1935dbd

Contents?: true

Size: 991 Bytes

Versions: 84

Compression:

Stored size: 991 Bytes

Contents

module Spotlight
  ##
  # CRUD actions for document tags
  class TagsController < Spotlight::ApplicationController
    before_action :authenticate_user!
    load_and_authorize_resource :exhibit, class: Spotlight::Exhibit

    def index
      authorize! :tag, @exhibit
      @tags = @exhibit.owned_tags
      add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit
      add_breadcrumb t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(@exhibit)
      add_breadcrumb t(:'spotlight.curation.sidebar.tags'), exhibit_tags_path(@exhibit)

      respond_to do |format|
        format.html
        format.json { render json: @exhibit.owned_tags.map(&:name) }
      end
    end

    def destroy
      authorize! :tag, @exhibit
      # warning: this causes every solr document with this tag to reindex.  That could be slow.
      @exhibit.owned_taggings.where(tag_id: params[:id]).destroy_all

      redirect_to exhibit_tags_path(@exhibit)
    end
  end
end

Version data entries

84 entries across 84 versions & 1 rubygems

Version Path
blacklight-spotlight-2.4.1 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.4.0 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.3.3 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.3.2 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.3.1 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.3.0 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.2.1 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.2.0 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.1.0 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.0.2 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.0.1 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.0.0 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.0.0.rc6 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.0.0.rc5 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.0.0.rc4 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.0.0.rc3 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.0.0.rc2 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-2.0.0.rc1 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-1.5.1 app/controllers/spotlight/tags_controller.rb
blacklight-spotlight-1.4.1 app/controllers/spotlight/tags_controller.rb