Handle template cleanups

This commit is contained in:
Sebastian Lohff 2017-04-15 16:59:37 +02:00
parent 7b8e1c93ab
commit e6d85236a3
5 changed files with 25 additions and 31 deletions

View File

@ -0,0 +1,18 @@
{% with object.getAppName|add:":"|add:object.getClassName|lower|add:"-edit" as editView %}
{% with object.getAppName|add:":"|add:object.getClassName|lower|add:"-delete" as deleteView %}
<div class="panel panel-default">
<div class="panel-heading">
{{ object }} <small>({{ object.getClassName }})</small>
<span class="pull-right">
<a href="{% url editView object.getPK %}"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="{% url deleteView object.getPK %}"><span class="glyphicon glyphicon-trash"></span></a>
</span>
</div>
<div class="panel-body">
{% include "whoisdb/handle_table.html" with object=object %}
</div>
</div>
{% endwith %}
{% endwith %}

View File

@ -3,15 +3,6 @@
{% load handletags %} {% load handletags %}
{% block content %} {% block content %}
<div class="row"> {% include "whoisdb/handle_panel.html" with object=object %}
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">{{ object }} <small>({{ object.getClassName }})</small></div>
<div class="panel-body">
{% include "whoisdb/handle_table.html" with object=object %}
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}

View File

@ -11,7 +11,10 @@
<td>Actions</td> <td>Actions</td>
{% with object.getAppName|add:":"|add:object.getClassName|lower|add:"-edit" as editView %} {% with object.getAppName|add:":"|add:object.getClassName|lower|add:"-edit" as editView %}
{% with object.getAppName|add:":"|add:object.getClassName|lower|add:"-delete" as deleteView %} {% with object.getAppName|add:":"|add:object.getClassName|lower|add:"-delete" as deleteView %}
<td><a href="{% url editView object.getPK %}">Edit object<a/>, <a href="{% url deleteView object.getPK %}">Delete object</a></td> <td>
<a href="{% url editView object.getPK %}"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="{% url deleteView object.getPK %}"><span class="glyphicon glyphicon-trash"></span></a>
</td>
{% endwith %} {% endwith %}
{% endwith %} {% endwith %}
</tr> </tr>

View File

@ -13,7 +13,7 @@
<p> <p>
You can create new database objects <a href="{% url "whoisdb:createObjectOverview" %}">here</a>. You can create new database objects <a href="{% url "whoisdb:createObjectOverview" %}">here</a>.
{% if hasDelegations %} {% if hasDelegations %}
See <a href="?delegated=1">also delegated objects</a>. See <a href="?delegated=1">also lir/rir objects</a>.
{% endif %} {% endif %}
</p> </p>

View File

@ -12,19 +12,6 @@
<button class="btn btn-primary">Search</button> <button class="btn btn-primary">Search</button>
</form> </form>
</p> </p>
{% comment %}
{% 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 %}
{% endcomment %}
{% if term and not results %} {% if term and not results %}
No objects found. No objects found.
{% endif %} {% endif %}
@ -36,12 +23,7 @@
{% for obj in results %} {% for obj in results %}
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="panel panel-default"> {% include "whoisdb/handle_panel.html" with object=obj %}
<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>
</div> </div>
{% endfor %} {% endfor %}