From cc6615944176a3c881e647ff7282a8b1a7c768c0 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Fri, 14 Aug 2015 15:15:11 +0100 Subject: [PATCH] Added snippet chooser results template So search results can be loaded with ajax --- .../templates/wagtailsnippets/chooser/choose.html | 9 ++------- .../templates/wagtailsnippets/chooser/results.html | 7 +++++++ 2 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/results.html diff --git a/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.html b/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.html index f95161f6a2..18de910dc9 100644 --- a/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.html +++ b/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/choose.html @@ -3,7 +3,7 @@ {% include "wagtailadmin/shared/header.html" with title=choose_str subtitle=snippet_type_name icon="snippet" %}
-
diff --git a/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/results.html b/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/results.html new file mode 100644 index 0000000000..e1b9387ce3 --- /dev/null +++ b/wagtail/wagtailsnippets/templates/wagtailsnippets/chooser/results.html @@ -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 %} +

{% blocktrans %}You haven't created any {{ snippet_type_name }} snippets. Why not create one now{% endblocktrans %}

+{% endif %}