Skip to content
Snippets Groups Projects

Display buttons to easily access groups

Merged Anusha Ranganathan requested to merge feature/472_crc_1280_button into develop
Files
7
# frozen_string_literal: true
module Hyrax
class DashboardController < ApplicationController
include Blacklight::Base
include Hyrax::Breadcrumbs
include HyraxHelper
with_themed_layout 'dashboard'
before_action :authenticate_user!
before_action :build_breadcrumbs, only: [:show]
before_action :set_date_range
##
# @!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
@collections_to_display = list_collections_to_display
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
private
def set_date_range
@start_date = params[:start_date] || Time.zone.today - 1.month
@end_date = params[:end_date] || Time.zone.today + 1.day
end
end
end
\ No newline at end of file
Loading