dnmgmt/templates/whoisdb/handle_table.html

29 lines
1.2 KiB
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>
{% if object.getClassName == "Domain" %}
<a href="{% url "domains:domain-check" object.getZone %}"><span title="Check DNS" class="glyphicon glyphicon-check"></span></a>
{% elif object.getClassName == "ReverseZone" %}
<a href="{% url "domains:reversezone-check" object.getPK %}"><span title="Check DNS" class="glyphicon glyphicon-check"></span></a>
{% endif %}
<a href="{% url editView object.getPK %}"><span title="Edit" class="glyphicon glyphicon-pencil"></span></a>
<a href="{% url deleteView object.getPK %}"><span title="Delete" class="glyphicon glyphicon-trash"></span></a>
</td>
{% endwith %}
{% endwith %}
</tr>
{% endif %}
</table>