Sha256: a3fa2d9021bff4d0b0bde713e5e94b0a1af1bc572517d729c9eae70a0e20c835

Contents?: true

Size: 1.03 KB

Versions: 8

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true
module Hyrax
  class DashboardController < ApplicationController
    include Blacklight::Base
    include Hyrax::Breadcrumbs
    with_themed_layout 'dashboard'
    before_action :authenticate_user!
    before_action :build_breadcrumbs, only: [:show]

    ##
    # @!attribute [rw] sidebar_partials
    #   @return [Hash]
    #
    # @example Add a custom partial to the tasks sidebar block
    #   Hyrax::DashboardController.sidebar_partials[:tasks] << "hyrax/dashboard/sidebar/custom_task"
    class_attribute :sidebar_partials
    self.sidebar_partials = { activity: [], configuration: [], repository_content: [], tasks: [] }

    def show
      if can? :read, :admin_dashboard
        @presenter = Hyrax::Admin::DashboardPresenter.new
        @admin_set_rows = Hyrax::AdminSetService.new(self).search_results_with_work_count(:read)
        render 'show_admin'
      else
        @presenter = Dashboard::UserPresenter.new(current_user, view_context, params[:since])
        render 'show_user'
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hyrax-3.2.0 app/controllers/hyrax/dashboard_controller.rb
hyrax-3.1.0 app/controllers/hyrax/dashboard_controller.rb
hyrax-3.0.2 app/controllers/hyrax/dashboard_controller.rb
hyrax-3.0.1 app/controllers/hyrax/dashboard_controller.rb
hyrax-3.0.0 app/controllers/hyrax/dashboard_controller.rb
hyrax-3.0.0.pre.rc4 app/controllers/hyrax/dashboard_controller.rb
hyrax-3.0.0.pre.rc3 app/controllers/hyrax/dashboard_controller.rb
hyrax-3.0.0.pre.rc2 app/controllers/hyrax/dashboard_controller.rb