From 65e92b38dcabe44556f723113374c9f739d1a484 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Tue, 28 Mar 2017 02:05:30 +0200 Subject: [PATCH] Search looks much nicer --- templates/whoisdb/handle_table.html | 2 +- templates/whoisdb/search.html | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/templates/whoisdb/handle_table.html b/templates/whoisdb/handle_table.html index 1d84e37..51e2ee0 100644 --- a/templates/whoisdb/handle_table.html +++ b/templates/whoisdb/handle_table.html @@ -1,5 +1,5 @@ {% load handletags %} - +
{% for field in object|getFields:user %} diff --git a/templates/whoisdb/search.html b/templates/whoisdb/search.html index 6c4f2d5..af4e567 100644 --- a/templates/whoisdb/search.html +++ b/templates/whoisdb/search.html @@ -4,7 +4,7 @@
-
Search {% if term %}for {{ term }}{% else %}database{% endif %}
+
Search {% if term %}for {{ term }} - {{ results|length }} result{{results|length|pluralize:"s" }}{% else %}database{% endif %}

@@ -13,6 +13,7 @@

+ {% comment %} {% if term %}

Search for '{{ term }}'

@@ -24,9 +25,25 @@ {% endfor %}

{% endif %} + {% endcomment %} + {% if term and not results %} + No objects found. + {% endif %}
-{% endblock %} +{% for obj in results %} +
+
+
+
{{ obj }} ({{ obj.getClassName }})
+
+ {% include "whoisdb/handle_table.html" with object=obj %} +
+
+
+
+{% endfor %} +{% endblock %}
{{ field.0 }}