aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-12-05 11:35:53 +0000
committerMatthew Somerville <matthew@mysociety.org>2019-12-05 15:56:26 +0000
commit1f43fc96b8c235c225eaa6be057663e11fbdf592 (patch)
tree4369d74fd1a9f66613d9e40a51c081ed7ca0ac52
parentc69131fd0f3a438cf459e0445ad1c7ae38a9c412 (diff)
Add staging site banner.
-rw-r--r--CHANGELOG.md1
-rw-r--r--templates/web/base/debug_footer.html40
-rw-r--r--templates/web/base/debug_header.html8
-rw-r--r--templates/web/base/header.html3
-rw-r--r--templates/web/fiksgatami/header.html4
-rw-r--r--templates/web/fiksgatami/nn/footer.html1
-rw-r--r--templates/web/hart/header.html4
-rw-r--r--templates/web/oxfordshire/header.html4
-rw-r--r--templates/web/stevenage/header.html4
-rw-r--r--templates/web/zurich/header.html4
-rw-r--r--web/cobrands/sass/_base.scss13
11 files changed, 29 insertions, 57 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 283eff424..41729ade8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -62,6 +62,7 @@
- Make contact edit note optional on staging sites.
- Store email addresses report sent to on the report.
- Add configuration for setting Content-Security-Policy header.
+ - Add banner on staging website/emails.
- Open311 improvements:
- Support use of 'private' service definition <keywords> to mark
reports made in that category private. #2488
diff --git a/templates/web/base/debug_footer.html b/templates/web/base/debug_footer.html
deleted file mode 100644
index a1b7fc155..000000000
--- a/templates/web/base/debug_footer.html
+++ /dev/null
@@ -1,40 +0,0 @@
-[% IF c.config.STAGING_SITE and c.config.SHOW_DEBUG %]
-
-<hr style="clear: both;">
-
-<ul>
- <li>cobrand.moniker: [% c.cobrand.moniker %]</li>
- <li>additional_template_paths: [% additional_template_paths.join(', ') || '--empty--' %]</li>
- <li>lang_code: [% lang_code %]</li>
- <li>user.id: [% c.user.id || '--not logged in--' %]</li>
-</ul>
-
-<style type="text/css">
- #overrides_form {
- font-size: 80%;
- }
- #overrides_form label {
- float: left;
- text-align: right;
- padding-right: 0.5em;
- width: 12em;
- }
-
-</style>
-
-<!-- Use a post so that we don't clutter up the url -->
-<form action="" method="post" id="overrides_form" name="overrides_form">
-
- <label for="_override_clear_all">Clear all overrides:</label>
- <input type="checkbox" name="_override_clear_all" id="_override_clear_all" value="1"><br>
-
- [% FOREACH k IN ['cobrand_moniker', 'lang'] %]
- <label for="override_[% k %]">[% k %]:</label>
- <input type="text" name="_override_[% k %]" id="override_[% k %]" value="[% c.get_override(k)%]"><br>
- [% END %]
-
- <label>&nbsp;</label><input type="submit" value="Change overrides">
-</form>
-
-[% END %]
-
diff --git a/templates/web/base/debug_header.html b/templates/web/base/debug_header.html
index 92ccbc357..5bbb65cfc 100644
--- a/templates/web/base/debug_header.html
+++ b/templates/web/base/debug_header.html
@@ -1,5 +1,5 @@
-[% IF c.config.STAGING_SITE and c.config.SHOW_DEBUG %]
- <p class="dev-site-notice">
- [% loc("This is a developer site; things might break at any time, and the database will be periodically deleted.") %]
- </p>
+[% IF c.config.STAGING_SITE ~%]
+ <div class="dev-site-notice">
+ [% loc("Staging site") %]
+ </div>
[% END %]
diff --git a/templates/web/base/header.html b/templates/web/base/header.html
index 7f423ff9e..1469ea233 100644
--- a/templates/web/base/header.html
+++ b/templates/web/base/header.html
@@ -26,6 +26,7 @@
[% TRY %][% PROCESS 'set_body_class.html' %][% CATCH file %][% END %]
<body class="[% bodyclass | html IF bodyclass %]">
+ [% INCLUDE 'debug_header.html' %]
[% TRY %][% PROCESS 'before_wrapper.html' %][% CATCH file %][% END %]
<div class="wrapper">
@@ -36,5 +37,3 @@
<div class="container">
<div class="content[% " $mainclass" | html IF mainclass %]" role="main">
-
- <!-- [% INCLUDE 'debug_header.html' %] -->
diff --git a/templates/web/fiksgatami/header.html b/templates/web/fiksgatami/header.html
index 2d0f163e7..f2d54cf8c 100644
--- a/templates/web/fiksgatami/header.html
+++ b/templates/web/fiksgatami/header.html
@@ -19,6 +19,8 @@
[% TRY %][% PROCESS 'set_body_class.html' %][% CATCH file %][% END %]
<body class="[% bodyclass | html IF bodyclass %]">
+ [% INCLUDE 'debug_header.html' %]
+
<div class="wrapper">
<div class="table-cell">
<header id="site-header" role="banner">
@@ -32,5 +34,3 @@
<div class="container">
<div class="content[% " $mainclass" | html IF mainclass %]" role="main">
-
- <!-- [% INCLUDE 'debug_header.html' %] -->
diff --git a/templates/web/fiksgatami/nn/footer.html b/templates/web/fiksgatami/nn/footer.html
index 519a8c3f5..01b41728d 100644
--- a/templates/web/fiksgatami/nn/footer.html
+++ b/templates/web/fiksgatami/nn/footer.html
@@ -30,7 +30,6 @@
</div>
</div>
-<!-- [% INCLUDE 'debug_footer.html' %] -->
</div> <!-- .wrapper -->
</body>
</html>
diff --git a/templates/web/hart/header.html b/templates/web/hart/header.html
index a375fdb7d..ddd68abe3 100644
--- a/templates/web/hart/header.html
+++ b/templates/web/hart/header.html
@@ -20,6 +20,8 @@
[% TRY %][% PROCESS 'set_body_class.html' %][% CATCH file %][% END %]
<body class="[% bodyclass | html IF bodyclass %]">
+ [% INCLUDE 'debug_header.html' %]
+
<div class="wrapper">
<div class="table-cell">
<header id="site-header" role="banner">
@@ -38,5 +40,3 @@
<div class="container">
<div class="content[% " $mainclass" | html IF mainclass %]" role="main">
-
- <!-- [% INCLUDE 'debug_header.html' %] -->
diff --git a/templates/web/oxfordshire/header.html b/templates/web/oxfordshire/header.html
index eaf601b1b..8473f6fcb 100644
--- a/templates/web/oxfordshire/header.html
+++ b/templates/web/oxfordshire/header.html
@@ -20,6 +20,8 @@
</head>
<body class="[% bodyclass | html IF bodyclass %]">
+ [% INCLUDE 'debug_header.html' %]
+
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NT76GJ5"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
@@ -42,5 +44,3 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<div class="container">
<div class="content[% " $mainclass" | html IF mainclass %]" role="main">
-
- <!-- [% INCLUDE 'debug_header.html' %] -->
diff --git a/templates/web/stevenage/header.html b/templates/web/stevenage/header.html
index 0fe6dfed1..e8b8f1d07 100644
--- a/templates/web/stevenage/header.html
+++ b/templates/web/stevenage/header.html
@@ -16,6 +16,8 @@
</head>
<body class="[% bodyclass | html IF bodyclass %]">
+ [% INCLUDE 'debug_header.html' %]
+
<div class="wrapper">
<div class="table-cell">
<header id="site-header">
@@ -28,5 +30,3 @@
<div class="container">
<div class="content[% " $mainclass" | html IF mainclass %]" role="main">
-
- <!-- [% INCLUDE 'debug_header.html' %] -->
diff --git a/templates/web/zurich/header.html b/templates/web/zurich/header.html
index cd08e9503..69cba5194 100644
--- a/templates/web/zurich/header.html
+++ b/templates/web/zurich/header.html
@@ -20,6 +20,8 @@
</head>
<body class="[% bodyclass | html IF bodyclass %]">
+ [% INCLUDE 'debug_header.html' %]
+
<div class="wrapper">
<div class="table-cell clearfix">
<header id="site-header" role="banner">
@@ -80,5 +82,3 @@
[% END %]
[% pre_container_extra %]
-
- <!-- [% INCLUDE 'debug_header.html' %] -->
diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss
index 587b50ebf..ced554249 100644
--- a/web/cobrands/sass/_base.scss
+++ b/web/cobrands/sass/_base.scss
@@ -659,6 +659,19 @@ ul.error {
/*** LAYOUT ***/
+.dev-site-notice {
+ font-size: 1.5em;
+ color: #fff;
+ background-color: #f00;
+ position: absolute;
+ padding: 1em 5em;
+ top: 1em;
+ left: -5em;
+ transform: rotate(-45deg);
+ z-index: 2;
+ pointer-events: none;
+}
+
// Padding creates page margins on mobile
.container {
margin: 0 auto;