2017-03-27 13:29:32 +02:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-12">
|
|
|
|
<div class="panel panel-default">
|
2017-03-28 02:05:30 +02:00
|
|
|
<div class="panel-heading">Search {% if term %}for {{ term }} - {{ results|length }} result{{results|length|pluralize:"s" }}{% else %}database{% endif %}</div>
|
2017-03-27 13:29:32 +02:00
|
|
|
<div class="panel-body">
|
|
|
|
<p>
|
|
|
|
<form class="form" method="post" action="{% url "whoisdb:search" %}">
|
|
|
|
{% csrf_token %}
|
|
|
|
<input type="text" name="q" placeholder="Search in DB">
|
|
|
|
<button class="btn btn-primary">Search</button>
|
|
|
|
</form>
|
|
|
|
</p>
|
2017-03-28 02:05:30 +02:00
|
|
|
{% comment %}
|
2017-03-27 13:29:32 +02:00
|
|
|
{% if term %}
|
|
|
|
<p>
|
|
|
|
<h3>Search for '{{ term }}'</h3>
|
|
|
|
{% for obj in results %}
|
|
|
|
<h5>{{ obj }}</h5>
|
|
|
|
{% include "whoisdb/handle_table.html" with object=obj %}
|
|
|
|
{% empty %}
|
|
|
|
No objects found.
|
|
|
|
{% endfor %}
|
|
|
|
</p>
|
|
|
|
{% endif %}
|
2017-03-28 02:05:30 +02:00
|
|
|
{% endcomment %}
|
|
|
|
{% if term and not results %}
|
|
|
|
No objects found.
|
|
|
|
{% endif %}
|
2017-03-27 13:29:32 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-03-28 02:05:30 +02:00
|
|
|
{% 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 %}
|