Use confirmation banner for revoking API keys

Currently revoking an API key takes you to a separate page. It should
work the same way as other destructive actions, ie staying on the same
page but with a banner asking you to confirm the action.
This commit is contained in:
Chris Hill-Scott
2017-07-24 15:36:38 +01:00
parent d51ffe6b39
commit 40e79c6827
4 changed files with 40 additions and 42 deletions

View File

@@ -1,4 +1,5 @@
{% extends "withnav_template.html" %}
{% from "components/banner.html" import banner_wrapper %}
{% from "components/table.html" import list_table, field, hidden_field_heading %}
{% from "components/api-key.html" import api_key %}
{% from "components/page-footer.html" import page_footer %}
@@ -9,6 +10,22 @@
{% block maincolumn_content %}
{% if revoke_key %}
<div class="bottom-gutter">
{% call banner_wrapper(type='dangerous', subhead='Are you sure you want to revoke this API key?') %}
<p>
{{ revoke_key }} will no longer let you connect to GOV.UK Notify.
</p>
<form method='post'>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="submit" class="button" name="delete" value="Confirm" />
</form>
{% endcall %}
</div>
{% else %}
{% endif %}
<div class="grid-row">
<div class="column-two-thirds">
<h1 class="heading-large">