Merge pull request #1379 from alphagov/consistent-banners

Make banners more consistent
This commit is contained in:
Chris Hill-Scott
2017-07-31 09:37:13 +01:00
committed by GitHub
10 changed files with 109 additions and 107 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,16 +10,31 @@
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">
<h1 class="heading-large">
API keys
</h1>
{% 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>
<div class="column-one-third">
<a href="{{ url_for('.create_api_key', service_id=current_service.id) }}" class="button align-with-heading">Create an API key</a>
{% else %}
<div class="grid-row">
<div class="column-two-thirds">
<h1 class="heading-large">
API keys
</h1>
</div>
<div class="column-one-third">
<a href="{{ url_for('.create_api_key', service_id=current_service.id) }}" class="button align-with-heading">Create an API key</a>
</div>
</div>
</div>
{% endif %}
<div class="body-copy-table">
{% call(item, row_number) list_table(
keys,

View File

@@ -1,31 +0,0 @@
{% extends "withnav_template.html" %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/api-key.html" import api_key %}
{% block service_page_title %}
Revoke API key
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">
Revoke API key
</h1>
<p>
{{ key_name }} will no longer let you connect to GOV.UK Notify.
</p>
<p>
You cant undo this.
</p>
<form method="post">
{{ page_footer(
'Revoke this API key',
back_link=url_for('.api_keys', service_id=current_service.id),
back_link_text='Back to API keys',
destructive=True
) }}
</form>
{% endblock %}

View File

@@ -1,5 +1,6 @@
{% from "components/banner.html" import banner_wrapper %}
{% call banner_wrapper(type="default") %}
You only have permission to view this service
{% call banner_wrapper(type="warning") %}
You only have permission to view this service. To send messages, edit
templates or manage team members, contact the person who invited you.
{% endcall %}

View File

@@ -27,10 +27,24 @@
</form>
{% endcall %}
</div>
{% elif template_delete_confirmation_message %}
<div class="bottom-gutter">
{% call banner_wrapper(type='dangerous', subhead=template_delete_confirmation_message[0]) %}
{% if template_delete_confirmation_message[1] %}
<p>
{{ template_delete_confirmation_message[1] }}
</p>
{% endif %}
<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 %}
<h1 class="heading-large">{{ template.name }}</h1>
{% endif %}
<h1 class="heading-large">{{ template.name }}</h1>
<div class="grid-row">
{% with show_title=False, expanded=True %}
{% include 'views/templates/_template.html' %}