admin: implement search for all views

see #253
This commit is contained in:
Jens Langhammer 2020-10-03 19:32:01 +02:00
parent 0150a5c58c
commit b0602a3215
28 changed files with 275 additions and 31 deletions

View File

@ -18,6 +18,7 @@
{% if object_list %} {% if object_list %}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select"> <div class="pf-c-toolbar__bulk-select">
<a href="{% url 'passbook_admin:application-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> <a href="{% url 'passbook_admin:application-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
</div> </div>
@ -66,14 +67,23 @@
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
{% else %} {% 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">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i> <i class="pf-icon pf-icon-applications pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
{% trans 'No Applications.' %} {% trans 'No Applications.' %}
</h1> </h1>
<div class="pf-c-empty-state__body"> <div class="pf-c-empty-state__body">
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any application." %}
{% else %}
{% trans 'Currently no applications exist. Click the button below to create one.' %} {% trans 'Currently no applications exist. Click the button below to create one.' %}
{% endif %}
</div> </div>
<a href="{% url 'passbook_admin:application-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> <a href="{% url 'passbook_admin:application-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
</div> </div>

View File

@ -18,6 +18,7 @@
{% if object_list %} {% if object_list %}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select"> <div class="pf-c-toolbar__bulk-select">
<a href="{% url 'passbook_admin:certificatekeypair-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> <a href="{% url 'passbook_admin:certificatekeypair-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
</div> </div>
@ -68,14 +69,23 @@
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
{% else %} {% 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">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i> <i class="pf-icon pf-icon-key pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
{% trans 'No Certificates.' %} {% trans 'No Certificates.' %}
</h1> </h1>
<div class="pf-c-empty-state__body"> <div class="pf-c-empty-state__body">
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any certificates." %}
{% else %}
{% trans 'Currently no certificates exist. Click the button below to create one.' %} {% trans 'Currently no certificates exist. Click the button below to create one.' %}
{% endif %}
</div> </div>
<a href="{% url 'passbook_admin:certificatekeypair-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> <a href="{% url 'passbook_admin:certificatekeypair-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
</div> </div>

View File

@ -18,6 +18,7 @@
{% if object_list %} {% if object_list %}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select"> <div class="pf-c-toolbar__bulk-select">
<a href="{% url 'passbook_admin:flow-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> <a href="{% url 'passbook_admin:flow-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
<a href="{% url 'passbook_admin:flow-import' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-secondary" type="button">{% trans 'Import' %}</a> <a href="{% url 'passbook_admin:flow-import' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-secondary" type="button">{% trans 'Import' %}</a>
@ -73,14 +74,23 @@
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
{% else %} {% 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">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i> <i class="pf-icon pf-icon-process-automation pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
{% trans 'No Flows.' %} {% trans 'No Flows.' %}
</h1> </h1>
<div class="pf-c-empty-state__body"> <div class="pf-c-empty-state__body">
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any flows." %}
{% else %}
{% trans 'Currently no flows exist. Click the button below to create one.' %} {% trans 'Currently no flows exist. Click the button below to create one.' %}
{% endif %}
</div> </div>
<a href="{% url 'passbook_admin:flow-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> <a href="{% url 'passbook_admin:flow-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
<a href="{% url 'passbook_admin:flow-import' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Import' %}</a> <a href="{% url 'passbook_admin:flow-import' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Import' %}</a>

View File

@ -19,6 +19,7 @@
{% if object_list %} {% if object_list %}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select"> <div class="pf-c-toolbar__bulk-select">
<a href="{% url 'passbook_admin:group-create' %}?back={{ request.get_full_path }}" <a href="{% url 'passbook_admin:group-create' %}?back={{ request.get_full_path }}"
class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
@ -65,14 +66,23 @@
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
{% else %} {% 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">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i> <i class="pf-icon pf-icon-users pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
{% trans 'No Groups.' %} {% trans 'No Groups.' %}
</h1> </h1>
<div class="pf-c-empty-state__body"> <div class="pf-c-empty-state__body">
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any groups." %}
{% else %}
{% trans 'Currently no group exist. Click the button below to create one.' %} {% trans 'Currently no group exist. Click the button below to create one.' %}
{% endif %}
</div> </div>
<a href="{% url 'passbook_admin:group-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> <a href="{% url 'passbook_admin:group-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
</div> </div>

View File

@ -20,6 +20,7 @@
{% if object_list %} {% if object_list %}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select"> <div class="pf-c-toolbar__bulk-select">
<a href="{% url 'passbook_admin:outpost-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> <a href="{% url 'passbook_admin:outpost-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
</div> </div>
@ -87,14 +88,23 @@
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
{% else %} {% 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">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i> <i class="fas fa-map-marker pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
{% trans 'No Outposts.' %} {% trans 'No Outposts.' %}
</h1> </h1>
<div class="pf-c-empty-state__body"> <div class="pf-c-empty-state__body">
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any outposts." %}
{% else %}
{% trans 'Currently no outposts exist. Click the button below to create one.' %} {% trans 'Currently no outposts exist. Click the button below to create one.' %}
{% endif %}
</div> </div>
<a href="{% url 'passbook_admin:outpost-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> <a href="{% url 'passbook_admin:outpost-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
</div> </div>

View File

@ -18,6 +18,7 @@
{% if object_list %} {% if object_list %}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select"> <div class="pf-c-toolbar__bulk-select">
<div class="pf-c-dropdown"> <div class="pf-c-dropdown">
<button class="pf-m-primary pf-c-dropdown__toggle" type="button"> <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
@ -82,14 +83,23 @@
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
{% else %} {% 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">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i> <i class="pf-icon pf-icon-infrastructure pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
{% trans 'No Policies.' %} {% trans 'No Policies.' %}
</h1> </h1>
<div class="pf-c-empty-state__body"> <div class="pf-c-empty-state__body">
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any policies." %}
{% else %}
{% trans 'Currently no policies exist. Click the button below to create one.' %} {% trans 'Currently no policies exist. Click the button below to create one.' %}
{% endif %}
</div> </div>
<div class="pf-c-dropdown"> <div class="pf-c-dropdown">
<button class="pf-m-primary pf-c-dropdown__toggle" type="button"> <button class="pf-m-primary pf-c-dropdown__toggle" type="button">

View File

@ -19,6 +19,7 @@
{% if object_list %} {% if object_list %}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select"> <div class="pf-c-toolbar__bulk-select">
<div class="pf-c-dropdown"> <div class="pf-c-dropdown">
<button class="pf-m-primary pf-c-dropdown__toggle" type="button"> <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
@ -76,14 +77,23 @@
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
{% else %} {% 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">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i> <i class="pf-icon pf-icon-blueprint pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
{% trans 'No Property Mappings.' %} {% trans 'No Property Mappings.' %}
</h1> </h1>
<div class="pf-c-empty-state__body"> <div class="pf-c-empty-state__body">
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any property mappings." %}
{% else %}
{% trans 'Currently no property mappings exist. Click the button below to create one.' %} {% trans 'Currently no property mappings exist. Click the button below to create one.' %}
{% endif %}
</div> </div>
<div class="pf-c-dropdown"> <div class="pf-c-dropdown">
<button class="pf-m-primary pf-c-dropdown__toggle" type="button"> <button class="pf-m-primary pf-c-dropdown__toggle" type="button">

View File

@ -20,6 +20,7 @@
{% if object_list %} {% if object_list %}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select"> <div class="pf-c-toolbar__bulk-select">
<div class="pf-c-dropdown"> <div class="pf-c-dropdown">
<button class="pf-m-primary pf-c-dropdown__toggle" type="button"> <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
@ -95,14 +96,23 @@
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
{% else %} {% 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">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i> <i class="pf-icon-integration pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
{% trans 'No Providers.' %} {% trans 'No Providers.' %}
</h1> </h1>
<div class="pf-c-empty-state__body"> <div class="pf-c-empty-state__body">
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any providers." %}
{% else %}
{% trans 'Currently no providers exist. Click the button below to create one.' %} {% trans 'Currently no providers exist. Click the button below to create one.' %}
{% endif %}
</div> </div>
<div class="pf-c-dropdown"> <div class="pf-c-dropdown">
<button class="pf-m-primary pf-c-dropdown__toggle" type="button"> <button class="pf-m-primary pf-c-dropdown__toggle" type="button">

View File

@ -20,6 +20,7 @@
{% if object_list %} {% if object_list %}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select"> <div class="pf-c-toolbar__bulk-select">
<div class="pf-c-dropdown"> <div class="pf-c-dropdown">
<button class="pf-m-primary pf-c-dropdown__toggle" type="button"> <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
@ -89,14 +90,23 @@
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
{% else %} {% 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">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i> <i class="pf-icon pf-icon-middleware pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
{% trans 'No Sources.' %} {% trans 'No Sources.' %}
</h1> </h1>
<div class="pf-c-empty-state__body"> <div class="pf-c-empty-state__body">
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any sources." %}
{% else %}
{% trans 'Currently no sources exist. Click the button below to create one.' %} {% trans 'Currently no sources exist. Click the button below to create one.' %}
{% endif %}
</div> </div>
<div class="pf-c-dropdown"> <div class="pf-c-dropdown">
<button class="pf-m-primary pf-c-dropdown__toggle" type="button"> <button class="pf-m-primary pf-c-dropdown__toggle" type="button">

View File

@ -11,8 +11,7 @@
<i class="pf-icon pf-icon-plugged"></i> <i class="pf-icon pf-icon-plugged"></i>
{% trans 'Stages' %} {% trans 'Stages' %}
</h1> </h1>
<p>{% trans "Stages are single steps of a Flow that a user is guided through." %} <p>{% trans "Stages are single steps of a Flow that a user is guided through." %}</p>
</p>
</div> </div>
</section> </section>
<section class="pf-c-page__main-section pf-m-no-padding-mobile"> <section class="pf-c-page__main-section pf-m-no-padding-mobile">
@ -20,6 +19,7 @@
{% if object_list %} {% if object_list %}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select"> <div class="pf-c-toolbar__bulk-select">
<div class="pf-c-dropdown"> <div class="pf-c-dropdown">
<button class="pf-m-primary pf-c-dropdown__toggle" type="button"> <button class="pf-m-primary pf-c-dropdown__toggle" type="button">
@ -85,14 +85,23 @@
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
{% else %} {% 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">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i> <i class="pf-icon pf-icon-plugged pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
{% trans 'No Stages.' %} {% trans 'No Stages.' %}
</h1> </h1>
<div class="pf-c-empty-state__body"> <div class="pf-c-empty-state__body">
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any stages." %}
{% else %}
{% trans 'Currently no stages exist. Click the button below to create one.' %} {% trans 'Currently no stages exist. Click the button below to create one.' %}
{% endif %}
</div> </div>
<div class="pf-c-dropdown"> <div class="pf-c-dropdown">
<button class="pf-m-primary pf-c-dropdown__toggle" type="button"> <button class="pf-m-primary pf-c-dropdown__toggle" type="button">

View File

@ -19,6 +19,7 @@
{% if object_list %} {% if object_list %}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select"> <div class="pf-c-toolbar__bulk-select">
<a href="{% url 'passbook_admin:stage-invitation-create' %}?back={{ request.get_full_path }}" <a href="{% url 'passbook_admin:stage-invitation-create' %}?back={{ request.get_full_path }}"
class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
@ -58,14 +59,23 @@
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
{% else %} {% 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">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i> <i class="pf-icon pf-icon-migration pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
{% trans 'No Invitations.' %} {% trans 'No Invitations.' %}
</h1> </h1>
<div class="pf-c-empty-state__body"> <div class="pf-c-empty-state__body">
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any invitations." %}
{% else %}
{% trans 'Currently no invitations exist. Click the button below to create one.' %} {% trans 'Currently no invitations exist. Click the button below to create one.' %}
{% endif %}
</div> </div>
<a href="{% url 'passbook_admin:stage-invitation-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> <a href="{% url 'passbook_admin:stage-invitation-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
</div> </div>

View File

@ -19,6 +19,7 @@
{% if object_list %} {% if object_list %}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select"> <div class="pf-c-toolbar__bulk-select">
<a href="{% url 'passbook_admin:stage-prompt-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> <a href="{% url 'passbook_admin:stage-prompt-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
</div> </div>
@ -84,14 +85,23 @@
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
{% else %} {% 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">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i> <i class="pf-icon pf-icon-plugged pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
{% trans 'No Stage Prompts.' %} {% trans 'No Stage Prompts.' %}
</h1> </h1>
<div class="pf-c-empty-state__body"> <div class="pf-c-empty-state__body">
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any stage prompts." %}
{% else %}
{% trans 'Currently no stage prompts exist. Click the button below to create one.' %} {% trans 'Currently no stage prompts exist. Click the button below to create one.' %}
{% endif %}
</div> </div>
<a href="{% url 'passbook_admin:stage-prompt-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> <a href="{% url 'passbook_admin:stage-prompt-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
</div> </div>

View File

@ -18,6 +18,7 @@
{% if object_list %} {% if object_list %}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
</div> </div>
@ -69,14 +70,23 @@
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
{% else %} {% 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">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i> <i class="fas fa-key pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
{% trans 'No Tokens.' %} {% trans 'No Tokens.' %}
</h1> </h1>
<div class="pf-c-empty-state__body"> <div class="pf-c-empty-state__body">
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any token." %}
{% else %}
{% trans 'Currently no tokens exist.' %} {% trans 'Currently no tokens exist.' %}
{% endif %}
</div> </div>
</div> </div>
</div> </div>

View File

@ -17,6 +17,7 @@
{% if object_list %} {% if object_list %}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select"> <div class="pf-c-toolbar__bulk-select">
<a href="{% url 'passbook_admin:user-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> <a href="{% url 'passbook_admin:user-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
</div> </div>
@ -65,14 +66,23 @@
{% include 'partials/pagination.html' %} {% include 'partials/pagination.html' %}
</div> </div>
{% else %} {% 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">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="fas fa-cubes pf-c-empty-state__icon" aria-hidden="true"></i> <i class="pf-icon pf-icon-user pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
{% trans 'No Users.' %} {% trans 'No Users.' %}
</h1> </h1>
<div class="pf-c-empty-state__body"> <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.' %} {% trans 'Currently no users exist. How did you even get here.' %}
{% endif %}
</div> </div>
<a href="{% url 'passbook_admin:user-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a> <a href="{% url 'passbook_admin:user-create' %}?back={{ request.get_full_path }}" class="pf-c-button pf-m-primary" type="button">{% trans 'Create' %}</a>
</div> </div>

View File

@ -12,6 +12,7 @@ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import ( from passbook.admin.views.utils import (
BackSuccessUrlMixin, BackSuccessUrlMixin,
DeleteMessageView, DeleteMessageView,
SearchListMixin,
UserPaginateListMixin, UserPaginateListMixin,
) )
from passbook.core.forms.applications import ApplicationForm from passbook.core.forms.applications import ApplicationForm
@ -20,7 +21,11 @@ from passbook.lib.views import CreateAssignPermView
class ApplicationListView( class ApplicationListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
ListView,
): ):
"""Show list of all applications""" """Show list of all applications"""
@ -29,6 +34,15 @@ class ApplicationListView(
ordering = "name" ordering = "name"
template_name = "administration/application/list.html" template_name = "administration/application/list.html"
search_fields = [
"name",
"slug",
"meta_launch_url",
"meta_icon_url",
"meta_description",
"meta_publisher",
]
class ApplicationCreateView( class ApplicationCreateView(
SuccessMessageMixin, SuccessMessageMixin,

View File

@ -12,6 +12,7 @@ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import ( from passbook.admin.views.utils import (
BackSuccessUrlMixin, BackSuccessUrlMixin,
DeleteMessageView, DeleteMessageView,
SearchListMixin,
UserPaginateListMixin, UserPaginateListMixin,
) )
from passbook.crypto.forms import CertificateKeyPairForm from passbook.crypto.forms import CertificateKeyPairForm
@ -20,7 +21,11 @@ from passbook.lib.views import CreateAssignPermView
class CertificateKeyPairListView( class CertificateKeyPairListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
ListView,
): ):
"""Show list of all keypairs""" """Show list of all keypairs"""
@ -29,6 +34,8 @@ class CertificateKeyPairListView(
ordering = "name" ordering = "name"
template_name = "administration/certificatekeypair/list.html" template_name = "administration/certificatekeypair/list.html"
search_fields = ["name"]
class CertificateKeyPairCreateView( class CertificateKeyPairCreateView(
SuccessMessageMixin, SuccessMessageMixin,

View File

@ -14,6 +14,7 @@ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import ( from passbook.admin.views.utils import (
BackSuccessUrlMixin, BackSuccessUrlMixin,
DeleteMessageView, DeleteMessageView,
SearchListMixin,
UserPaginateListMixin, UserPaginateListMixin,
) )
from passbook.flows.forms import FlowForm, FlowImportForm from passbook.flows.forms import FlowForm, FlowImportForm
@ -28,7 +29,11 @@ from passbook.lib.views import CreateAssignPermView
class FlowListView( class FlowListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
ListView,
): ):
"""Show list of all flows""" """Show list of all flows"""
@ -36,6 +41,7 @@ class FlowListView(
permission_required = "passbook_flows.view_flow" permission_required = "passbook_flows.view_flow"
ordering = "name" ordering = "name"
template_name = "administration/flow/list.html" template_name = "administration/flow/list.html"
search_fields = ["name", "slug", "designation", "title"]
class FlowCreateView( class FlowCreateView(

View File

@ -12,6 +12,7 @@ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import ( from passbook.admin.views.utils import (
BackSuccessUrlMixin, BackSuccessUrlMixin,
DeleteMessageView, DeleteMessageView,
SearchListMixin,
UserPaginateListMixin, UserPaginateListMixin,
) )
from passbook.core.forms.groups import GroupForm from passbook.core.forms.groups import GroupForm
@ -20,7 +21,11 @@ from passbook.lib.views import CreateAssignPermView
class GroupListView( class GroupListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
ListView,
): ):
"""Show list of all groups""" """Show list of all groups"""
@ -28,6 +33,7 @@ class GroupListView(
permission_required = "passbook_core.view_group" permission_required = "passbook_core.view_group"
ordering = "name" ordering = "name"
template_name = "administration/group/list.html" template_name = "administration/group/list.html"
search_fields = ["name", "attributes"]
class GroupCreateView( class GroupCreateView(

View File

@ -15,6 +15,7 @@ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import ( from passbook.admin.views.utils import (
BackSuccessUrlMixin, BackSuccessUrlMixin,
DeleteMessageView, DeleteMessageView,
SearchListMixin,
UserPaginateListMixin, UserPaginateListMixin,
) )
from passbook.lib.views import CreateAssignPermView from passbook.lib.views import CreateAssignPermView
@ -23,7 +24,11 @@ from passbook.outposts.models import Outpost, OutpostConfig
class OutpostListView( class OutpostListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
ListView,
): ):
"""Show list of all outposts""" """Show list of all outposts"""
@ -31,6 +36,7 @@ class OutpostListView(
permission_required = "passbook_outposts.view_outpost" permission_required = "passbook_outposts.view_outpost"
ordering = "name" ordering = "name"
template_name = "administration/outpost/list.html" template_name = "administration/outpost/list.html"
search_fields = ["name", "_config"]
class OutpostCreateView( class OutpostCreateView(

View File

@ -22,6 +22,7 @@ from passbook.admin.views.utils import (
InheritanceCreateView, InheritanceCreateView,
InheritanceListView, InheritanceListView,
InheritanceUpdateView, InheritanceUpdateView,
SearchListMixin,
UserPaginateListMixin, UserPaginateListMixin,
) )
from passbook.policies.models import Policy, PolicyBinding from passbook.policies.models import Policy, PolicyBinding
@ -29,7 +30,11 @@ from passbook.policies.process import PolicyProcess, PolicyRequest
class PolicyListView( class PolicyListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, InheritanceListView LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
InheritanceListView,
): ):
"""Show list of all policies""" """Show list of all policies"""
@ -37,6 +42,7 @@ class PolicyListView(
permission_required = "passbook_policies.view_policy" permission_required = "passbook_policies.view_policy"
ordering = "name" ordering = "name"
template_name = "administration/policy/list.html" template_name = "administration/policy/list.html"
search_fields = ["name"]
class PolicyCreateView( class PolicyCreateView(

View File

@ -14,13 +14,18 @@ from passbook.admin.views.utils import (
InheritanceCreateView, InheritanceCreateView,
InheritanceListView, InheritanceListView,
InheritanceUpdateView, InheritanceUpdateView,
SearchListMixin,
UserPaginateListMixin, UserPaginateListMixin,
) )
from passbook.core.models import PropertyMapping from passbook.core.models import PropertyMapping
class PropertyMappingListView( class PropertyMappingListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, InheritanceListView LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
InheritanceListView,
): ):
"""Show list of all property_mappings""" """Show list of all property_mappings"""
@ -28,6 +33,7 @@ class PropertyMappingListView(
permission_required = "passbook_core.view_propertymapping" permission_required = "passbook_core.view_propertymapping"
template_name = "administration/property_mapping/list.html" template_name = "administration/property_mapping/list.html"
ordering = "name" ordering = "name"
search_fields = ["name", "expression"]
class PropertyMappingCreateView( class PropertyMappingCreateView(

View File

@ -14,13 +14,18 @@ from passbook.admin.views.utils import (
InheritanceCreateView, InheritanceCreateView,
InheritanceListView, InheritanceListView,
InheritanceUpdateView, InheritanceUpdateView,
SearchListMixin,
UserPaginateListMixin, UserPaginateListMixin,
) )
from passbook.core.models import Provider from passbook.core.models import Provider
class ProviderListView( class ProviderListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, InheritanceListView LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
InheritanceListView,
): ):
"""Show list of all providers""" """Show list of all providers"""
@ -28,6 +33,7 @@ class ProviderListView(
permission_required = "passbook_core.add_provider" permission_required = "passbook_core.add_provider"
template_name = "administration/provider/list.html" template_name = "administration/provider/list.html"
ordering = "id" ordering = "id"
search_fields = ["id"]
class ProviderCreateView( class ProviderCreateView(

View File

@ -14,13 +14,18 @@ from passbook.admin.views.utils import (
InheritanceCreateView, InheritanceCreateView,
InheritanceListView, InheritanceListView,
InheritanceUpdateView, InheritanceUpdateView,
SearchListMixin,
UserPaginateListMixin, UserPaginateListMixin,
) )
from passbook.core.models import Source from passbook.core.models import Source
class SourceListView( class SourceListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, InheritanceListView LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
InheritanceListView,
): ):
"""Show list of all sources""" """Show list of all sources"""
@ -28,6 +33,7 @@ class SourceListView(
permission_required = "passbook_core.view_source" permission_required = "passbook_core.view_source"
ordering = "name" ordering = "name"
template_name = "administration/source/list.html" template_name = "administration/source/list.html"
search_fields = ["name", "slug"]
class SourceCreateView( class SourceCreateView(

View File

@ -14,13 +14,18 @@ from passbook.admin.views.utils import (
InheritanceCreateView, InheritanceCreateView,
InheritanceListView, InheritanceListView,
InheritanceUpdateView, InheritanceUpdateView,
SearchListMixin,
UserPaginateListMixin, UserPaginateListMixin,
) )
from passbook.flows.models import Stage from passbook.flows.models import Stage
class StageListView( class StageListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, InheritanceListView LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
InheritanceListView,
): ):
"""Show list of all stages""" """Show list of all stages"""
@ -28,6 +33,7 @@ class StageListView(
template_name = "administration/stage/list.html" template_name = "administration/stage/list.html"
permission_required = "passbook_flows.view_stage" permission_required = "passbook_flows.view_stage"
ordering = "name" ordering = "name"
search_fields = ["name"]
class StageCreateView( class StageCreateView(

View File

@ -13,6 +13,7 @@ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import ( from passbook.admin.views.utils import (
BackSuccessUrlMixin, BackSuccessUrlMixin,
DeleteMessageView, DeleteMessageView,
SearchListMixin,
UserPaginateListMixin, UserPaginateListMixin,
) )
from passbook.lib.views import CreateAssignPermView from passbook.lib.views import CreateAssignPermView
@ -22,7 +23,11 @@ from passbook.stages.invitation.signals import invitation_created
class InvitationListView( class InvitationListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
ListView,
): ):
"""Show list of all invitations""" """Show list of all invitations"""
@ -30,6 +35,7 @@ class InvitationListView(
permission_required = "passbook_stages_invitation.view_invitation" permission_required = "passbook_stages_invitation.view_invitation"
template_name = "administration/stage_invitation/list.html" template_name = "administration/stage_invitation/list.html"
ordering = "-expires" ordering = "-expires"
search_fields = ["created_by__username", "expires", "fixed_data"]
class InvitationCreateView( class InvitationCreateView(

View File

@ -12,6 +12,7 @@ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import ( from passbook.admin.views.utils import (
BackSuccessUrlMixin, BackSuccessUrlMixin,
DeleteMessageView, DeleteMessageView,
SearchListMixin,
UserPaginateListMixin, UserPaginateListMixin,
) )
from passbook.lib.views import CreateAssignPermView from passbook.lib.views import CreateAssignPermView
@ -20,7 +21,11 @@ from passbook.stages.prompt.models import Prompt
class PromptListView( class PromptListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
ListView,
): ):
"""Show list of all prompts""" """Show list of all prompts"""
@ -28,6 +33,12 @@ class PromptListView(
permission_required = "passbook_stages_prompt.view_prompt" permission_required = "passbook_stages_prompt.view_prompt"
ordering = "order" ordering = "order"
template_name = "administration/stage_prompt/list.html" template_name = "administration/stage_prompt/list.html"
search_fields = [
"field_key",
"label",
"type",
"placeholder",
]
class PromptCreateView( class PromptCreateView(

View File

@ -5,12 +5,20 @@ from django.utils.translation import gettext as _
from django.views.generic import ListView from django.views.generic import ListView
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import DeleteMessageView, UserPaginateListMixin from passbook.admin.views.utils import (
DeleteMessageView,
SearchListMixin,
UserPaginateListMixin,
)
from passbook.core.models import Token from passbook.core.models import Token
class TokenListView( class TokenListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
ListView,
): ):
"""Show list of all tokens""" """Show list of all tokens"""
@ -18,6 +26,11 @@ class TokenListView(
permission_required = "passbook_core.view_token" permission_required = "passbook_core.view_token"
ordering = "expires" ordering = "expires"
template_name = "administration/token/list.html" template_name = "administration/token/list.html"
search_fields = [
"intent",
"user__username",
"description",
]
class TokenDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView): class TokenDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView):

View File

@ -21,6 +21,7 @@ from passbook.admin.forms.users import UserForm
from passbook.admin.views.utils import ( from passbook.admin.views.utils import (
BackSuccessUrlMixin, BackSuccessUrlMixin,
DeleteMessageView, DeleteMessageView,
SearchListMixin,
UserPaginateListMixin, UserPaginateListMixin,
) )
from passbook.core.models import Token, User from passbook.core.models import Token, User
@ -28,7 +29,11 @@ from passbook.lib.views import CreateAssignPermView
class UserListView( class UserListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
ListView,
): ):
"""Show list of all users""" """Show list of all users"""
@ -36,6 +41,7 @@ class UserListView(
permission_required = "passbook_core.view_user" permission_required = "passbook_core.view_user"
ordering = "username" ordering = "username"
template_name = "administration/user/list.html" template_name = "administration/user/list.html"
search_fields = ["username", "name", "attributes"]
def get_queryset(self): def get_queryset(self):
return super().get_queryset().exclude(pk=get_anonymous_user().pk) return super().get_queryset().exclude(pk=get_anonymous_user().pk)