Sha256: b60f99e964fb02cdc9cc50efadd3782ed22d348ba4e5dfca20a8002fb0ffa6ee
Contents?: true
Size: 1.23 KB
Versions: 17
Compression:
Stored size: 1.23 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] 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 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
Version data entries
17 entries across 17 versions & 1 rubygems