Search looks much nicer

master
Sebastian Lohff 7 years ago
parent 6ac391b765
commit 65e92b38dc

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

@ -4,7 +4,7 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="panel panel-default"> <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"> <div class="panel-body">
<p> <p>
<form class="form" method="post" action="{% url "whoisdb:search" %}"> <form class="form" method="post" action="{% url "whoisdb:search" %}">
@ -13,6 +13,7 @@
<button class="btn btn-primary">Search</button> <button class="btn btn-primary">Search</button>
</form> </form>
</p> </p>
{% comment %}
{% if term %} {% if term %}
<p> <p>
<h3>Search for '{{ term }}'</h3> <h3>Search for '{{ term }}'</h3>
@ -24,9 +25,25 @@
{% endfor %} {% endfor %}
</p> </p>
{% endif %} {% endif %}
{% endcomment %}
{% if term and not results %}
No objects found.
{% endif %}
</div> </div>
</div> </div>
</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 %}

Loading…
Cancel
Save