Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class CatalogController < ApplicationController
include Arclight::Catalog

include UmArclight::Catalog
prepend_before_action :default_to_grouped_results, only: :index

configure_blacklight do |config|
## Class for sending and receiving requests from a search index
Expand Down Expand Up @@ -450,4 +451,10 @@ class CatalogController < ApplicationController
# Group header values
config.add_group_header_field "abstract_or_scope", accessor: true, truncate: true, helper_method: :render_html_tags
end

private

def default_to_grouped_results
params[:group] = "true" if params[:group].blank?
end
end
6 changes: 6 additions & 0 deletions app/helpers/um_arclight_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ def homepage?
current_page?(root_path) && !has_search_parameters?
end

def search_without_group
search_state.params_for_search
.merge("group" => "false")
.except("page")
end

def formatted_last_indexed(timestamp)
date = DateTime.parse(timestamp)
date.strftime("%F")
Expand Down