better show loading state when testing a policy

This commit is contained in:
Jens Langhammer 2019-03-10 15:46:49 +01:00
parent 7fe0300b86
commit 0e425418df
2 changed files with 17 additions and 0 deletions

View File

@ -9,3 +9,18 @@
{% block action %}
{% trans 'Test' %}
{% endblock %}
{% block beneath_form %}
<p class="loading" style="display: none;">
<span class="spinner spinner-xs spinner-inline"></span> {% trans 'Processing, please wait...' %}
</p>
{% endblock %}
{% block scripts %}
{{ block.super }}
<script>
$('form').on('submit', function () {
$('p.loading').show();
})
</script>
{% endblock %}

View File

@ -19,6 +19,8 @@
<input type="submit" class="btn btn-primary" value="{% block action %}{% endblock %}" />
</form>
</div>
{% block beneath_form %}
{% endblock %}
</div>
{% endblock %}