This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/passbook/admin/templates/administration/user/list.html

126 lines
5.5 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-user"></i>
{% trans 'Users' %}
</h1>
</div>
</section>
<section class="pf-c-page__main-section pf-m-no-padding-mobile">
<div class="pf-c-card">
{% if object_list %}
<div class="pf-c-toolbar">
<div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select">
<pb-modal-button href="{% url 'passbook_admin:user-create' %}">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<button role="pb-refresh" class="pf-c-button pf-m-primary">
{% trans 'Refresh' %}
</button>
</div>
{% include 'partials/pagination.html' %}
</div>
</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 '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>
<pb-modal-button href="{% url 'passbook_admin:user-update' pk=user.pk %}">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
{% if user.is_active %}
<pb-modal-button href="{% url 'passbook_admin:user-disable' pk=user.pk %}">
<pb-spinner-button slot="trigger" class="pf-m-warning">
{% trans 'Disable' %}
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
{% else %}
<pb-modal-button href="{% url 'passbook_admin:user-delete' pk=user.pk %}">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Enable' %}
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
{% endif %}
<a class="pf-c-button pf-m-tertiary pb-root-link" href="{% url 'passbook_admin:user-password-reset' pk=user.pk %}?back={{ request.get_full_path }}">{% trans 'Reset Password' %}</a>
<a class="pf-c-button pf-m-tertiary pb-root-link" href="{% url 'passbook_core:impersonate-init' user_id=user.pk %}">{% trans 'Impersonate' %}</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="pf-c-pagination pf-m-bottom">
{% include 'partials/pagination.html' %}
</div>
{% else %}
<div class="pf-c-toolbar">
<div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
</div>
</div>
<div class="pf-c-empty-state">
<div class="pf-c-empty-state__content">
<i class="pf-icon pf-icon-user pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg">
{% trans 'No Users.' %}
</h1>
<div class="pf-c-empty-state__body">
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any users." %}
{% else %}
{% trans 'Currently no users exist. How did you even get here.' %}
{% endif %}
</div>
<pb-modal-button href="{% url 'passbook_admin:user-create' %}">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</div>
</div>
{% endif %}
</div>
</section>
{% endblock %}