0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Added snippet chooser results template

So search results can be loaded with ajax
This commit is contained in:
Karl Hobley 2015-08-14 15:15:11 +01:00
parent eddc129a69
commit cc66159441
2 changed files with 9 additions and 7 deletions

View File

@ -3,7 +3,7 @@
{% include "wagtailadmin/shared/header.html" with title=choose_str subtitle=snippet_type_name icon="snippet" %}
<div class="nice-padding">
<form class="snippets-search search-bar" action="{% url 'wagtailsnippets:choose' content_type.app_label content_type.model %}" method="GET">
<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 %}
@ -13,11 +13,6 @@
</form>
<div id="search-results" class="listing snippets">
{% if items %}
{% include "wagtailsnippets/chooser/list.html" with choosing=1 %}
{% else %}
{% url 'wagtailsnippets:add' content_type.app_label content_type.model as wagtailsnippets_create_snippet_url %}
<p>{% blocktrans %}You haven't created any {{ snippet_type_name }} snippets. Why not <a href="{{ wagtailsnippets_create_snippet_url }}" target="_blank">create one now{% endblocktrans %}</p>
{% endif %}
{% include "wagtailsnippets/chooser/results.html" with choosing=1 %}
</div>
</div>

View File

@ -0,0 +1,7 @@
{% load i18n %}
{% if items %}
{% include "wagtailsnippets/chooser/list.html" with choosing=1 %}
{% else %}
{% url 'wagtailsnippets:add' content_type.app_label content_type.model as wagtailsnippets_create_snippet_url %}
<p>{% blocktrans %}You haven't created any {{ snippet_type_name }} snippets. Why not <a href="{{ wagtailsnippets_create_snippet_url }}" target="_blank">create one now{% endblocktrans %}</p>
{% endif %}