Class: Hyrax::DashboardController

Inherits:
ApplicationController
  • Object
show all
Includes:
Blacklight::Base
Defined in:
app/controllers/hyrax/dashboard_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/hyrax/dashboard_controller.rb', line 7

def show
  add_breadcrumb t(:'hyrax.controls.home'), root_path
  add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
  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