|
1 | | -<% return unless applied_filters(@enhanced_query).any? %> |
| 1 | +<% return unless (applied_filters(@enhanced_query).present? || |
| 2 | + applied_keyword(@enhanced_query).present? || |
| 3 | + applied_geobox_terms(@enhanced_query).present? || |
| 4 | + applied_geodistance_terms(@enhanced_query).present? || |
| 5 | + applied_advanced_terms(@enhanced_query).present?) %> |
2 | 6 |
|
3 | | -<aside class="filter-summary"> |
4 | | - <div class="list-filter-summary"> |
5 | | - <h2 class="hd-filter-summary hd-5">Applied filters: </h2> |
6 | | - <ul class="list-inline"> |
7 | | - <% applied_filters(@enhanced_query).each do |filter| %> |
8 | | - <li> |
9 | | - <a class="applied-filter" |
10 | | - href="<%= results_path(remove_filter(@enhanced_query, filter.keys[0], filter.values[0])) %>"> |
11 | | - <%= "#{nice_labels[filter.keys[0]] || filter.keys[0]}:" %> |
12 | | - <% if Flipflop.enabled?(:gdt) %> |
13 | | - <%= "#{gdt_sources(filter.values[0], filter.keys[0])}" %> |
14 | | - <% else %> |
15 | | - <%= "#{filter.values[0]}" %> |
16 | | - <% end %> |
17 | | - <span class="sr">Remove applied filter?</span> |
18 | | - </a> |
19 | | - </li> |
20 | | - <% end %> |
21 | | - </ul> |
| 7 | +<aside class="search-summary"> |
| 8 | + <div class="list-terms-summary"> |
| 9 | + <h2 class="hd-search-summary hd-5">Applied search terms: </h2> |
| 10 | + <ul class="list-unbulleted"> |
| 11 | + <% if applied_keyword(@enhanced_query).present? %> |
| 12 | + <li class="applied-term keyword"><%= applied_keyword(@enhanced_query).first %></li> |
| 13 | + <% end %> |
| 14 | + <% if applied_geobox_terms(@enhanced_query).present? %> |
| 15 | + <li class="applied-term"> |
| 16 | + <ul class="list-inline"> |
| 17 | + <% applied_geobox_terms(@enhanced_query).each do |term| %> |
| 18 | + <li class="applied-term"><%= term %></li> |
| 19 | + <% end %> |
| 20 | + </ul> |
| 21 | + </li> |
| 22 | + <% end %> |
| 23 | + <% if applied_geodistance_terms(@enhanced_query).present? %> |
| 24 | + <li class="applied-term"> |
| 25 | + <ul class="list-inline"> |
| 26 | + <% applied_geodistance_terms(@enhanced_query).each do |term| %> |
| 27 | + <li class="applied-term"><%= term %></li> |
| 28 | + <% end %> |
| 29 | + </ul> |
| 30 | + </li> |
| 31 | + <% end %> |
| 32 | + <% if applied_advanced_terms(@enhanced_query).present? %> |
| 33 | + <li class="applied-term"> |
| 34 | + <ul class="list-inline"> |
| 35 | + <% applied_advanced_terms(@enhanced_query).each do |term| %> |
| 36 | + <li class="applied-term"><%= term %></li> |
| 37 | + <% end %> |
| 38 | + </ul> |
| 39 | + </li> |
| 40 | + <% end %> |
| 41 | + </ul> |
22 | 42 | </div> |
23 | | - <% if applied_filters(@enhanced_query).length > 1 %> |
24 | | - <div class="clear-filters"> |
25 | | - <a class="btn button-primary" |
26 | | - href="<%= results_path(remove_all_filters(@enhanced_query)) %>">Clear all filters</a> |
| 43 | + |
| 44 | + <% if applied_filters(@enhanced_query).any? %> |
| 45 | + <div class="list-filter-summary"> |
| 46 | + <h2 class="hd-search-summary hd-5">Applied filters: </h2> |
| 47 | + <ul class="list-inline"> |
| 48 | + <% applied_filters(@enhanced_query).each do |filter| %> |
| 49 | + <li> |
| 50 | + <a class="applied-filter" |
| 51 | + href="<%= results_path(remove_filter(@enhanced_query, filter.keys[0], filter.values[0])) %>"> |
| 52 | + <%= "#{nice_labels[filter.keys[0]] || filter.keys[0]}:" %> |
| 53 | + <% if Flipflop.enabled?(:gdt) %> |
| 54 | + <%= "#{gdt_sources(filter.values[0], filter.keys[0])}" %> |
| 55 | + <% else %> |
| 56 | + <%= "#{filter.values[0]}" %> |
| 57 | + <% end %> |
| 58 | + <span class="sr">Remove applied filter?</span> |
| 59 | + </a> |
| 60 | + </li> |
| 61 | + <% end %> |
| 62 | + </ul> |
27 | 63 | </div> |
| 64 | + <% if applied_filters(@enhanced_query).length > 1 %> |
| 65 | + <div class="clear-filters"> |
| 66 | + <a class="btn button-primary" |
| 67 | + href="<%= results_path(remove_all_filters(@enhanced_query)) %>">Clear all filters</a> |
| 68 | + </div> |
| 69 | + <% end %> |
28 | 70 | <% end %> |
29 | 71 | </aside> |
0 commit comments