2018-11-26 21:08:48 +00:00
|
|
|
{% extends "administration/base.html" %}
|
|
|
|
|
|
|
|
{% load i18n %}
|
2020-05-15 08:54:31 +00:00
|
|
|
{% load passbook_utils %}
|
2018-11-26 21:08:48 +00:00
|
|
|
|
|
|
|
{% block content %}
|
2020-02-21 13:20:16 +00:00
|
|
|
<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 'Policies' %}
|
|
|
|
</h1>
|
2020-05-10 16:44:58 +00:00
|
|
|
<p>{% trans "Allow users to use Applications based on properties, enforce Password Criteria and selectively apply Stages." %}</p>
|
2020-02-21 13:20:16 +00:00
|
|
|
</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-06-09 11:40:03 +00:00
|
|
|
<div class="pf-c-toolbar">
|
|
|
|
<div class="pf-c-toolbar__content">
|
2020-10-03 17:32:01 +00:00
|
|
|
{% include 'partials/toolbar_search.html' %}
|
2020-06-09 11:40:03 +00:00
|
|
|
<div class="pf-c-toolbar__bulk-select">
|
2020-11-20 21:15:46 +00:00
|
|
|
<pb-dropdown class="pf-c-dropdown">
|
2020-06-09 11:40:03 +00:00
|
|
|
<button class="pf-m-primary pf-c-dropdown__toggle" type="button">
|
|
|
|
<span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
|
|
|
|
<i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
|
|
|
|
</button>
|
|
|
|
<ul class="pf-c-dropdown__menu" hidden>
|
|
|
|
{% for type, name in types.items %}
|
|
|
|
<li>
|
2020-11-21 15:16:34 +00:00
|
|
|
<pb-modal-button href="{% url 'passbook_admin:policy-create' %}?type={{ type }}">
|
|
|
|
<button slot="trigger" class="pf-c-dropdown__menu-item">
|
|
|
|
{{ name|verbose_name }}<br>
|
|
|
|
<small>
|
|
|
|
{{ name|doc }}
|
|
|
|
</small>
|
|
|
|
</button>
|
|
|
|
<div slot="modal"></div>
|
|
|
|
</pb-modal-button>
|
2020-06-09 11:40:03 +00:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
2020-11-20 21:15:46 +00:00
|
|
|
</pb-dropdown>
|
2020-02-21 13:20:16 +00:00
|
|
|
</div>
|
2020-06-09 11:40:03 +00:00
|
|
|
{% include 'partials/pagination.html' %}
|
2020-02-21 13:20:16 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-02-21 19:24:02 +00:00
|
|
|
<table class="pf-c-table pf-m-compact pf-m-grid-xl" role="grid">
|
2020-02-21 13:20:16 +00:00
|
|
|
<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 policy in object_list %}
|
|
|
|
<tr role="row">
|
|
|
|
<th role="columnheader">
|
|
|
|
<div>
|
|
|
|
<div>{{ policy.name }}</div>
|
2020-09-14 13:44:33 +00:00
|
|
|
{% if not policy.bindings.exists and not policy.promptstage_set.exists %}
|
2020-02-21 13:20:16 +00:00
|
|
|
<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>
|
2020-05-16 17:00:43 +00:00
|
|
|
<small>{% blocktrans with object_count=policy.bindings.all|length %}Assigned to {{ object_count }} objects.{% endblocktrans %}</small>
|
2020-02-21 13:20:16 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</th>
|
|
|
|
<td role="cell">
|
|
|
|
<span>
|
|
|
|
{{ policy|verbose_name }}
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
<td>
|
2020-11-21 15:16:34 +00:00
|
|
|
<pb-modal-button href="{% url 'passbook_admin:policy-update' pk=policy.pk %}">
|
2020-11-29 17:46:45 +00:00
|
|
|
<pb-spinner-button slot="trigger" class="pf-m-secondary">
|
2020-11-21 15:16:34 +00:00
|
|
|
{% trans 'Edit' %}
|
2020-11-29 17:46:45 +00:00
|
|
|
</pb-spinner-button>
|
2020-11-21 15:16:34 +00:00
|
|
|
<div slot="modal"></div>
|
|
|
|
</pb-modal-button>
|
|
|
|
<pb-modal-button href="{% url 'passbook_admin:policy-test' pk=policy.pk %}">
|
2020-11-29 17:46:45 +00:00
|
|
|
<pb-spinner-button slot="trigger" class="pf-m-tertiary">
|
2020-11-21 15:16:34 +00:00
|
|
|
{% trans 'Test' %}
|
2020-11-29 17:46:45 +00:00
|
|
|
</pb-spinner-button>
|
2020-11-21 15:16:34 +00:00
|
|
|
<div slot="modal"></div>
|
|
|
|
</pb-modal-button>
|
|
|
|
<pb-modal-button href="{% url 'passbook_admin:policy-delete' pk=policy.pk %}">
|
2020-11-29 17:46:45 +00:00
|
|
|
<pb-spinner-button slot="trigger" class="pf-m-danger">
|
2020-11-21 15:16:34 +00:00
|
|
|
{% trans 'Delete' %}
|
2020-11-29 17:46:45 +00:00
|
|
|
</pb-spinner-button>
|
2020-11-21 15:16:34 +00:00
|
|
|
<div slot="modal"></div>
|
|
|
|
</pb-modal-button>
|
2020-02-21 13:20:16 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-10-03 15:50:17 +00:00
|
|
|
<div class="pf-c-pagination pf-m-bottom">
|
2020-02-21 13:20:16 +00:00
|
|
|
{% include 'partials/pagination.html' %}
|
|
|
|
</div>
|
2020-05-16 19:43:48 +00:00
|
|
|
{% else %}
|
2020-10-03 17:32:01 +00:00
|
|
|
<div class="pf-c-toolbar">
|
|
|
|
<div class="pf-c-toolbar__content">
|
|
|
|
{% include 'partials/toolbar_search.html' %}
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-05-16 19:43:48 +00:00
|
|
|
<div class="pf-c-empty-state">
|
2020-06-09 07:52:25 +00:00
|
|
|
<div class="pf-c-empty-state__content">
|
2020-10-03 17:32:01 +00:00
|
|
|
<i class="pf-icon pf-icon-infrastructure pf-c-empty-state__icon" aria-hidden="true"></i>
|
2020-06-09 07:52:25 +00:00
|
|
|
<h1 class="pf-c-title pf-m-lg">
|
|
|
|
{% trans 'No Policies.' %}
|
|
|
|
</h1>
|
|
|
|
<div class="pf-c-empty-state__body">
|
2020-10-03 17:32:01 +00:00
|
|
|
{% if request.GET.search != "" %}
|
|
|
|
{% trans "Your search query doesn't match any policies." %}
|
|
|
|
{% else %}
|
2020-06-09 07:52:25 +00:00
|
|
|
{% trans 'Currently no policies exist. Click the button below to create one.' %}
|
2020-10-03 17:32:01 +00:00
|
|
|
{% endif %}
|
2020-06-09 07:52:25 +00:00
|
|
|
</div>
|
2020-11-20 21:15:46 +00:00
|
|
|
<pb-dropdown class="pf-c-dropdown">
|
2020-06-09 07:52:25 +00:00
|
|
|
<button class="pf-m-primary pf-c-dropdown__toggle" type="button">
|
|
|
|
<span class="pf-c-dropdown__toggle-text">{% trans 'Create' %}</span>
|
|
|
|
<i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
|
|
|
|
</button>
|
|
|
|
<ul class="pf-c-dropdown__menu" hidden>
|
|
|
|
{% for type, name in types.items %}
|
|
|
|
<li>
|
2020-11-21 15:16:34 +00:00
|
|
|
<pb-modal-button href="{% url 'passbook_admin:policy-create' %}?type={{ type }}">
|
|
|
|
<button slot="trigger" class="pf-c-dropdown__menu-item">
|
|
|
|
{{ name|verbose_name }}<br>
|
|
|
|
<small>
|
|
|
|
{{ name|doc }}
|
|
|
|
</small>
|
|
|
|
</button>
|
|
|
|
<div slot="modal"></div>
|
|
|
|
</pb-modal-button>
|
2020-06-09 07:52:25 +00:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
2020-11-20 21:15:46 +00:00
|
|
|
</pb-dropdown>
|
2020-05-16 19:43:48 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2019-02-25 12:31:11 +00:00
|
|
|
</div>
|
2020-02-21 13:20:16 +00:00
|
|
|
</section>
|
2019-02-16 09:24:31 +00:00
|
|
|
{% endblock %}
|