mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-13 09:43:10 +00:00
Only show search box when snippet is searchable
This commit is contained in:
parent
5d0c4caf3b
commit
19ab4cae0a
1 changed files with 10 additions and 8 deletions
|
|
@ -3,14 +3,16 @@
|
|||
{% include "wagtailadmin/shared/header.html" with title=choose_str subtitle=snippet_type_name icon="snippet" %}
|
||||
|
||||
<div class="nice-padding">
|
||||
<form class="snippet-search search-bar" action="{% url 'wagtailsnippets:choose' content_type.app_label content_type.model %}" method="GET">
|
||||
<ul class="fields">
|
||||
{% for field in search_form %}
|
||||
{% include "wagtailadmin/shared/field_as_li.html" with field=field %}
|
||||
{% endfor %}
|
||||
<li class="submit"><input type="submit" value="{% trans 'Search' %}" /></li>
|
||||
</ul>
|
||||
</form>
|
||||
{% if is_searchable %}
|
||||
<form class="snippet-search search-bar" action="{% url 'wagtailsnippets:choose' content_type.app_label content_type.model %}" method="GET">
|
||||
<ul class="fields">
|
||||
{% for field in search_form %}
|
||||
{% include "wagtailadmin/shared/field_as_li.html" with field=field %}
|
||||
{% endfor %}
|
||||
<li class="submit"><input type="submit" value="{% trans 'Search' %}" /></li>
|
||||
</ul>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
<div id="search-results" class="listing snippets">
|
||||
{% include "wagtailsnippets/chooser/results.html" with choosing=1 %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue