Skip to content
This repository was archived by the owner on Mar 15, 2018. It is now read-only.

Commit 32b82b0

Browse files
committed
make search term optional (bug 619052)
1 parent 4927c62 commit 32b82b0

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

apps/search/templates/search/results.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,17 @@ <h3>{{ title }}</h3>
7373
<h2>{{ _('Filter Results') }}</h2>
7474
<ul class="facets island pjax-trigger">
7575
{{ facet(_('Category'), 'category-facets', categories) }}
76-
<li id="compat-facets" class="facet">
77-
<h3>{{ _('Works with') }}</h3>
78-
{% if versions %}
79-
{{ facet_links(versions) }}
80-
{% endif %}
81-
{% if platforms %}
82-
{{ facet_links(platforms) }}
83-
{% endif %}
84-
</li>
76+
{% if versions or platforms %}
77+
<li id="compat-facets" class="facet">
78+
<h3>{{ _('Works with') }}</h3>
79+
{% if versions %}
80+
{{ facet_links(versions) }}
81+
{% endif %}
82+
{% if platforms %}
83+
{{ facet_links(platforms) }}
84+
{% endif %}
85+
</li>
86+
{% endif %}
8587
{{ facet(_('Tag'), 'tag-facets', tags) }}
8688
</ul>
8789
{{ num_results() }}

apps/search/tests/test_views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,9 @@ def test_mobile_get(self):
476476
eq_(r.status_code, 200)
477477
self.assertTemplateUsed(r, 'search/mobile/results.html')
478478

479+
def test_no_compat_facets(self):
480+
assert not pq(self.client.get(self.url).content)('#compat-facets')
481+
479482

480483
class TestAjaxSearch(amo.tests.ESTestCase):
481484

0 commit comments

Comments
 (0)