67 lines
3.0 KiB
HTML
67 lines
3.0 KiB
HTML
{% extends "administration/base.html" %}
|
|
|
|
{% load i18n %}
|
|
{% load passbook_utils %}
|
|
|
|
{% block content %}
|
|
<section class="pf-c-page__main-section pf-m-light">
|
|
<div class="pf-c-content">
|
|
<h1>
|
|
<i class="pf-icon pf-icon-infrastructure"></i>
|
|
{% trans 'Policy Bindings' %}
|
|
</h1>
|
|
<p>{% trans "Bind existing Policies to Models accepting policies." %}</p>
|
|
</div>
|
|
</section>
|
|
<section class="pf-c-page__main-section pf-m-no-padding-mobile">
|
|
<div class="pf-c-card">
|
|
<div class="pf-c-toolbar" id="page-layout-table-simple-toolbar-top">
|
|
<div class="pf-c-toolbar__action-group">
|
|
<a href="{% url 'passbook_admin:policy-binding-create' %}?back={{ request.get_full_path }}"
|
|
class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
|
|
</div>
|
|
{% include 'partials/pagination.html' %}
|
|
</div>
|
|
<table class="pf-c-table pf-m-compact pf-m-grid-xl" role="grid">
|
|
<thead>
|
|
<tr role="row">
|
|
<th role="columnheader" scope="col">{% trans 'Name' %}</th>
|
|
<th role="columnheader" scope="col">{% trans 'Type' %}</th>
|
|
<th role="cell"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody role="rowgroup">
|
|
{% for binding in object_list %}
|
|
<tr role="row">
|
|
<th role="columnheader">
|
|
<div>
|
|
<div>{{ binding.name }}</div>
|
|
{% if not binding.bindings.exists %}
|
|
<i class="pf-icon pf-icon-warning-triangle"></i>
|
|
<small>{% trans 'Warning: Policy is not assigned.' %}</small>
|
|
{% else %}
|
|
<i class="pf-icon pf-icon-ok"></i>
|
|
<small>{% blocktrans with object_count=binding.bindings.all|length %}Assigned to {{ object_count }} objects.{% endblocktrans %}</small>
|
|
{% endif %}
|
|
</div>
|
|
</th>
|
|
<td role="cell">
|
|
<span>
|
|
{{ binding|verbose_name }}
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:policy-binding-update' pk=binding.pk %}?back={{ request.get_full_path }}">{% trans 'Edit' %}</a>
|
|
<a class="pf-c-button pf-m-danger" href="{% url 'passbook_admin:policy-binding-delete' pk=binding.pk %}?back={{ request.get_full_path }}">{% trans 'Delete' %}</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
<div class="pf-c-toolbar" id="page-layout-table-simple-toolbar-bottom">
|
|
{% include 'partials/pagination.html' %}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
{% endblock %}
|