Sha256: d9c1167f3f66c3d252db0171b6aeb29ab705a378043359dbaba1d5cd26a6c89b

Contents?: true

Size: 1.31 KB

Versions: 41

Compression:

Stored size: 1.31 KB

Contents

module Krikri
  ##
  # Marshals validation reports for views.
  #
  # ValidationReportsController inherits from the host application's
  # ApplicationController.  It does not interit from Krikri's
  # ApplicationController.
  class ValidationReportsController < CatalogController
    before_action :authenticate_user!

    ##
    # ValidationReportsController has access to views in the following
    # directories:
    #   krikri/validation_reports
    #   catalog (defined in Blacklight)
    # It inherits view templates from the host application's
    # ApplicationController.  It uses krikri's application layout:
    layout 'krikri/application'

    ##
    # Render the show view
    #
    # This differs from {Blacklight::CatalogController}'s normal handling of the
    # index and show views, Giving a paginated list of response documents
    # instead of showing a single document.
    #
    # @todo: consider bringing this in line with Blacklight's approach
    def show
      @current_provider = params[:provider]

      @response = build_report.find(params[:id])
      @documents = @response.documents
    end

    private

    def build_report
      report = ValidationReport.new
      report.provider_id = @current_provider
      report.page = params[:page]
      report.rows = params[:per_page]
      report
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
krikri-0.15.2 app/controllers/krikri/validation_reports_controller.rb
krikri-0.15.1 app/controllers/krikri/validation_reports_controller.rb
krikri-0.15.0 app/controllers/krikri/validation_reports_controller.rb
krikri-0.14.0 app/controllers/krikri/validation_reports_controller.rb
krikri-0.13.2 app/controllers/krikri/validation_reports_controller.rb
krikri-0.13.1 app/controllers/krikri/validation_reports_controller.rb
krikri-0.13.0 app/controllers/krikri/validation_reports_controller.rb
krikri-0.12.4 app/controllers/krikri/validation_reports_controller.rb
krikri-0.12.3 app/controllers/krikri/validation_reports_controller.rb
krikri-0.12.1 app/controllers/krikri/validation_reports_controller.rb
krikri-0.12.0 app/controllers/krikri/validation_reports_controller.rb
krikri-0.12.0.pre.rc.1 app/controllers/krikri/validation_reports_controller.rb
krikri-0.11.2 app/controllers/krikri/validation_reports_controller.rb
krikri-0.11.1 app/controllers/krikri/validation_reports_controller.rb
krikri-0.11.0 app/controllers/krikri/validation_reports_controller.rb
krikri-0.10.1 app/controllers/krikri/validation_reports_controller.rb
krikri-0.10.0 app/controllers/krikri/validation_reports_controller.rb
krikri-0.9.0 app/controllers/krikri/validation_reports_controller.rb
krikri-0.8.9 app/controllers/krikri/validation_reports_controller.rb
krikri-0.8.8 app/controllers/krikri/validation_reports_controller.rb