Make spacing and position of banners consistent

Banners should always be the first thing on the page.

Because headers already have padding we don’t want to put padding on the
container.

So banners should also have top padding to distance then from the red bar.

They should also sit in the 3/4 column if the page has side navigation. This
commit adds a new template (`withoutnav_template.html`) which extends
`admin_template.html`. All views then extend one or the other, never the
`admin_template.html` directly. This means that `admin_template.html` doesn’t
have to make decisions about where the flash messages are displayed.
This commit is contained in:
Chris Hill-Scott
2016-02-01 12:15:38 +00:00
parent 286fc308d9
commit 2ef1057180
26 changed files with 75 additions and 70 deletions

View File

@@ -7,7 +7,7 @@
color: $white;
display: block;
padding: $gutter-half;
margin: 0 0 $gutter 0;
margin: $gutter-half 0 $gutter 0;
text-align: center;
position: relative;

View File

@@ -60,20 +60,8 @@
{% endif %}
{% block content %}
<main id="content" role="main" class="page-container">
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
{{ banner(
message,
'default' if category == 'default' else 'dangerous',
delete_button="Yes, delete this template" if 'delete' == category else None
)}}
{% endfor %}
{% endif %}
{% endwith %}
{% block fullwidth_content %}{% endblock %}
{% block fullwidth_content %}{% endblock %}
</main>
{% endblock %}

View File

@@ -1,10 +1,9 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% block page_title %}Unauthorized{% endblock %}
{% block fullwidth_content %}
<div class="grid-row">
<div class="column-two-thirds">
<h1>401</h1>
<p>You are not authorized to see this page.</p>
</div>
</div>
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">
<h1>401</h1>
<p>You are not authorized to see this page.</p>
</div>
{% endblock %}

View File

@@ -1,6 +1,6 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% block page_title %}Page not found{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">
<h1 class="heading-xlarge">

View File

@@ -1,12 +1,12 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% block page_title %}Server error{% endblock %}
{% block fullwidth_content %}
<div class="grid-row">
<div class="column-two-thirds">
<h1 class="heading-xlarge">
Sorry, we're experiencing technical difficulties
</h1>
<p>Try again later.</p>
</div>
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">
<h1 class="heading-xlarge">
Sorry, we're experiencing technical difficulties
</h1>
<p>Try again later.</p>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,12 @@
{% from "components/banner.html" import banner %}
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
{{ banner(
message,
'default' if category == 'default' else 'dangerous',
delete_button="Yes, delete this template" if 'delete' == category else None
)}}
{% endfor %}
{% endif %}
{% endwith %}

View File

@@ -1,4 +1,4 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
@@ -6,7 +6,7 @@
GOV.UK Notify | Set up service
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">

View File

@@ -1,11 +1,11 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% from "components/browse-list.html" import browse_list %}
{% block page_title %}
GOV.UK Notify | Dashboard
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<h1 class="heading-xlarge">
Choose service

View File

@@ -1,4 +1,4 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
@@ -6,7 +6,7 @@
GOV.UK Notify
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">

View File

@@ -1,4 +1,4 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
@@ -6,7 +6,7 @@
GOV.UK Notify
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">

View File

@@ -1,4 +1,4 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
@@ -6,7 +6,7 @@
GOV.UK Notify
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">

View File

@@ -1,10 +1,10 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% block page_title %}
GOV.UK Notify |
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">

View File

@@ -1,10 +1,10 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% block page_title %}
GOV.UK Notify | Create a user account
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">

View File

@@ -1,4 +1,4 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
@@ -6,7 +6,7 @@
GOV.UK Notify | Create an account
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">

View File

@@ -1,10 +1,10 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% block page_title %}
GOV.UK Notify | Get started
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">

View File

@@ -1,4 +1,4 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
@@ -6,7 +6,7 @@
Sign in
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">

View File

@@ -1,4 +1,4 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% from "components/banner.html" import banner %}
{% from "components/big-number.html" import big_number %}
@@ -13,7 +13,7 @@
Styleguide GOV.UK Notify
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<h1 class="heading-xlarge">
Styleguide

View File

@@ -1,10 +1,10 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% block page_title %}
GOV.UK Notify
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<!-- this page is just a hack for building out pages - same functionality as text-not-received, but for the register from an invite flow -->

View File

@@ -1,4 +1,4 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
@@ -6,7 +6,7 @@
GOV.UK Notify
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">

View File

@@ -1,4 +1,4 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
@@ -6,7 +6,7 @@
GOV.UK Notify | Text verification
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">

View File

@@ -1,11 +1,11 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% from "components/table.html" import list_table, row, field %}
{% block page_title %}
GOV.UK Notify | Your profile
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<h1 class="heading-xlarge">Your profile</h1>

View File

@@ -1,10 +1,10 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% block page_title %}
GOV.UK Notify
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">

View File

@@ -1,10 +1,10 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% block page_title %}
GOV.UK Notify | Confirm mobile number
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">

View File

@@ -1,4 +1,4 @@
{% extends "admin_template.html" %}
{% extends "withoutnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
@@ -6,7 +6,7 @@
GOV.UK Notify | Confirm email address and mobile number
{% endblock %}
{% block fullwidth_content %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-two-thirds">

View File

@@ -1,5 +1,4 @@
{% extends "admin_template.html" %}
{% from "components/banner.html" import banner %}
{% block fullwidth_content %}
<div class="grid-row">
@@ -11,6 +10,7 @@
'Your service is in restricted mode. You can only send notifications to yourself.',
'info'
) }}
{% include 'flash_messages.html' %}
{% block maincolumn_content %}{% endblock %}
</div>
</div>

View File

@@ -0,0 +1,6 @@
{% extends "admin_template.html" %}
{% block fullwidth_content %}
{% include 'flash_messages.html' %}
{% block maincolumn_content %}{% endblock %}
{% endblock %}