2017-03-20 00:16:33 +01:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
|
|
|
{% load handletags %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-12">
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">{{ object }} <small>({{ object.getClassName }})</small></div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<table class="table">
|
|
|
|
{% for field in object|getFields:user %}
|
|
|
|
<tr>
|
|
|
|
<td>{{ field.0 }}</td>
|
2017-03-27 02:40:01 +02:00
|
|
|
<td>{% if field.1.through %}{{ field.1.all|linkObjects|default:"-" }}{% else %}{{ field.1|default:"-" }}{% endif %}</td>
|
2017-03-20 00:16:33 +01:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
{% if object|userCanEdit:user %}
|
|
|
|
<tr>
|
|
|
|
<td>Actions</td>
|
2017-03-27 02:40:01 +02:00
|
|
|
{% 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>
|
2017-03-20 00:16:33 +01:00
|
|
|
{% endwith %}
|
|
|
|
{% endwith %}
|
|
|
|
</tr>
|
|
|
|
{% endif %}
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|