2018-12-14 13:24:04 +00:00
|
|
|
{% extends "administration/base.html" %}
|
|
|
|
|
|
|
|
{% load i18n %}
|
2020-05-15 08:54:31 +00:00
|
|
|
{% load passbook_utils %}
|
2018-12-14 13:24:04 +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-user"></i>
|
|
|
|
{% trans 'Users' %}
|
|
|
|
</h1>
|
|
|
|
</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-21 15:16:34 +00:00
|
|
|
<pb-modal-button href="{% url 'passbook_admin:user-create' %}">
|
|
|
|
<button slot="trigger" class="pf-c-button pf-m-primary">
|
|
|
|
{% trans 'Create' %}
|
|
|
|
</button>
|
|
|
|
<div slot="modal"></div>
|
|
|
|
</pb-modal-button>
|
|
|
|
<button role="pb-refresh" class="pf-c-button pf-m-primary">
|
|
|
|
{% trans 'Refresh' %}
|
|
|
|
</button>
|
2020-06-09 11:40:03 +00:00
|
|
|
</div>
|
|
|
|
{% 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 'Active' %}</th>
|
|
|
|
<th role="columnheader" scope="col">{% trans 'Last Login' %}</th>
|
|
|
|
<th role="cell"></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody role="rowgroup">
|
|
|
|
{% for user in object_list %}
|
|
|
|
<tr role="row">
|
|
|
|
<th role="columnheader">
|
|
|
|
<div>
|
|
|
|
<div>{{ user.username }}</div>
|
|
|
|
<small>{{ user.name }}</small>
|
|
|
|
</div>
|
|
|
|
</th>
|
|
|
|
<td role="cell">
|
|
|
|
<span>
|
|
|
|
{{ user.is_active }}
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
<td role="cell">
|
|
|
|
<span>
|
|
|
|
{{ user.last_login }}
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
<td>
|
2020-11-21 15:16:34 +00:00
|
|
|
<pb-modal-button href="{% url 'passbook_admin:user-update' pk=user.pk %}">
|
|
|
|
<button slot="trigger" class="pf-c-button pf-m-secondary">
|
|
|
|
{% trans 'Update' %}
|
|
|
|
</button>
|
|
|
|
<div slot="modal"></div>
|
|
|
|
</pb-modal-button>
|
2020-10-11 19:54:00 +00:00
|
|
|
{% if user.is_active %}
|
2020-11-21 15:16:34 +00:00
|
|
|
<pb-modal-button href="{% url 'passbook_admin:user-disable' pk=user.pk %}">
|
|
|
|
<button slot="trigger" class="pf-c-button pf-m-warning">
|
|
|
|
{% trans 'Disable' %}
|
|
|
|
</button>
|
|
|
|
<div slot="modal"></div>
|
|
|
|
</pb-modal-button>
|
2020-10-11 19:54:00 +00:00
|
|
|
{% else %}
|
2020-11-21 15:16:34 +00:00
|
|
|
<pb-modal-button href="{% url 'passbook_admin:user-delete' pk=user.pk %}">
|
|
|
|
<button slot="trigger" class="pf-c-button pf-m-primary">
|
|
|
|
{% trans 'Enable' %}
|
|
|
|
</button>
|
|
|
|
<div slot="modal"></div>
|
|
|
|
</pb-modal-button>
|
2020-10-11 19:54:00 +00:00
|
|
|
{% endif %}
|
2020-02-21 13:20:16 +00:00
|
|
|
<a class="pf-c-button pf-m-tertiary" href="{% url 'passbook_admin:user-password-reset' pk=user.pk %}?back={{ request.get_full_path }}">{% trans 'Reset Password' %}</a>
|
2020-09-17 14:24:53 +00:00
|
|
|
<a class="pf-c-button pf-m-tertiary" href="{% url 'passbook_core:impersonate-init' user_id=user.pk %}">{% trans 'Impersonate' %}</a>
|
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-user 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 Users.' %}
|
|
|
|
</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 users." %}
|
|
|
|
{% else %}
|
2020-06-09 07:52:25 +00:00
|
|
|
{% trans 'Currently no users exist. How did you even get here.' %}
|
2020-10-03 17:32:01 +00:00
|
|
|
{% endif %}
|
2020-06-09 07:52:25 +00:00
|
|
|
</div>
|
2020-11-21 15:16:34 +00:00
|
|
|
<pb-modal-button href="{% url 'passbook_admin:user-create' %}">
|
|
|
|
<button slot="trigger" class="pf-c-button pf-m-primary">
|
|
|
|
{% trans 'Create' %}
|
|
|
|
</button>
|
|
|
|
<div slot="modal"></div>
|
|
|
|
</pb-modal-button>
|
2020-05-16 19:43:48 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2020-02-21 13:20:16 +00:00
|
|
|
</div>
|
|
|
|
</section>
|
2018-12-14 13:24:04 +00:00
|
|
|
{% endblock %}
|