-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deprecate 'search_sidebar' partial (replaced w/ componenent in BL8); …
…override 'catalog/index.html.erb' to render 'local_filter' instead
- Loading branch information
1 parent
037bcfb
commit de4938b
Showing
3 changed files
with
69 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,45 @@ | ||
<h2 class="local-filter-heading" id="<%= local_filter_id %>"><%= t("trln_argon.local_filter.showing_results") %></h2> | ||
|
||
<% query_state = query_state_from_search_state(search_state) %> | ||
<% query_state.delete('page') %> | ||
<% query_state.fetch('f', {}).delete(TrlnArgon::Fields::LOCATION_HIERARCHY_FACET.to_s) %> | ||
|
||
<div class="toggle toggle-local"> | ||
|
||
<%= button_tag( type: "button", | ||
id: local_button_id, | ||
class: "btn btn-md #{local_search_button_class}", | ||
title: "#{t("trln_argon.local_filter.search_verb")} #{t("trln_argon.local_filter.searching_local", local_institution_name: institution_long_name)}", | ||
onclick: "window.location='#{search_catalog_path(query_state)}'" | ||
) do %> | ||
<span class="sr-only">icon</span><span class="icon-wrapper"></span> | ||
<% end %> | ||
|
||
<%= label_tag( local_button_id, | ||
t("trln_argon.local_filter.searching_local", local_institution_name: institution_long_name), | ||
class: "#{local_search_button_label_class}", | ||
data: { count_only_path: trln_argon.catalog_count_only_path(query_state) }) %> | ||
|
||
<% inst = TrlnArgon::Engine.configuration.local_institution_code %> | ||
<% instname = TrlnArgon::LookupManager.instance.map("#{inst}.facet.#{inst}") %> | ||
|
||
<div id="location-data" | ||
data-argon-institution="<%= instname %>" | ||
data-argon-hsl="<%= TrlnArgon::LookupManager.instance.map('hsl.facet.hsl') %>" | ||
data-argon-law="<%= TrlnArgon::LookupManager.instance.map('law.facet.law') %>" | ||
data-location-facet-limit="<%= TrlnArgon::Engine.configuration.number_of_location_facets %>"> | ||
</div> | ||
|
||
|
||
<div class="toggle toggle-trln"> | ||
|
||
<%= button_tag( type: "button", | ||
id: trln_button_id, | ||
class: "btn btn-md #{trln_search_button_class}", | ||
title: "#{t("trln_argon.local_filter.search_verb")} #{t("trln_argon.local_filter.searching_trln")}", | ||
onclick: "window.location='#{search_trln_path(query_state)}'" | ||
) do %> | ||
<span class="sr-only">icon</span><span class="icon-wrapper"></span> | ||
<% end %> | ||
|
||
<%= label_tag( trln_button_id, | ||
"#{t("trln_argon.local_filter.searching_trln")}", | ||
class: "#{trln_search_button_label_class}", | ||
data: { count_only_path: trln_argon.trln_count_only_path(query_state) }) %> | ||
|
||
<div id="viewAllResults" class="clearfix" role="navigation" aria-label="Searching (context)"> | ||
<div id="trln-toggle" class="sidenav facets top-panel-heading"> | ||
<h2 class="local-filter-heading" id="localFilterLabelFacets"> | ||
<%= t("trln_argon.local_filter.showing_results") %> | ||
</h2> | ||
|
||
<% query_state = query_state_from_search_state(search_state) %> | ||
<% query_state.delete('page') %> | ||
<% query_state.fetch('f', {}).delete(TrlnArgon::Fields::LOCATION_HIERARCHY_FACET.to_s) %> | ||
|
||
<div class="toggle toggle-local"> | ||
<%= button_tag(type: "button", id: local_button_id, class: "btn btn-md #{local_search_button_class}", | ||
title: "#{t('trln_argon.local_filter.search_verb')} #{t('trln_argon.local_filter.searching_local', local_institution_name: institution_long_name)}", | ||
onclick: "window.location='#{search_catalog_path(query_state)}'") do %> | ||
<span class="sr-only">icon</span><span class="icon-wrapper"></span> | ||
<% end %> | ||
|
||
<%= label_tag(local_button_id, t('trln_argon.local_filter.searching_local', local_institution_name: institution_long_name), | ||
class: "#{local_search_button_label_class}", | ||
data: { count_only_path: trln_argon.catalog_count_only_path(query_state) }) %> | ||
</div> | ||
|
||
<div class="toggle toggle-trln"> | ||
<%= button_tag(type: "button", id: trln_button_id, class: "btn btn-md #{trln_search_button_class}", | ||
title: "#{t('trln_argon.local_filter.search_verb')} #{t('trln_argon.local_filter.searching_trln')}", | ||
onclick: "window.location='#{search_trln_path(query_state)}'") do %> | ||
<span class="sr-only">icon</span><span class="icon-wrapper"></span> | ||
<% end %> | ||
|
||
<%= label_tag(trln_button_id, t('trln_argon.local_filter.searching_trln'), | ||
class: "#{trln_search_button_label_class}", | ||
data: { count_only_path: trln_argon.trln_count_only_path(query_state) }) %> | ||
</div> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<% # TRLN override of BL8 catalog/index view %> | ||
<% content_for(:head) do %> | ||
<meta name="blacklight-search-storage" content="<%= blacklight_config.track_search_session.storage %>"> | ||
<% end %> | ||
<% content_for(:sidebar) do %> | ||
<!-- Render the new custom TRLN view partial --> | ||
<%= render 'catalog/local_filter', | ||
search_state: search_state, | ||
local_button_id: 'toggle-local-btn-top', | ||
trln_button_id: 'toggle-trln-btn-top' %> | ||
|
||
<!-- Continue rendering Blacklight 8's sidebar component --> | ||
<% conf = blacklight_config.view_config(document_index_view_type) %> | ||
<%= render conf.sidebar_component.new(blacklight_config: blacklight_config, | ||
response: @response, | ||
view_config: conf) %> | ||
<% end %> | ||
|
||
<% unless has_search_parameters? %> | ||
<%# if there are no input/search related params, display the "home" partial -%> | ||
<%= render 'home' %> | ||
<%= render 'shared/sitelinks_search_box' %> | ||
<% else %> | ||
<%= render 'search_results' %> | ||
<% end %> |