Class: DashboardController

Inherits:
ApplicationController show all
Includes:
ActionView::Helpers::DateHelper, Blacklight::Catalog, Blacklight::Configurable, BlacklightAdvancedSearch::Controller, BlacklightAdvancedSearch::ParseBasicQ, Hydra::BatchEditBehavior, Hydra::Controller::ControllerBehavior
Defined in:
app/controllers/dashboard_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#show_action_bar?, #sufia, with_themed_layout

Instance Method Details



58
59
60
61
62
63
64
# File 'app/controllers/dashboard_controller.rb', line 58

def get_related_file
  @user = current_user
  #Need to make sure if params get in ways of searching (like page,per_page,q,f). If that happens then have to remove from params and put back in
  extra_controller_params = {}
  extra_controller_params.merge!(:fq=>"")
  @response, @document_list = get_solr_response_for_field_values("is_part_of_s",["info:fedora/#{params[:id]}"],extra_controller_params)
end

#indexObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'app/controllers/dashboard_controller.rb', line 28

def index
  extra_head_content << view_context.auto_discovery_link_tag(:rss, url_for(params.merge(:format => 'rss')), :title => "RSS for results")
  extra_head_content << view_context.auto_discovery_link_tag(:atom, url_for(params.merge(:format => 'atom')), :title => "Atom for results")
  (@response, @document_list) = get_search_results
  @user = current_user
  @events = @user.events(100)
  @last_event_timestamp = @user.events.first[:timestamp].to_i || 0 rescue 0
  @filters = params[:f] || []

  # adding a key to the session so that the history will be saved so that batch_edits select all will work
  search_session[:dashboard] = true
  respond_to do |format|
    format.html { save_current_search_params }
    format.rss  { render :layout => false }
    format.atom { render :layout => false }
  end

  # set up some parameters for allowing the batch controls to show appropiately
  @max_batch_size = 80
  count_on_page = @document_list.count {|doc| batch.index(doc.id)}
  @disable_select_all = @document_list.count > @max_batch_size
  batch_size = batch.uniq.size
  @result_set_size = @response.response["numFound"]
  @empty_batch = batch.empty?
  @all_checked = (count_on_page == @document_list.count)
  @entire_result_set_selected = @response.response["numFound"] == batch_size
  @batch_size_on_other_page = batch_size - count_on_page
  @batch_part_on_other_page = (@batch_size_on_other_page) > 0
end