diff --git a/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.html b/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.html index b5b6ea84b..1d7bf82e5 100644 --- a/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.html +++ b/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.html @@ -3,16 +3,18 @@ {% include "wagtailadmin/shared/header.html" with title=choose_str subtitle=snippet_type_name icon="snippet" %}
- {% if is_searchable %} - - {% endif %} + {% endif %} +
{% include "wagtailsnippets/chooser/results.html" with choosing=1 %} diff --git a/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.js b/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.js index d2320259b..fe5cd2a18 100644 --- a/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.js +++ b/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.js @@ -30,7 +30,7 @@ function initModal(modal) { function setPage(page) { var dataObj = {p: page, results: 'true'}; - if ($('#id_q').val().length) { + if ($('#id_q').length && $('#id_q').val().length) { dataObj.q = $('#id_q').val(); } diff --git a/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/results.html b/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/results.html index 09edc8b12..3bb5ec29f 100644 --- a/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/results.html +++ b/wagtail/wagtailsnippets/templates/wagtailsnippets/snippets/results.html @@ -2,7 +2,7 @@ {% if items %} {% if is_searching %}

- {% blocktrans count counter=items|length %} + {% blocktrans count counter=items.paginator.count %} There is one match {% plural %} There are {{ counter }} matches