-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from sul-dlss/home-page
Allow the spotlight default exhibit home page to live at the root_url, a...
- Loading branch information
Showing
10 changed files
with
96 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Spotlight::HomePagesHelper | ||
include Blacklight::UrlHelperBehavior | ||
|
||
## | ||
# Standard display of a facet value in a list. Used in both _facets sidebar | ||
# partial and catalog/facet expanded list. Will output facet value name as | ||
# a link to add that to your restrictions, with count in parens. | ||
# | ||
# @param [Blacklight::SolrResponse::Facets::FacetField] | ||
# @param [String] facet item | ||
# @param [Hash] options | ||
# @option options [Boolean] :suppress_link display the facet, but don't link to it | ||
# @option options [Rails::Engine] :route_set route set to use to render the link | ||
# @return [String] | ||
def render_facet_value(facet_solr_field, item, options ={}) | ||
scope = options.delete(:route_set) || main_app | ||
path = scope.catalog_index_url(add_facet_params_and_redirect(facet_solr_field, item).merge(only_path: true)) | ||
content_tag(:span, :class => "facet-label") do | ||
link_to_unless(options[:suppress_link], facet_display_value(facet_solr_field, item), path, :class=>"facet_select") | ||
end + render_facet_count(item.hits) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div id="sidebar" class="col-md-3"> | ||
<%= render 'catalog/search_sidebar' %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module ActionDispatch::Routing | ||
class Mapper | ||
|
||
def spotlight_root | ||
root to: "spotlight/home_pages#show" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require 'spec_helper' | ||
|
||
describe "spotlight/home_pages/_sidebar.html.erb" do | ||
before do | ||
stub_template 'catalog/_search_sidebar.html.erb' => "Sidebar" | ||
end | ||
|
||
it { render; expect(rendered).to match "Sidebar" } | ||
|
||
end | ||
|
||
|