dnmgmt/templates/whoisdb/handle_table.html

20 lines
761 B
HTML
Raw Normal View History

2017-03-27 13:29:32 +02:00
{% load handletags %}
2017-03-28 02:05:30 +02:00
<table class="table table-hover">
2017-03-27 13:29:32 +02:00
{% for field in object|getFields:user %}
<tr>
<td>{{ field.0 }}</td>
2017-03-28 01:56:10 +02:00
<td>{% if field.1.through %}{{ field.1.all|linkObjects|default:"-" }}{% else %}{{ field.1|tryLinkHandle|default:"-" }}{% endif %}</td>
2017-03-27 13:29:32 +02:00
</tr>
{% endfor %}
{% if object|userCanEdit:user %}
<tr>
<td>Actions</td>
{% with request.resolver_match.namespaces.0|add:":"|add:object.getClassName|lower|add:"-edit" as editView %}
{% with request.resolver_match.namespaces.0|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>
{% endwith %}
{% endwith %}
</tr>
{% endif %}
</table>