Only show delete/edit buttons in header if user is allowed to edit the object
This commit is contained in:
parent
619ee3bc58
commit
098c45e241
|
@ -1,13 +1,17 @@
|
||||||
|
{% load handletags %}
|
||||||
|
|
||||||
{% 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 %}
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
{{ object }} <small>({{ object.getClassName }})</small>
|
{{ object }} <small>({{ object.getClassName }})</small>
|
||||||
|
{% if object|userCanEdit:request.user %}
|
||||||
<span class="pull-right">
|
<span class="pull-right">
|
||||||
<a href="{% url editView object.getPK %}"><span class="glyphicon glyphicon-pencil"></span></a>
|
<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>
|
<a href="{% url deleteView object.getPK %}"><span class="glyphicon glyphicon-trash"></span></a>
|
||||||
</span>
|
</span>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{% include "whoisdb/handle_table.html" with object=object %}
|
{% include "whoisdb/handle_table.html" with object=object %}
|
||||||
|
|
Loading…
Reference in New Issue