Class: CatalogController

Inherits:
ApplicationController
  • Object
show all
Includes:
Blacklight::Catalog, BlacklightAdvancedSearch::ParseBasicQ, Hydra::Controller::ControllerBehavior
Defined in:
lib/generators/sufia/templates/catalog_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.modified_fieldObject


69
70
71
# File 'lib/generators/sufia/templates/catalog_controller.rb', line 69

def self.modified_field
  solr_name('desc_metadata__date_modified', :stored_sortable, type: :date)
end

.uploaded_fieldObject


64
65
66
67
# File 'lib/generators/sufia/templates/catalog_controller.rb', line 64

def self.uploaded_field
#  system_create_dtsi
  solr_name('desc_metadata__date_uploaded', :stored_sortable, type: :date)
end

Instance Method Details

#indexObject


39
40
41
42
43
44
# File 'lib/generators/sufia/templates/catalog_controller.rb', line 39

def index
  super
  recent
  #also grab my recent docs too
  recent_me    
end

#recentObject


46
47
48
49
50
51
52
53
54
55
# File 'lib/generators/sufia/templates/catalog_controller.rb', line 46

def recent
  if user_signed_in?
    # grab other people's documents
    (_, @recent_documents) = get_search_results(:q =>filter_not_mine,
                                      :sort=>sort_field, :rows=>4)      
  else 
    # grab any documents we do not know who you are
    (_, @recent_documents) = get_search_results(:q =>'', :sort=>sort_field, :rows=>4)
  end
end

#recent_meObject


57
58
59
60
61
62
# File 'lib/generators/sufia/templates/catalog_controller.rb', line 57

def recent_me
  if user_signed_in?
    (_, @recent_user_documents) = get_search_results(:q =>filter_not_mine,
                                      :sort=>sort_field, :rows=>4)
  end
end