-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Why these changes are being introduced: It would be helpful if users could see what filters they've applied to a search directly below the search bar, which would also provide another path to remove filters. Relevant ticket(s): https://mitlibraries.atlassian.net/browse/GDT-142 How this addresses that need: This provides the requested panel. We had been calling this a "filter removal" panel, but I ended up naming it "search summary" to avoid any confusion with the filter sidebar. Side effects of this change: The "You searched for" list has been removed, as this feature replaces it.
- Loading branch information
Showing
4 changed files
with
56 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
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,19 @@ | ||
<% return if @filters.empty? %> | ||
|
||
<div class="search-summary"> | ||
<h2 class="hd-search-summary hd-5">You searched for: </h2> | ||
<ul class="list-search-summary list-inline"> | ||
<% @filters.each do |category, values| %> | ||
<% values.each do |term| %> | ||
<li> | ||
<% if filter_applied?(@enhanced_query[category.to_sym], term['key']) %> | ||
<a href="<%= results_path(remove_filter(@enhanced_query, category.to_sym, term['key'])) %>"> | ||
<%= "#{category}: #{term['key']}" %> | ||
<span class="sr">Remove applied filter?</span> | ||
</a> | ||
<% end %> | ||
</li> | ||
<% end %> | ||
<% end %> | ||
</ul> | ||
</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