dnmgmt/templates/whoisdb/handle_table.html

23 lines
805 B
HTML

{% load handletags %}
<table class="table table-hover">
{% for field in object|getFields:user %}
<tr>
<td>{{ field.0 }}</td>
<td>{% if field.1.through %}{{ field.1.all|linkObjects|default:"-" }}{% else %}{{ field.1|tryLinkHandle|default:"-" }}{% endif %}</td>
</tr>
{% endfor %}
{% if object|userCanEdit:user %}
<tr>
<td>Actions</td>
{% with object.getAppName|add:":"|add:object.getClassName|lower|add:"-edit" as editView %}
{% with object.getAppName|add:":"|add:object.getClassName|lower|add:"-delete" as deleteView %}
<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 %}
</tr>
{% endif %}
</table>