20 lines
749 B
HTML
20 lines
749 B
HTML
{% load handletags %}
|
|
<table class="table">
|
|
{% 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 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>
|