Search looks much nicer

This commit is contained in:
Sebastian Lohff 2017-03-28 02:05:30 +02:00
parent 6ac391b765
commit 65e92b38dc
2 changed files with 20 additions and 3 deletions

View File

@ -1,5 +1,5 @@
{% load handletags %}
<table class="table">
<table class="table table-hover">
{% for field in object|getFields:user %}
<tr>
<td>{{ field.0 }}</td>

View File

@ -4,7 +4,7 @@
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">Search {% if term %}for {{ term }}{% else %}database{% endif %}</div>
<div class="panel-heading">Search {% if term %}for {{ term }} - {{ results|length }} result{{results|length|pluralize:"s" }}{% else %}database{% endif %}</div>
<div class="panel-body">
<p>
<form class="form" method="post" action="{% url "whoisdb:search" %}">
@ -13,6 +13,7 @@
<button class="btn btn-primary">Search</button>
</form>
</p>
{% comment %}
{% if term %}
<p>
<h3>Search for '{{ term }}'</h3>
@ -24,9 +25,25 @@
{% endfor %}
</p>
{% endif %}
{% endcomment %}
{% if term and not results %}
No objects found.
{% endif %}
</div>
</div>
</div>
</div>
{% endblock %}
{% for obj in results %}
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">{{ obj }} <small>({{ obj.getClassName }})</small></div>
<div class="panel-body">
{% include "whoisdb/handle_table.html" with object=obj %}
</div>
</div>
</div>
</div>
{% endfor %}
{% endblock %}