aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App/Controller/Tokens.pm6
-rw-r--r--t/app/controller/questionnaire.t2
-rwxr-xr-xtemplates/web/base/errors/generic.html9
-rw-r--r--templates/web/base/errors/page_error_404_not_found.html20
-rw-r--r--templates/web/base/questionnaire/index.html1
-rw-r--r--templates/web/base/report/new/councils_text_none.html4
-rw-r--r--templates/web/base/report/new/form_report.html1
-rw-r--r--templates/web/base/report/update.html2
-rw-r--r--templates/web/base/report/update/form_update.html1
-rw-r--r--templates/web/base/tokens/error.html12
-rw-r--r--templates/web/bromley/report/display.html1
-rw-r--r--templates/web/bromley/report/new/fill_in_details_form.html1
-rw-r--r--templates/web/eastsussex/report/update-form.html1
-rw-r--r--templates/web/zurich/report/new/fill_in_details_form.html1
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js16
-rw-r--r--web/cobrands/sass/_layout.scss8
16 files changed, 49 insertions, 37 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Tokens.pm b/perllib/FixMyStreet/App/Controller/Tokens.pm
index 0db7d5a11..eb35fd152 100644
--- a/perllib/FixMyStreet/App/Controller/Tokens.pm
+++ b/perllib/FixMyStreet/App/Controller/Tokens.pm
@@ -326,11 +326,7 @@ sub load_auth_token : Private {
}
);
- unless ( $token ) {
- $c->stash->{template} = 'errors/generic.html';
- $c->stash->{message} = _("I'm afraid we couldn't validate that token. If you've copied the URL from an email, please check that you copied it exactly.\n");
- $c->detach;
- }
+ $c->detach('token_too_old') unless $token;
return $token;
}
diff --git a/t/app/controller/questionnaire.t b/t/app/controller/questionnaire.t
index 2a89454d5..7718d5034 100644
--- a/t/app/controller/questionnaire.t
+++ b/t/app/controller/questionnaire.t
@@ -87,7 +87,7 @@ foreach my $test (
{
desc => 'User goes to questionnaire URL with a bad token',
token_extra => 'BAD',
- content => "we couldn't validate that token",
+ content => "Sorry, that wasn’t a valid link",
},
{
desc => 'User goes to questionnaire URL for a now-hidden problem',
diff --git a/templates/web/base/errors/generic.html b/templates/web/base/errors/generic.html
index 12aa8e170..d0d1e2e00 100755
--- a/templates/web/base/errors/generic.html
+++ b/templates/web/base/errors/generic.html
@@ -1,8 +1,9 @@
-[% INCLUDE 'header.html', title = loc('Error') %]
+[% INCLUDE 'header.html', bodyclass = 'fullwidthpage', title = loc('Error') %]
-<h1>[% loc('Error') %]</h1>
-
-<p>[% message %]</p>
+<div class="confirmation-header confirmation-header--failure">
+ <h1>[% loc('Error') %]</h1>
+ <p>[% message %]</p>
+</div>
[% INCLUDE 'footer.html' %]
diff --git a/templates/web/base/errors/page_error_404_not_found.html b/templates/web/base/errors/page_error_404_not_found.html
index 77db18e89..490c5b721 100644
--- a/templates/web/base/errors/page_error_404_not_found.html
+++ b/templates/web/base/errors/page_error_404_not_found.html
@@ -1,19 +1,13 @@
-[% INCLUDE 'header.html', title => loc('Page Not Found') %]
+[% INCLUDE 'header.html', bodyclass = 'fullwidthpage', title = loc('Page Not Found') %]
-<h1>[%loc('Page Not Found') %]</h1>
-
-[% IF error_msg %]
+<div class="confirmation-header confirmation-header--failure">
+ <h1>[% loc('Page Not Found') %]</h1>
+ [% IF error_msg %]
<p class="error">[% error_msg | html %]</p>
-[% END %]
+ [% END %]
-<p>
- [%
- tprintf(
- loc("The requested URL '%s' was not found on this server"),
- c.req.uri
- )
- %]
-</p>
+ <p>[% tprintf(loc("The requested URL '%s' was not found on this server"), c.req.uri) %]</p>
+</div>
[% # FIXME - add more helpful suggestions to this page %]
diff --git a/templates/web/base/questionnaire/index.html b/templates/web/base/questionnaire/index.html
index 65a136d75..c8b6907a1 100644
--- a/templates/web/base/questionnaire/index.html
+++ b/templates/web/base/questionnaire/index.html
@@ -81,6 +81,7 @@
<div id="form_photos">
[% IF upload_fileid %]
<script>
+ var fixmystreet = fixmystreet || {};
fixmystreet.uploaded_files = "[% upload_fileid %]".split(',');
</script>
<p>[% loc('You have already attached photos to this update. Note that you can attach a maximum of 3 to this update (if you try to upload more, the oldest will be removed).') %]</p>
diff --git a/templates/web/base/report/new/councils_text_none.html b/templates/web/base/report/new/councils_text_none.html
index 684879590..6a1a2bc67 100644
--- a/templates/web/base/report/new/councils_text_none.html
+++ b/templates/web/base/report/new/councils_text_none.html
@@ -5,7 +5,11 @@
"We do not yet have details for the councils that cover this location.",
missing_details_bodies.size || all_areas.size
);
+%]
+[%
loc("If you submit a problem here the subject and details of the problem will be public, but the problem will <strong>not</strong> be reported to the council.");
+%]
+[%
tprintf(
loc("You can help us by finding a contact email address for local problems for %s and emailing it to us at <a href='mailto:%s'>%s</a>."),
missing_details_body_names.join( loc(' or ') ) || all_area_names.join( loc(' or ') ),
diff --git a/templates/web/base/report/new/form_report.html b/templates/web/base/report/new/form_report.html
index 819286ea7..a236b6a1f 100644
--- a/templates/web/base/report/new/form_report.html
+++ b/templates/web/base/report/new/form_report.html
@@ -30,6 +30,7 @@
<div id="form_photos">
[% IF upload_fileid %]
<script>
+ var fixmystreet = fixmystreet || {};
fixmystreet.uploaded_files = "[% upload_fileid %]".split(',');
</script>
<p>[% loc('You have already attached photos to this report. Note that you can attach a maximum of 3 to this report (if you try to upload more, the oldest will be removed).') %]</p>
diff --git a/templates/web/base/report/update.html b/templates/web/base/report/update.html
index 66e698606..a09913d39 100644
--- a/templates/web/base/report/update.html
+++ b/templates/web/base/report/update.html
@@ -28,6 +28,7 @@
<p class="meta-2"> [% INCLUDE meta_line %] </p>
</div>
[% ELSE %]
+ <a name="update_[% update.id %]" class="internal-link-fixed-header"></a>
[% INCLUDE 'report/photo.html' object=update %]
<div class="item-list__update-text">
<div class="moderate-display">
@@ -44,7 +45,6 @@
[% END %]
<p class="meta-2">
- <a name="update_[% update.id %]"></a>
[% INCLUDE meta_line %]
[% mlog = update.latest_moderation_log_entry(); IF mlog %]
<br /> Moderated by [% mlog.user.from_body.name %] at [% prettify_dt(mlog.whenedited) %]
diff --git a/templates/web/base/report/update/form_update.html b/templates/web/base/report/update/form_update.html
index b25d4c706..3a46694cf 100644
--- a/templates/web/base/report/update/form_update.html
+++ b/templates/web/base/report/update/form_update.html
@@ -12,6 +12,7 @@
<div id="form_photos">
[% IF upload_fileid %]
<script>
+ var fixmystreet = fixmystreet || {};
fixmystreet.uploaded_files = "[% upload_fileid %]".split(',');
</script>
<p>[% loc('You have already attached photos to this update. Note that you can attach a maximum of 3 to this update (if you try to upload more, the oldest will be removed).') %]</p>
diff --git a/templates/web/base/tokens/error.html b/templates/web/base/tokens/error.html
index e3fa6c170..726ec1598 100644
--- a/templates/web/base/tokens/error.html
+++ b/templates/web/base/tokens/error.html
@@ -1,9 +1,9 @@
-[% INCLUDE 'header.html', title => loc('Error') %]
+[% INCLUDE 'header.html', bodyclass = 'fullwidthpage', title = loc('Error') %]
+[% contact_url = c.uri_for('/contact') %]
-<h1>[% loc('Error') %]</h1>
-
-[% contact_url = c.uri_for('/contact'); %]
-
-<p>[% tprintf( loc('Thank you for trying to confirm your update or problem. We seem to have an error ourselves though, so <a href="%s">please let us know what went on</a> and we\'ll look into it.'), contact_url ) %]</p>
+<div class="confirmation-header confirmation-header--failure">
+ <h1>[% loc('Error') %]</h1>
+ <p>[% tprintf( loc('Thank you for trying to confirm your update or problem. We seem to have an error ourselves though, so <a href="%s">please let us know what went on</a> and we\'ll look into it.'), contact_url ) %]</p>
+</div>
[% INCLUDE 'footer.html' %]
diff --git a/templates/web/bromley/report/display.html b/templates/web/bromley/report/display.html
index c9b0e9847..569275841 100644
--- a/templates/web/bromley/report/display.html
+++ b/templates/web/bromley/report/display.html
@@ -71,6 +71,7 @@
<div id="form_photos">
[% IF upload_fileid %]
<script>
+ var fixmystreet = fixmystreet || {};
fixmystreet.uploaded_files = "[% upload_fileid %]".split(',');
</script>
<p>[% loc('You have already attached photos to this update. Note that you can attach a maximum of 3 to this update (if you try to upload more, the oldest will be removed).') %]</p>
diff --git a/templates/web/bromley/report/new/fill_in_details_form.html b/templates/web/bromley/report/new/fill_in_details_form.html
index 09e695278..2f853b506 100644
--- a/templates/web/bromley/report/new/fill_in_details_form.html
+++ b/templates/web/bromley/report/new/fill_in_details_form.html
@@ -59,6 +59,7 @@
<div id="form_photos">
[% IF upload_fileid %]
<script>
+ var fixmystreet = fixmystreet || {};
fixmystreet.uploaded_files = "[% upload_fileid %]".split(',');
</script>
<p>[% loc('You have already attached photos to this report. Note that you can attach a maximum of 3 to this report (if you try to upload more, the oldest will be removed).') %]</p>
diff --git a/templates/web/eastsussex/report/update-form.html b/templates/web/eastsussex/report/update-form.html
index 55d79a930..8c15db904 100644
--- a/templates/web/eastsussex/report/update-form.html
+++ b/templates/web/eastsussex/report/update-form.html
@@ -71,6 +71,7 @@
<div id="form_photos">
[% IF upload_fileid %]
<script>
+ var fixmystreet = fixmystreet || {};
fixmystreet.uploaded_files = "[% upload_fileid %]".split(',');
</script>
<p>[% loc('You have already attached photos to this update. Note that you can attach a maximum of 3 to this update (if you try to upload more, the oldest will be removed).') %]</p>
diff --git a/templates/web/zurich/report/new/fill_in_details_form.html b/templates/web/zurich/report/new/fill_in_details_form.html
index 7a487f902..1e036c087 100644
--- a/templates/web/zurich/report/new/fill_in_details_form.html
+++ b/templates/web/zurich/report/new/fill_in_details_form.html
@@ -53,6 +53,7 @@
<div id="form_photos">
[% IF upload_fileid %]
<script>
+ var fixmystreet = fixmystreet || {};
fixmystreet.uploaded_files = "[% upload_fileid %]".split(',');
</script>
<p>[% loc('You have already attached photos to this report. Note that you can attach a maximum of 3 to this report (if you try to upload more, the oldest will be removed).') %]</p>
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 129cc73bc..7c0a752d2 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -246,13 +246,15 @@ $(function(){
}
});
- $.each(fixmystreet.uploaded_files || [], function(i, f) {
- var mockFile = { name: f, server_id: f };
- photodrop.emit("addedfile", mockFile);
- photodrop.createThumbnailFromUrl(mockFile, '/photo/' + f + '.temp.jpeg');
- photodrop.emit("complete", mockFile);
- photodrop.options.maxFiles -= 1;
- });
+ if (typeof fixmystreet !== 'undefined') {
+ $.each(fixmystreet.uploaded_files || [], function(i, f) {
+ var mockFile = { name: f, server_id: f };
+ photodrop.emit("addedfile", mockFile);
+ photodrop.createThumbnailFromUrl(mockFile, '/photo/' + f + '.temp.jpeg');
+ photodrop.emit("complete", mockFile);
+ photodrop.options.maxFiles -= 1;
+ });
+ }
}
/*
diff --git a/web/cobrands/sass/_layout.scss b/web/cobrands/sass/_layout.scss
index a2dd1a8a0..96b3d2aec 100644
--- a/web/cobrands/sass/_layout.scss
+++ b/web/cobrands/sass/_layout.scss
@@ -3,6 +3,14 @@
$image-sprite: '/cobrands/fixmystreet/images/sprite.png' !default;
+.internal-link-fixed-header {
+ display: block;
+ /* 5em is roughly the height of .nav-wrapper-2 (4em) plus the border-top on
+ .nav-wrapper-2 (4px), plus the padding-top on .item-list__item (0.5em). */
+ padding-top: 5em;
+ margin-top: -5em;
+}
+
//hacks for desk/mob only stuff
.desk-only {
display: block;