Stop AJAX when success or failure and show form on failure

AJAX requests stop on success or failure, as the waiting page
does not have to referesh any longer.

Also on failure a form that allows user to try again
is shown.
This commit is contained in:
Pea Tyczynska
2019-05-20 17:32:40 +01:00
parent 06ab7a5b1f
commit 6cf9959058
4 changed files with 45 additions and 6 deletions

View File

@@ -1,4 +1,9 @@
{% from "components/banner.html" import banner, banner_wrapper %}
{% from "components/textbox.html" import textbox %}
{% from "components/checkbox.html" import checkbox %}
{% from "components/page-header.html" import page_header %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/form.html" import form_wrapper %}
<div class="ajax-block-container">
{% if verification_status == "pending" %}
@@ -29,6 +34,26 @@
You can try again, or use a different address.
</p>
{% endcall %}
<a href={{ url_for('main.service_add_email_reply_to', service_id=service_id) }}>Try again</a>
<p>
Let recipients send replies to a shared inbox thats managed by your team.
</p>
<p>
Do not use your own email address for replies.
</p>
{% call form_wrapper(
action = url_for('.service_add_email_reply_to', service_id=service_id)
) %}
{{ textbox(
form.email_address,
width='2-3',
safe_error_message=True
) }}
{% if not first_email_address %}
<div class="form-group">
{{ checkbox(form.is_default) }}
</div>
{% endif %}
{{ page_footer('Try again') }}
{% endcall %}
{% endif %}
</div>

View File

@@ -18,7 +18,7 @@
) }}
{{ ajax_block(
partials,
url_for('main.service_verify_reply_to_address_updates', service_id=service_id, notification_id=notification_id),
url_for('main.service_verify_reply_to_address_updates', service_id=service_id, notification_id=notification_id) + request_args,
'status',
finished=finished
) }}