From 50c61f97568b59d6430c32fdcde7b76ac9f6f6f3 Mon Sep 17 00:00:00 2001 From: Zarino Zappia Date: Fri, 11 Mar 2016 16:33:10 +0000 Subject: Absolutely position map pages. This simplifies the page layout and code. We add a new #map_sidebar for sidebar positioning, and a $mappage-header-height (defaulting to 4em) variable. We no longer need: * position_map_box; * map_fix; * special visual centre calculation; or * custom pan zoom positioning. As the sidebar now scrolls by itself and nothing can extend outside: * The big-green-banner is set to 100% width (with negative margins no longer required); * For cobrands that have an overhanging sidebar (e.g. Zurich), we add a .with-notes variant that adds a second column to the sidebar, perfect for containing secondary notes about the form. The resizing of the banner also required some tweaking to the size of the chevron-white SVG images. Update the $.fn.drawer() method for the new layout. Works well in IE7+8, and degrades gracefully in IE6. For IE7, we remove the existing z-index hacks, and put a new, simpler, one in, and fix a CSS bug that was hiding the map. Various cobrands are updated to adapt to the changes. --- templates/web/base/around/display_location.html | 43 +++++++++++----------- templates/web/base/header.html | 1 - templates/web/base/my/my.html | 9 +++-- templates/web/base/questionnaire/index.html | 4 ++ templates/web/base/report/display.html | 6 ++- templates/web/base/report/new/fill_in_details.html | 34 ++++++++++------- .../web/base/report/new/fill_in_details_form.html | 2 +- .../web/base/report/new/login_success_form.html | 2 +- .../web/base/report/new/oauth_email_form.html | 2 +- templates/web/base/reports/body.html | 4 +- templates/web/bromley/report/display.html | 19 +++++----- templates/web/eastsussex/header.html.template | 1 - templates/web/fiksgatami/header.html | 1 - templates/web/harrogate/header.html | 1 - templates/web/hart/header.html | 13 ------- templates/web/oxfordshire/header.html | 1 - .../web/seesomething/around/display_location.html | 22 ++++++----- .../web/seesomething/tokens/confirm_problem.html | 24 +++++++----- templates/web/stevenage/header.html | 1 - templates/web/warwickshire/header.html | 1 - templates/web/zurich/admin/header.html | 1 - templates/web/zurich/admin/report_edit-sdm.html | 4 ++ templates/web/zurich/admin/report_edit.html | 4 ++ templates/web/zurich/header.html | 1 - .../zurich/report/new/fill_in_details_form.html | 29 +-------------- templates/web/zurich/report/new/sidebar.html | 22 +++++++++++ templates/web/zurich/reports/index.html | 29 ++++++++------- 27 files changed, 146 insertions(+), 135 deletions(-) create mode 100644 templates/web/zurich/report/new/sidebar.html (limited to 'templates') diff --git a/templates/web/base/around/display_location.html b/templates/web/base/around/display_location.html index 7bf62e528..337b97b8e 100755 --- a/templates/web/base/around/display_location.html +++ b/templates/web/base/around/display_location.html @@ -7,7 +7,7 @@ = pc ? c.uri_for( "/rss/pc", pc ) : c.uri_for( "/rss/l/$latitude,$longitude" ); - + email_url = c.uri_for( '/alert/list', { @@ -28,6 +28,7 @@ ); PROCESS "maps/${map.type}.html" around_page = 1; + sidebar_html = PROCESS 'report/new/sidebar.html' js = 1 report.used_map = 1; SET bodyclass = 'mappage'; SET rss = [ tprintf(loc('Recent local problems, %s', "%s is the site name"), site_name), rss_url ]; @@ -71,32 +72,32 @@ +
- -
- - [% IF allow_creation %] +
+ [% IF allow_creation %] [% INCLUDE 'around/_report_banner.html' %] [% TRY %][% INCLUDE 'around/extra_text.html' %][% CATCH file %][% END %] - [% END %] - - [% INCLUDE 'around/_updates.html' %] + [% END %] + + [% INCLUDE 'around/_updates.html' %] +
+ [% INCLUDE "around/tabbed_lists.html" %] +
+
+ + [% IF allow_creation %] + + [% END %] -
- [% INCLUDE "around/tabbed_lists.html" %] -
- [% IF allow_creation %] - - [% END %] - [% IF allow_creation %] [% END %] diff --git a/templates/web/base/header.html b/templates/web/base/header.html index 7ef37675a..5f4fba1df 100644 --- a/templates/web/base/header.html +++ b/templates/web/base/header.html @@ -34,7 +34,6 @@ - [% INCLUDE 'common_header_tags.html' %] [% extra_js %] diff --git a/templates/web/base/my/my.html b/templates/web/base/my/my.html index c3911d4c1..b56998161 100644 --- a/templates/web/base/my/my.html +++ b/templates/web/base/my/my.html @@ -7,9 +7,11 @@ [% IF problems.size %] [% map_html %]
-
+
+
[% ELSE %] -
+
+
[% END %]

[% loc('Your Reports') %]

@@ -63,6 +65,7 @@ [% "" IF loop.last %] [% END %] -
+
+
[% INCLUDE 'footer.html' %] diff --git a/templates/web/base/questionnaire/index.html b/templates/web/base/questionnaire/index.html index 1068e21e3..312300b9d 100644 --- a/templates/web/base/questionnaire/index.html +++ b/templates/web/base/questionnaire/index.html @@ -9,6 +9,8 @@
+
+

[% loc('Questionnaire') %]

[% loc('Your report') %]

@@ -107,4 +109,6 @@ +
+ [% INCLUDE 'footer.html' %] diff --git a/templates/web/base/report/display.html b/templates/web/base/report/display.html index 05e07d501..e9f0b2914 100644 --- a/templates/web/base/report/display.html +++ b/templates/web/base/report/display.html @@ -1,4 +1,4 @@ -[% +[% SET bodyclass = 'mappage'; PROCESS "report/photo-js.html"; PROCESS "maps/${map.type}.html"; @@ -13,6 +13,8 @@ [% map_html %]
+
+ [% IF login_success %]

[% loc('You have successfully signed in; please check and confirm your details are accurate:') %]

[% INCLUDE 'report/update-form.html' %] @@ -41,4 +43,6 @@ [% INCLUDE 'report/update-form.html' %] [% END %] +
+ [% INCLUDE 'footer.html' %] diff --git a/templates/web/base/report/new/fill_in_details.html b/templates/web/base/report/new/fill_in_details.html index 55b3a5207..fc272b533 100644 --- a/templates/web/base/report/new/fill_in_details.html +++ b/templates/web/base/report/new/fill_in_details.html @@ -1,6 +1,9 @@ [% + sidebar_html = PROCESS 'report/new/sidebar.html'; + SET bodyclass = ''; SET bodyclass = 'mappage' IF report.used_map; + SET bodyclass = bodyclass _ " with-notes" IF sidebar_html; PROCESS "maps/${map.type}.html" IF report.used_map; INCLUDE 'header.html', title => loc('Reporting a problem'); %] @@ -25,24 +28,27 @@ - [% IF report.used_map %] - [% map_html %] -
+ [% IF report.used_map %] + [% map_html %] + +
- [% ELSE %] + [% ELSE %] +
- [% END %] + [% END %] + +
+ [% IF login_success %] + [% PROCESS 'report/new/login_success_form.html' %] + [% ELSIF oauth_need_email %] + [% PROCESS 'report/new/oauth_email_form.html' %] + [% ELSE %] + [% PROCESS 'report/new/fill_in_details_form.html' %] + [% END %] +
-
- [% IF login_success %] - [% PROCESS 'report/new/login_success_form.html' %] - [% ELSIF oauth_need_email %] - [% PROCESS 'report/new/oauth_email_form.html' %] - [% ELSE %] - [% PROCESS 'report/new/fill_in_details_form.html' %] - [% END %]
-
diff --git a/templates/web/base/report/new/fill_in_details_form.html b/templates/web/base/report/new/fill_in_details_form.html index f9da3753f..663b13e6a 100644 --- a/templates/web/base/report/new/fill_in_details_form.html +++ b/templates/web/base/report/new/fill_in_details_form.html @@ -23,7 +23,7 @@

[% loc('Sorry, we could not log you in. Please fill in the form below.') %]

[% END %] -[% TRY %][% PROCESS 'report/new/sidebar.html' %][% CATCH file %][% END %] +[% sidebar_html %] [% INCLUDE 'errors.html' %] diff --git a/templates/web/base/report/new/login_success_form.html b/templates/web/base/report/new/login_success_form.html index 45d0221a7..2eade7c7d 100644 --- a/templates/web/base/report/new/login_success_form.html +++ b/templates/web/base/report/new/login_success_form.html @@ -2,7 +2,7 @@

[% loc('You have successfully signed in; please check and confirm your details are accurate:') %]

-[% TRY %][% PROCESS 'report/new/sidebar.html' %][% CATCH file %][% END %] +[% sidebar_html %] [% INCLUDE 'errors.html' %] diff --git a/templates/web/base/report/new/oauth_email_form.html b/templates/web/base/report/new/oauth_email_form.html index c897aaeea..2c9b1a3ca 100644 --- a/templates/web/base/report/new/oauth_email_form.html +++ b/templates/web/base/report/new/oauth_email_form.html @@ -5,7 +5,7 @@ [% loc('We need your email address, please give it below.') %]

-[% TRY %][% PROCESS 'report/new/sidebar.html' %][% CATCH file %][% END %] +[% sidebar_html %] [% INCLUDE 'errors.html' %] diff --git a/templates/web/base/reports/body.html b/templates/web/base/reports/body.html index 2ec409765..55f9a0881 100755 --- a/templates/web/base/reports/body.html +++ b/templates/web/base/reports/body.html @@ -27,7 +27,8 @@ [% map_html %]
-
+
+

[% IF ward %] @@ -66,5 +67,6 @@ [% INCLUDE 'pagination.html', param = 'p' %] +

[% INCLUDE 'footer.html' %] diff --git a/templates/web/bromley/report/display.html b/templates/web/bromley/report/display.html index da83e005f..06db8f001 100644 --- a/templates/web/bromley/report/display.html +++ b/templates/web/bromley/report/display.html @@ -1,4 +1,4 @@ -[% +[% PROCESS "report/photo-js.html"; PROCESS "maps/${map.type}.html"; @@ -11,9 +11,10 @@ %] [% map_html %] -
+
+ [% IF login_success %]

[% loc('You have successfully signed in; please check and confirm your details are accurate:') %]

[% END %] @@ -107,12 +108,12 @@ [% ELSE %] [% IF problem.is_fixed AND c.user_exists AND c.user.id == problem.user_id %] - + - + [% ELSIF !problem.is_fixed %] - +
@@ -124,9 +125,9 @@ [% IF c.user_exists %] [% INCLUDE name %] - + - + [% ELSE %] @@ -146,7 +147,7 @@
Confirm my report by email
[% INCLUDE name %] - +
@@ -185,7 +186,7 @@
- +
[% INCLUDE 'footer.html' %] diff --git a/templates/web/eastsussex/header.html.template b/templates/web/eastsussex/header.html.template index d80d4101a..325d1b6e6 100644 --- a/templates/web/eastsussex/header.html.template +++ b/templates/web/eastsussex/header.html.template @@ -10,7 +10,6 @@ - [% INCLUDE 'common_header_tags.html' %] [% extra_js %] diff --git a/templates/web/fiksgatami/header.html b/templates/web/fiksgatami/header.html index 5bc0eaf4b..b6ca67d24 100644 --- a/templates/web/fiksgatami/header.html +++ b/templates/web/fiksgatami/header.html @@ -23,7 +23,6 @@ - [% INCLUDE 'common_header_tags.html' %] [% extra_js %] diff --git a/templates/web/harrogate/header.html b/templates/web/harrogate/header.html index 451832dda..7ee3a93d2 100644 --- a/templates/web/harrogate/header.html +++ b/templates/web/harrogate/header.html @@ -23,7 +23,6 @@ - [% INCLUDE 'common_header_tags.html' %] [% extra_js %] diff --git a/templates/web/hart/header.html b/templates/web/hart/header.html index 6337aad64..c52ec0af7 100644 --- a/templates/web/hart/header.html +++ b/templates/web/hart/header.html @@ -24,21 +24,8 @@ - [% INCLUDE 'common_header_tags.html' %] [% extra_js %] - diff --git a/templates/web/oxfordshire/header.html b/templates/web/oxfordshire/header.html index e69757dad..6ad9b8f62 100644 --- a/templates/web/oxfordshire/header.html +++ b/templates/web/oxfordshire/header.html @@ -21,7 +21,6 @@ - [% INCLUDE 'common_header_tags.html' %] [% extra_js %] diff --git a/templates/web/seesomething/around/display_location.html b/templates/web/seesomething/around/display_location.html index b54311264..3ed7cac46 100644 --- a/templates/web/seesomething/around/display_location.html +++ b/templates/web/seesomething/around/display_location.html @@ -11,6 +11,7 @@ ); PROCESS "maps/${map.type}.html"; + sidebar_html = PROCESS 'report/new/sidebar.html', js = 1, report.used_map = 1; INCLUDE 'header.html', title => loc('Viewing a location') @@ -29,19 +30,20 @@ [% map_html %] -
-
+
+
[% INCLUDE 'around/_report_banner.html' %] -
- - + +
diff --git a/templates/web/seesomething/tokens/confirm_problem.html b/templates/web/seesomething/tokens/confirm_problem.html index 4a11d14b4..0a455434b 100644 --- a/templates/web/seesomething/tokens/confirm_problem.html +++ b/templates/web/seesomething/tokens/confirm_problem.html @@ -11,19 +11,23 @@ %] - [% IF report.used_map %] +[% IF report.used_map %] [% map_html %] -
- [% END %] +
+[% END %] + +
+
+

Complete

+

Your report has been sent. If you included contact details we may be in touch to follow up or request more details.

+

Thank you for saying something and making our transport safer.

+

British Transport Police and the West Midlands Police

+
+
-
-
-

Complete

-

Your report has been sent. If you included contact details we may be in touch to follow up or request more details.

-

Thank you for saying something and making our transport safer.

-

British Transport Police and the West Midlands Police

-
+[% IF report.used_map %]
+[% END %] [% INCLUDE 'footer.html' %] diff --git a/templates/web/stevenage/header.html b/templates/web/stevenage/header.html index ffcc9ec86..1f124f5aa 100644 --- a/templates/web/stevenage/header.html +++ b/templates/web/stevenage/header.html @@ -19,7 +19,6 @@ - [% INCLUDE 'common_header_tags.html' %] [% extra_js %] diff --git a/templates/web/warwickshire/header.html b/templates/web/warwickshire/header.html index c6d2bc048..b76ecc2ae 100644 --- a/templates/web/warwickshire/header.html +++ b/templates/web/warwickshire/header.html @@ -27,7 +27,6 @@ - [% INCLUDE 'common_header_tags.html' %] diff --git a/templates/web/zurich/admin/header.html b/templates/web/zurich/admin/header.html index 929df8352..a423cf22f 100644 --- a/templates/web/zurich/admin/header.html +++ b/templates/web/zurich/admin/header.html @@ -23,7 +23,6 @@ .overdue { background-color: #ffcccc; } select { width: auto; } .admin-report-edit select { max-width: 100%; } - #fms_pan_zoom { top: 13em !important; } - [% INCLUDE 'common_header_tags.html' %] [% extra_js %] 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 1e9db6b31..21acab609 100644 --- a/templates/web/zurich/report/new/fill_in_details_form.html +++ b/templates/web/zurich/report/new/fill_in_details_form.html @@ -1,33 +1,8 @@ +[% sidebar_html %] +

[% loc('Reporting a problem') %]

-
- - - - - -
- [% INCLUDE 'errors.html' %]
diff --git a/templates/web/zurich/report/new/sidebar.html b/templates/web/zurich/report/new/sidebar.html new file mode 100644 index 000000000..2e3d148d2 --- /dev/null +++ b/templates/web/zurich/report/new/sidebar.html @@ -0,0 +1,22 @@ +
+ + + +
diff --git a/templates/web/zurich/reports/index.html b/templates/web/zurich/reports/index.html index fd0efcf94..5f7613a1c 100755 --- a/templates/web/zurich/reports/index.html +++ b/templates/web/zurich/reports/index.html @@ -7,24 +7,25 @@ [% map_html %]
-
+
+
-

[% loc('All Reports') %]

+

[% loc('All Reports') %]

-[% INCLUDE 'pagination.html', param = 'p' %] + [% INCLUDE 'pagination.html', param = 'p' %] -
- [% IF problems.0 %] -
    - [% FOREACH problem IN problems.0 %] - [% INCLUDE 'reports/_list-entry.html' %] - [% END %] -
- [% END %] -
+
+ [% IF problems.0 %] +
    + [% FOREACH problem IN problems.0 %] + [% INCLUDE 'reports/_list-entry.html' %] + [% END %] +
+ [% END %] +
-[% INCLUDE 'pagination.html', param = 'p' %] + [% INCLUDE 'pagination.html', param = 'p' %] +
[% INCLUDE 'footer.html' %] - -- cgit v1.2.3