admin: add use spinner button for admin lists

This commit is contained in:
Jens Langhammer 2020-11-29 18:46:45 +01:00
parent a8dad2e393
commit 902953a2c7
23 changed files with 129 additions and 136 deletions

View File

@ -21,9 +21,9 @@
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select">
<pb-modal-button href="{% url 'passbook_admin:application-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<button role="pb-refresh" class="pf-c-button pf-m-primary">
@ -69,15 +69,15 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:application-update' pk=application.pk %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:application-delete' pk=application.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</td>
@ -108,9 +108,9 @@
{% endif %}
</div>
<pb-modal-button href="{% url 'passbook_admin:application-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</div>

View File

@ -21,9 +21,9 @@
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select">
<pb-modal-button href="{% url 'passbook_admin:certificatekeypair-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<button role="pb-refresh" class="pf-c-button pf-m-primary">
@ -64,15 +64,15 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:certificatekeypair-update' pk=kp.pk %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:certificatekeypair-delete' pk=kp.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</td>
@ -103,9 +103,9 @@
{% endif %}
</div>
<pb-modal-button href="{% url 'passbook_admin:certificatekeypair-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</div>

View File

@ -21,15 +21,15 @@
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select">
<pb-modal-button href="{% url 'passbook_admin:flow-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:flow-import' %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Import' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<button role="pb-refresh" class="pf-c-button pf-m-primary">
@ -75,15 +75,15 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:flow-update' pk=flow.pk %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:flow-delete' pk=flow.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<a class="pf-c-button pf-m-secondary pb-root-link" href="{% url 'passbook_admin:flow-execute' pk=flow.pk %}?next={{ request.get_full_path }}">{% trans 'Execute' %}</a>
@ -116,15 +116,15 @@
{% endif %}
</div>
<pb-modal-button href="{% url 'passbook_admin:flow-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:flow-import' %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Import' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</div>

View File

@ -21,9 +21,9 @@
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select">
<pb-modal-button href="{% url 'passbook_admin:group-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<button role="pb-refresh" class="pf-c-button pf-m-primary">
@ -62,15 +62,15 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:group-update' pk=group.pk %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:group-delete' pk=group.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</td>
@ -101,9 +101,9 @@
{% endif %}
</div>
<pb-modal-button href="{% url 'passbook_admin:group-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</div>

View File

@ -23,9 +23,9 @@
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select">
<pb-modal-button href="{% url 'passbook_admin:outpost-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<button role="pb-refresh" class="pf-c-button pf-m-primary">
@ -93,15 +93,15 @@
{% endwith %}
<td>
<pb-modal-button href="{% url 'passbook_admin:outpost-update' pk=outpost.pk %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:outpost-delete' pk=outpost.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
{% get_htmls outpost as htmls %}
@ -136,9 +136,9 @@
{% endif %}
</div>
<pb-modal-button href="{% url 'passbook_admin:outpost-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-c-button pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</div>

View File

@ -87,15 +87,15 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:outpost-service-connection-update' pk=sc.pk %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:outpost-service-connection-delete' pk=sc.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</td>

View File

@ -75,21 +75,21 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:policy-update' pk=policy.pk %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:policy-test' pk=policy.pk %}">
<button slot="trigger" class="pf-c-button pf-m-tertiary">
<pb-spinner-button slot="trigger" class="pf-m-tertiary">
{% trans 'Test' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:policy-delete' pk=policy.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</td>

View File

@ -20,9 +20,9 @@
<div class="pf-c-toolbar__content">
<div class="pf-c-toolbar__bulk-select">
<pb-modal-button href="{% url 'passbook_admin:policy-binding-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<button role="pb-refresh" class="pf-c-button pf-m-primary">
@ -75,15 +75,15 @@
</th>
<td>
<pb-modal-button href="{% url 'passbook_admin:policy-binding-update' pk=binding.pk %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:policy-binding-delete' pk=binding.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</td>
@ -106,9 +106,9 @@
{% trans 'Currently no policy bindings exist. Click the button below to create one.' %}
</div>
<pb-modal-button href="{% url 'passbook_admin:policy-binding-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</div>

View File

@ -72,15 +72,15 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:property-mapping-update' pk=property_mapping.pk %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:property-mapping-delete' pk=property_mapping.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</td>

View File

@ -84,15 +84,15 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:provider-update' pk=provider.pk %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:provider-delete' pk=provider.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
{% get_links provider as links %}

View File

@ -82,15 +82,15 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:source-update' pk=source.pk %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:source-delete' pk=source.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
{% get_links source as links %}

View File

@ -77,15 +77,15 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:stage-update' pk=stage.stage_uuid %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:stage-delete' pk=stage.stage_uuid %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
{% get_links stage as links %}

View File

@ -20,9 +20,9 @@
<div class="pf-c-toolbar__content">
<div class="pf-c-toolbar__bulk-select">
<pb-modal-button href="{% url 'passbook_admin:stage-binding-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<button role="pb-refresh" class="pf-c-button pf-m-primary">
@ -81,15 +81,15 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:stage-binding-update' pk=binding.pk %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Update' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:stage-binding-delete' pk=binding.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</td>
@ -112,9 +112,9 @@
{% trans 'Currently no flow-stage bindings exist. Click the button below to create one.' %}
</div>
<pb-modal-button href="{% url 'passbook_admin:stage-binding-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</div>

View File

@ -22,9 +22,9 @@
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select">
<pb-modal-button href="{% url 'passbook_admin:stage-invitation-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<button role="pb-refresh" class="pf-c-button pf-m-primary">
@ -57,9 +57,9 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:stage-invitation-delete' pk=invitation.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</td>
@ -90,9 +90,9 @@
{% endif %}
</div>
<pb-modal-button href="{% url 'passbook_admin:stage-invitation-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</div>

View File

@ -22,9 +22,9 @@
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select">
<pb-modal-button href="{% url 'passbook_admin:stage-prompt-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<button role="pb-refresh" class="pf-c-button pf-m-primary">
@ -79,15 +79,15 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:stage-prompt-update' pk=prompt.pk %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Update' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_admin:stage-prompt-delete' pk=prompt.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
{% get_links prompt as links %}

View File

@ -59,9 +59,9 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:token-delete' pk=token.pk %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-token-copy-button identifier="{{ token.identifier }}">

View File

@ -20,9 +20,9 @@
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select">
<pb-modal-button href="{% url 'passbook_admin:user-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<button role="pb-refresh" class="pf-c-button pf-m-primary">
@ -62,23 +62,23 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_admin:user-update' pk=user.pk %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</button>
</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 %}">
<button slot="trigger" class="pf-c-button pf-m-warning">
<pb-spinner-button slot="trigger" class="pf-m-warning">
{% trans 'Disable' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
{% else %}
<pb-modal-button href="{% url 'passbook_admin:user-delete' pk=user.pk %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Enable' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
{% endif %}
@ -112,9 +112,9 @@
{% endif %}
</div>
<pb-modal-button href="{% url 'passbook_admin:user-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</div>

View File

@ -4,20 +4,6 @@
{% load passbook_utils %}
{% load static %}
{% block head %}
{{ block.super }}
{{ form.media.css }}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/vendor/jquery/jquery.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/jquery.init.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/core.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/actions.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/urlify.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/prepopulate.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/SelectBox.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/SelectFilter2.js' %}"></script>
{% endblock %}
{% block content %}
<section class="pf-c-page__main-section pf-m-light">
<div class="pf-c-content">

View File

@ -10,9 +10,9 @@
{% include 'partials/toolbar_search.html' %}
<div class="pf-c-toolbar__bulk-select">
<pb-modal-button href="{% url 'passbook_core:user-tokens-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</div>
@ -56,15 +56,15 @@
</td>
<td>
<pb-modal-button href="{% url 'passbook_core:user-tokens-update' identifier=token.identifier %}">
<button slot="trigger" class="pf-c-button pf-m-secondary">
<pb-spinner-button slot="trigger" class="pf-m-secondary">
{% trans 'Edit' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-modal-button href="{% url 'passbook_core:user-tokens-delete' identifier=token.identifier %}">
<button slot="trigger" class="pf-c-button pf-m-danger">
<pb-spinner-button slot="trigger" class="pf-m-danger">
{% trans 'Delete' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
<pb-token-copy-button identifier="{{ token.identifier }}">
@ -89,9 +89,9 @@
{% trans 'Currently no tokens exist. Click the button below to create one.' %}
</div>
<pb-modal-button href="{% url 'passbook_core:user-tokens-create' %}">
<button slot="trigger" class="pf-c-button pf-m-primary">
<pb-spinner-button slot="trigger" class="pf-m-primary">
{% trans 'Create' %}
</button>
</pb-spinner-button>
<div slot="modal"></div>
</pb-modal-button>
</div>

4
web/dist/main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -21,7 +21,6 @@ export class Config {
integrations: [new Integrations.BrowserTracing()],
tracesSampleRate: 1.0,
environment: config.error_reporting_environment,
sendDefaultPii: config.error_reporting_send_pii,
});
console.debug(`passbook/config: Sentry enabled.`);
}

View File

@ -16,6 +16,9 @@ export class SpinnerButton extends LitElement {
@property()
isRunning = false;
@property()
form?: string;
static get styles() {
return [
GlobalsStyle,
@ -57,6 +60,11 @@ export class SpinnerButton extends LitElement {
if (this.isRunning === true) {
return;
}
if (this.form) {
// Because safari we can't just extend HTMLButtonElement, hence I have to implement
// these attributes by myself here, sigh...
document.querySelector<HTMLFormElement>(`#${this.form}`)?.submit();
}
this.setLoading();
}