2020-05-16 17:55:59 +00:00
|
|
|
{% 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">
|
2020-05-16 19:43:48 +00:00
|
|
|
{% if object_list %}
|
2020-05-16 17:55:59 +00:00
|
|
|
<div class="pf-c-toolbar" id="page-layout-table-simple-toolbar-top">
|
2020-05-16 19:11:38 +00:00
|
|
|
<div class="pf-c-toolbar__bulk-select">
|
2020-05-16 17:55:59 +00:00
|
|
|
<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">
|
2020-05-19 18:29:02 +00:00
|
|
|
<th role="columnheader" scope="col">{% trans 'Enabled' %}</th>
|
|
|
|
<th role="columnheader" scope="col">{% trans 'Policy' %}</th>
|
|
|
|
<th role="columnheader" scope="col">{% trans 'Target' %}</th>
|
2020-05-16 17:55:59 +00:00
|
|
|
<th role="cell"></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
2020-05-19 18:29:02 +00:00
|
|
|
<tbody role="rowgroup" class="pf-m-expanded">
|
2020-05-16 17:55:59 +00:00
|
|
|
{% for binding in object_list %}
|
2020-05-19 18:29:02 +00:00
|
|
|
<tr role="row pf-c-table__expandable-row pf-m-expanded">
|
|
|
|
<th role="cell">
|
|
|
|
<div>{{ binding.enabled }}</div>
|
|
|
|
</th>
|
|
|
|
<th role="cell">
|
|
|
|
<div>{{ binding.policy }}</div>
|
|
|
|
</th>
|
|
|
|
<th role="cell">
|
|
|
|
<div>{{ binding.target|verbose_name }}</div>
|
2020-05-16 17:55:59 +00:00
|
|
|
</th>
|
|
|
|
<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>
|
2020-05-16 19:43:48 +00:00
|
|
|
{% else %}
|
|
|
|
<div class="pf-c-empty-state">
|
2020-06-09 07:52:25 +00:00
|
|
|
<div class="pf-c-empty-state__content">
|
|
|
|
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i>
|
|
|
|
<h1 class="pf-c-title pf-m-lg">
|
|
|
|
{% trans 'No Policy Bindings.' %}
|
|
|
|
</h1>
|
|
|
|
<div class="pf-c-empty-state__body">
|
|
|
|
{% trans 'Currently no policy bindings exist. Click the button below to create one.' %}
|
|
|
|
</div>
|
|
|
|
<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>
|
2020-05-16 19:43:48 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2020-05-16 17:55:59 +00:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
{% endblock %}
|