diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-07-01 13:35:17 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-07-04 16:26:56 +0100 |
commit | 88933aa8df0f748dce8188cde99b6199ae070864 (patch) | |
tree | 11a5ad35d1ab675a18ec73b752d35f8540414cc4 | |
parent | 45aaf63033e7d4d24ba570f7460746fe28f9f59f (diff) |
Make sure map JS works through an admin proxy.
Tidy up use of absolute URLs when in the admin.
Have the 404 handler spot static files in admin as a fallback.
31 files changed, 104 insertions, 113 deletions
diff --git a/conf/general.yml-example b/conf/general.yml-example index 749b9e716..aa8d431be 100644 --- a/conf/general.yml-example +++ b/conf/general.yml-example @@ -155,8 +155,8 @@ ALLOWED_COBRANDS: - cobrand2: 'hostname_substring2' - cobrand3 -# This is only used in "offensive report" emails to provide a link directly to -# the admin interface. If wanted, set to the full URL of your admin interface. +# This is used in e.g. "offensive report" emails to provide a link directly to +# the admin interface. Defaults to BASE_URL with "/admin" on the end. ADMIN_BASE_URL: '' # How many items are returned in the GeoRSS feeds by default diff --git a/perllib/FixMyStreet/App/Controller/Root.pm b/perllib/FixMyStreet/App/Controller/Root.pm index 16f4aa491..88f480137 100644 --- a/perllib/FixMyStreet/App/Controller/Root.pm +++ b/perllib/FixMyStreet/App/Controller/Root.pm @@ -82,6 +82,13 @@ Display a 404 (not found) or 410 (gone) page. Pass in an optional error message sub page_error_404_not_found : Private { my ( $self, $c, $error_msg ) = @_; + + # Try getting static content that might be given under an admin proxy. + # First the special generated JavaScript file + $c->go('/js/translation_strings', [ $1 ], []) if $c->req->path =~ m{^admin/js/translation_strings\.(.*?)\.js$}; + # Then a generic static file + $c->serve_static_file("web/$1") && return if $c->req->path =~ m{^admin/(.*)}; + $c->stash->{template} = 'errors/page_error_404_not_found.html'; $c->stash->{error_msg} = $error_msg; $c->response->status(404); diff --git a/perllib/FixMyStreet/App/View/Web.pm b/perllib/FixMyStreet/App/View/Web.pm index a92021f0c..d43d3af7e 100644 --- a/perllib/FixMyStreet/App/View/Web.pm +++ b/perllib/FixMyStreet/App/View/Web.pm @@ -176,7 +176,8 @@ sub version { $version_hash{$file} = ( stat( $path ) )[9]; } $version_hash{$file} ||= ''; - return "$file?$version_hash{$file}"; + my $admin = $self->template->context->stash->{admin} ? FixMyStreet->config('ADMIN_BASE_URL') : ''; + return "$admin$file?$version_hash{$file}"; } sub decode { diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 76d73d96e..5c7ce10c4 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -133,7 +133,10 @@ Base URL for the admin interface. =cut -sub admin_base_url { FixMyStreet->config('ADMIN_BASE_URL') || '' } +sub admin_base_url { + my $self = shift; + return FixMyStreet->config('ADMIN_BASE_URL') || $self->base_url . "/admin"; +} =head2 base_url diff --git a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm index 7b175f371..ba26b7a2c 100644 --- a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm +++ b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm @@ -32,10 +32,6 @@ sub area_types { [ 'NKO', 'NFY', 'NRA' ]; } -sub admin_base_url { - return 'http://www.fiksgatami.no/admin'; -} - sub geocode_postcode { my ( $self, $s ) = @_; diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm index 61011a414..b321a21c4 100644 --- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm +++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm @@ -23,10 +23,6 @@ sub restriction { return {}; } -sub admin_base_url { - return 'https://secure.mysociety.org/admin/bci'; -} - sub title_list { my $self = shift; my $areas = shift; diff --git a/perllib/FixMyStreet/Cobrand/FixaMinGata.pm b/perllib/FixMyStreet/Cobrand/FixaMinGata.pm index e6e54926f..9ffbf00b8 100644 --- a/perllib/FixMyStreet/Cobrand/FixaMinGata.pm +++ b/perllib/FixMyStreet/Cobrand/FixaMinGata.pm @@ -33,10 +33,6 @@ sub area_types { [ 'KOM' ]; } -sub admin_base_url { - return 'http://www.fixamingata.se/admin/'; -} - # If lat/lon are present in the URL, OpenLayers will use that to centre the map. # Need to specify a zoom to stop it defaulting to null/0. sub uri { diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t index f8f280d63..007948299 100644 --- a/t/app/controller/admin.t +++ b/t/app/controller/admin.t @@ -1232,7 +1232,7 @@ subtest "Check admin_base_url" => sub { my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($report->cobrand)->new(); is ($report->admin_url($cobrand), - (sprintf 'https://secure.mysociety.org/admin/bci/report_edit/%d', $report_id), + (sprintf 'http://www.example.org/admin/report_edit/%d', $report_id), 'get_admin_url OK'); }; diff --git a/templates/web/base/admin/header.html b/templates/web/base/admin/header.html index ddaa4aa44..517b984e3 100644 --- a/templates/web/base/admin/header.html +++ b/templates/web/base/admin/header.html @@ -1,6 +1,7 @@ [% SET bodyclass = bodyclass || 'fullwidthpage'; - INCLUDE 'header.html' admin = 1, bodyclass = bodyclass _ ' admin'; + SET admin = 1; + INCLUDE 'header.html' bodyclass = bodyclass _ ' admin'; %] <style type="text/css"> dt { clear: left; float: left; font-weight: bold; } diff --git a/templates/web/base/admin/report_edit.html b/templates/web/base/admin/report_edit.html index 677c2a171..351cf86f1 100644 --- a/templates/web/base/admin/report_edit.html +++ b/templates/web/base/admin/report_edit.html @@ -1,5 +1,5 @@ [% - PROCESS "maps/${map.type}.html"; + PROCESS "maps/${map.type}.html" admin = 1; INCLUDE 'admin/header.html' title = tprintf(loc('Editing problem %d'), problem.id ), bodyclass = 'mappage with-notes'; diff --git a/templates/web/base/common_header_tags.html b/templates/web/base/common_header_tags.html index 8cd342042..184e2c297 100644 --- a/templates/web/base/common_header_tags.html +++ b/templates/web/base/common_header_tags.html @@ -1,28 +1,30 @@ [% USE date %][% USE Math %] +[% SET start = c.config.ADMIN_BASE_URL IF admin %] + <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="cobrand" content="[% c.cobrand.moniker %]"> <script type="text/javascript" src="[% start %]/js/translation_strings.[% lang_code %].js?[% Math.int( date.now / 3600 ) %]"></script> -<script type="text/javascript" src="[% start %]/jslib/jquery-1.7.2.min.js"></script> -<script type="text/javascript" src="[% start %][% version('/js/validation_rules.js') %]"></script> -<script src="[% start %][% version('/js/jquery.validate.min.js') %]" type="text/javascript" charset="utf-8"></script> -<script type="text/javascript" src="[% start %][% version('/js/dropzone.min.js') %]"></script> +<script type="text/javascript" src="[% version('/jslib/jquery-1.7.2.min.js') %]"></script> +<script type="text/javascript" src="[% version('/js/validation_rules.js') %]"></script> +<script src="[% version('/js/jquery.validate.min.js') %]" type="text/javascript" charset="utf-8"></script> +<script type="text/javascript" src="[% version('/js/dropzone.min.js') %]"></script> -<script type="text/javascript" src="[% start %][% version('/js/geo.min.js') %]"></script> -<script type="text/javascript" src="[% start %][% version('/js/fixmystreet.js') %]"></script> -<script type="text/javascript" src="[% start %][% version('/cobrands/fixmystreet/fixmystreet.js') %]"></script> +<script type="text/javascript" src="[% version('/js/geo.min.js') %]"></script> +<script type="text/javascript" src="[% version('/js/fixmystreet.js') %]"></script> +<script type="text/javascript" src="[% version('/cobrands/fixmystreet/fixmystreet.js') %]"></script> [% IF admin %] - <script src="[% start %]/js/jquery-ui/js/jquery-ui-1.10.3.custom.min.js"></script> - <link rel="stylesheet" href="[% start %]/js/jquery-ui/css/smoothness/jquery-ui-1.10.3.custom.min.css" /> - <script type="text/javascript" src="[% start %][% version('/js/fixmystreet-admin.js') %]"></script> + <script src="[% version('/js/jquery-ui/js/jquery-ui-1.10.3.custom.min.js') %]"></script> + <link rel="stylesheet" href="[% version('/js/jquery-ui/css/smoothness/jquery-ui-1.10.3.custom.min.css') %]"> + <script type="text/javascript" src="[% version('/js/fixmystreet-admin.js') %]"></script> [% END %] [% moderating = c.user && c.user.has_permission_to('moderate', problem.bodies_str) %] [% IF moderating %] - <script type="text/javascript" src="[% start %][% version('/js/moderate.js') %]"></script> + <script type="text/javascript" src="[% version('/js/moderate.js') %]"></script> [% END %] [% map_js %] diff --git a/templates/web/base/header.html b/templates/web/base/header.html index 3117b819f..b57f5d50f 100644 --- a/templates/web/base/header.html +++ b/templates/web/base/header.html @@ -16,8 +16,7 @@ <meta name="mobileoptimized" content="0"> [% INCLUDE 'header_opengraph.html' %] - [% SET start = c.config.ADMIN_BASE_URL IF admin; - + [% # For clarity, the 'fixmystreet' moniker (for fixmystreet.com) puts # it stylesheets under fixmystreet.com IF c.cobrand.moniker == 'fixmystreet'; @@ -25,14 +24,14 @@ ELSE; SET css_dir = c.cobrand.moniker; END %] - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ css_dir _ '/base.css') %]"> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ css_dir _ '/layout.css') %]" media="(min-width:48em)"> + <link rel="stylesheet" href="[% version('/cobrands/' _ css_dir _ '/base.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ css_dir _ '/layout.css') %]" media="(min-width:48em)"> [% extra_css %] <!--[if (lt IE 9) & (!IEMobile)]> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ css_dir _ '/layout.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ css_dir _ '/layout.css') %]"> <![endif]--> - <script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script> + <script src="[% version('/js/modernizr.custom.js') %]" charset="utf-8"></script> [% INCLUDE 'common_header_tags.html' %] [% extra_js %] diff --git a/templates/web/base/maps/noscript_map.html b/templates/web/base/maps/noscript_map.html index aaaa217c9..edcba28a6 100644 --- a/templates/web/base/maps/noscript_map.html +++ b/templates/web/base/maps/noscript_map.html @@ -1,3 +1,4 @@ +[% SET start = c.config.ADMIN_BASE_URL IF admin -%] <div class="noscript"> <div id="[% nsm_prefix %]drag"> <[% map.img_type %] @@ -39,13 +40,13 @@ SET zoom_out = '#' IF map.zoom <= 0; %] <div style="position: absolute; left: 4px; top: 4px;" class="olControlPanZoom olControlNoSelect" unselectable="on"> - <div style="position: absolute; left: 13px; top: 4px; width: 18px; height: 18px;"><a rel="nofollow" href="[% north %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/north-mini.png" border="0"></a></div> - <div style="position: absolute; left: 4px; top: 22px; width: 18px; height: 18px;"><a rel="nofollow" href="[% west %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/west-mini.png" border="0"></a></div> - <div style="position: absolute; left: 22px; top: 22px; width: 18px; height: 18px;"><a rel="nofollow" href="[% east %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/east-mini.png" border="0"></a></div> - <div style="position: absolute; left: 13px; top: 40px; width: 18px; height: 18px;"><a rel="nofollow" href="[% south %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/south-mini.png" border="0"></a></div> - <div style="position: absolute; left: 13px; top: 63px; width: 18px; height: 18px;"><a rel="nofollow" href="[% zoom_in %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/zoom-plus-mini.png" border="0"></a></div> - <div style="position: absolute; left: 13px; top: 81px; width: 18px; height: 18px;"><a rel="nofollow" href="[% world %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/zoom-world-mini.png" border="0"></a></div> - <div style="position: absolute; left: 13px; top: 99px; width: 18px; height: 18px;"><a rel="nofollow" href="[% zoom_out %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/zoom-minus-mini.png" border="0"></a></div> + <div style="position: absolute; left: 13px; top: 4px; width: 18px; height: 18px;"><a rel="nofollow" href="[% north %]"><img style="position: relative; width: 18px; height: 18px;" src="[% start %]/js/OpenLayers-2.13.1/img/north-mini.png" border="0"></a></div> + <div style="position: absolute; left: 4px; top: 22px; width: 18px; height: 18px;"><a rel="nofollow" href="[% west %]"><img style="position: relative; width: 18px; height: 18px;" src="[% start %]/js/OpenLayers-2.13.1/img/west-mini.png" border="0"></a></div> + <div style="position: absolute; left: 22px; top: 22px; width: 18px; height: 18px;"><a rel="nofollow" href="[% east %]"><img style="position: relative; width: 18px; height: 18px;" src="[% start %]/js/OpenLayers-2.13.1/img/east-mini.png" border="0"></a></div> + <div style="position: absolute; left: 13px; top: 40px; width: 18px; height: 18px;"><a rel="nofollow" href="[% south %]"><img style="position: relative; width: 18px; height: 18px;" src="[% start %]/js/OpenLayers-2.13.1/img/south-mini.png" border="0"></a></div> + <div style="position: absolute; left: 13px; top: 63px; width: 18px; height: 18px;"><a rel="nofollow" href="[% zoom_in %]"><img style="position: relative; width: 18px; height: 18px;" src="[% start %]/js/OpenLayers-2.13.1/img/zoom-plus-mini.png" border="0"></a></div> + <div style="position: absolute; left: 13px; top: 81px; width: 18px; height: 18px;"><a rel="nofollow" href="[% world %]"><img style="position: relative; width: 18px; height: 18px;" src="[% start %]/js/OpenLayers-2.13.1/img/zoom-world-mini.png" border="0"></a></div> + <div style="position: absolute; left: 13px; top: 99px; width: 18px; height: 18px;"><a rel="nofollow" href="[% zoom_out %]"><img style="position: relative; width: 18px; height: 18px;" src="[% start %]/js/OpenLayers-2.13.1/img/zoom-minus-mini.png" border="0"></a></div> </div> [% END %] @@ -55,7 +56,7 @@ [% IF pin.id %] <a title="[% pin.title | html %]" href="[% c.uri_for('/report/' _ pin.id) %]"> [%- END -%] -<img border="0" class="pin" src="[% c.uri_for( c.cobrand.path_to_pin_icons _ 'pin-' _ pin.colour _ '.png') %]" +<img border="0" class="pin" src="[% start %][% c.cobrand.path_to_pin_icons _ 'pin-' _ pin.colour _ '.png' %]" alt="[% loc('Problem') %]" style="top:[% pin.py - 64 %]px; left:[% pin.px - 24 %]px; position: absolute;"> [%- IF pin.id -%] </a> diff --git a/templates/web/base/maps/openlayers.html b/templates/web/base/maps/openlayers.html index 1e7ae5ce8..698ae2dab 100644 --- a/templates/web/base/maps/openlayers.html +++ b/templates/web/base/maps/openlayers.html @@ -18,7 +18,7 @@ var fixmystreet = { [% IF map.zoom -%] 'zoom': [% map.zoom %], [%- END %] - 'pin_prefix': '[% c.cobrand.path_to_pin_icons %]', + 'pin_prefix': '[% c.config.ADMIN_BASE_URL IF admin %][% c.cobrand.path_to_pin_icons %]', 'numZoomLevels': [% map.numZoomLevels %], 'zoomOffset': [% map.zoomOffset %], 'map_type': [% map.map_type %], diff --git a/templates/web/bristol/header_extra.html b/templates/web/bristol/header_extra.html index d03e34e1f..fd20823ae 100644 --- a/templates/web/bristol/header_extra.html +++ b/templates/web/bristol/header_extra.html @@ -1,2 +1,2 @@ -<script src="[% start %][% version('/cobrands/fixmystreet-uk-councils/js.js') %]"></script> +<script src="[% version('/cobrands/fixmystreet-uk-councils/js.js') %]"></script> [% INCLUDE 'tracking_code.html' %] diff --git a/templates/web/bromley/header_extra.html b/templates/web/bromley/header_extra.html index c7fe5f3e3..57066dbe8 100644 --- a/templates/web/bromley/header_extra.html +++ b/templates/web/bromley/header_extra.html @@ -1 +1 @@ -<script src="[% start %][% version('/cobrands/bromley/a-z-nav.js') %]" charset="utf-8"></script>
\ No newline at end of file +<script src="[% version('/cobrands/bromley/a-z-nav.js') %]" charset="utf-8"></script> diff --git a/templates/web/eastsussex/header.html.template b/templates/web/eastsussex/header.html.template index 325d1b6e6..2963dc642 100644 --- a/templates/web/eastsussex/header.html.template +++ b/templates/web/eastsussex/header.html.template @@ -3,16 +3,16 @@ <head> {MetadataDesktop} - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="(min-width:48em)"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="(min-width:48em)"> [% extra_css %] <!--[if (lt IE 9) & (!IEMobile)]> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> <![endif]--> [% INCLUDE 'common_header_tags.html' %] [% extra_js %] - <script src="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/report-form.js') %]"></script> + <script src="[% version('/cobrands/' _ c.cobrand.moniker _ '/report-form.js') %]"></script> [% IF c.req.uri.host == 'osm.fixmystreet.com' %] <link rel="canonical" href="http://www.fixmystreet.com[% c.req.uri.path_query %]"> diff --git a/templates/web/fiksgatami/header.html b/templates/web/fiksgatami/header.html index f22e97fef..0459ed5d7 100644 --- a/templates/web/fiksgatami/header.html +++ b/templates/web/fiksgatami/header.html @@ -12,16 +12,14 @@ [% INCLUDE 'header_opengraph.html' %] -[% SET start = c.config.ADMIN_BASE_URL IF admin %] - - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="(min-width:48em)"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="(min-width:48em)"> [% extra_css %] <!--[if (lt IE 9) & (!IEMobile)]> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> <![endif]--> - <script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script> + <script src="[% version('/js/modernizr.custom.js') %]" charset="utf-8"></script> [% INCLUDE 'common_header_tags.html' %] [% extra_js %] diff --git a/templates/web/fixmystreet-uk-councils/header_extra.html b/templates/web/fixmystreet-uk-councils/header_extra.html index 9e614f177..cf8fa7301 100644 --- a/templates/web/fixmystreet-uk-councils/header_extra.html +++ b/templates/web/fixmystreet-uk-councils/header_extra.html @@ -1 +1 @@ -<script src="[% start %][% version('/cobrands/fixmystreet-uk-councils/js.js') %]"></script> +<script src="[% version('/cobrands/fixmystreet-uk-councils/js.js') %]"></script> diff --git a/templates/web/fixmystreet.com/about/council.html b/templates/web/fixmystreet.com/about/council.html index 32a86ef25..8552d0d86 100644 --- a/templates/web/fixmystreet.com/about/council.html +++ b/templates/web/fixmystreet.com/about/council.html @@ -25,7 +25,7 @@ <p>And it worked. Residents loved the easy interface; councils welcomed the shift to digital. Now we’ve developed FixMyStreet for Councils, allowing you to bring the award-winning FixMyStreet experience directly to your own council website’s users.</p> <p>FixMyStreet for Councils creates a council-branded, seamless fault-reporting interface for your site, integrating directly with your back-office systems, and available via web or mobile.</p> </div> - <img class="flush-image flush-image--bottom" src="[% start %][% version('/cobrands/fixmystreet.com/images/fms-for-councils/responsive.png') %]" alt="" /> + <img class="flush-image flush-image--bottom" src="[% version('/cobrands/fixmystreet.com/images/fms-for-councils/responsive.png') %]" alt="" /> </div> </div> <div class="councils-section"> @@ -51,7 +51,7 @@ <p>Patchy coverage in some parts of your borough? That’s fine: the FixMyStreet for Councils apps will store any report as it’s made, then send it off once there is access to a connection.</p> <p>We know that not everyone’s on an iPhone or Android device. No problem - your reporting interface can also be accessed via any smartphone browser, as a mobile-optimised website</p> </div> - <img class="flush-image flush-image--bottom" src="[% start %][% version('/cobrands/fixmystreet.com/images/fms-for-councils/iphone.png') %]" alt="" /> + <img class="flush-image flush-image--bottom" src="[% version('/cobrands/fixmystreet.com/images/fms-for-councils/iphone.png') %]" alt="" /> </div> </div> @@ -83,7 +83,7 @@ <p>You can tell us which types of reports are not your responsibility, and where we should route them instead.</p> <p>And you can tailor the text that we use at every step (or use ours - we’ve worked hard on it!).</p> </div> - <img class="flush-image flush-image--bottom-right" src="[% start %][% version('/cobrands/fixmystreet.com/images/fms-for-councils/hart.png') %]" alt="" /> + <img class="flush-image flush-image--bottom-right" src="[% version('/cobrands/fixmystreet.com/images/fms-for-councils/hart.png') %]" alt="" /> </div> </div> @@ -116,14 +116,14 @@ </div> <div class="client-logos"> - <a href="http://fix.bromley.gov.uk/"><img src="[% start %][% version('/cobrands/fixmystreet.com/images/fms-for-councils/bromley-logo.png') %]" alt="" /></a><!-- - --><a href="http://warwickshire.gov.uk/"><img src="[% start %][% version('/cobrands/fixmystreet.com/images/fms-for-councils/warwickshire-logo.png') %]" alt="" /></a><!-- - --><a href="http://fixmystreet.stevenage.gov.uk/"><img src="[% start %][% version('/cobrands/fixmystreet.com/images/fms-for-councils/stevenage-logo.png') %]" alt="" /></a><!-- - --><a href="http://hart.fixmystreet.com/"><img src="[% start %][% version('/cobrands/fixmystreet.com/images/fms-for-councils/hart-logo.png') %]" alt="" /></a><!-- - --><a href="http://fixmystreet.oxfordshire.gov.uk/"><img src="[% start %][% version('/cobrands/fixmystreet.com/images/fms-for-councils/oxfordshire-logo.png') %]" alt="" /></a><!-- - --><a href="https://www.zueriwieneu.ch/"><img src="[% start %][% version('/cobrands/fixmystreet.com/images/fms-for-councils/zurich-logo.png') %]" alt="" /></a><!-- - --><a href="http://eastsussex.fixmystreet.com/"><img src="[% start %][% version('/cobrands/fixmystreet.com/images/fms-for-councils/east-sussex-logo.png') %]" alt="" /></a><!-- - --><a href="https://fix.angus.gov.uk/"><img src="[% start %][% version('/cobrands/fixmystreet.com/images/fms-for-councils/angus-logo.png') %]" alt="" /></a> + <a href="http://fix.bromley.gov.uk/"><img src="[% version('/cobrands/fixmystreet.com/images/fms-for-councils/bromley-logo.png') %]" alt="" /></a><!-- + --><a href="http://warwickshire.gov.uk/"><img src="[% version('/cobrands/fixmystreet.com/images/fms-for-councils/warwickshire-logo.png') %]" alt="" /></a><!-- + --><a href="http://fixmystreet.stevenage.gov.uk/"><img src="[% version('/cobrands/fixmystreet.com/images/fms-for-councils/stevenage-logo.png') %]" alt="" /></a><!-- + --><a href="http://hart.fixmystreet.com/"><img src="[% version('/cobrands/fixmystreet.com/images/fms-for-councils/hart-logo.png') %]" alt="" /></a><!-- + --><a href="http://fixmystreet.oxfordshire.gov.uk/"><img src="[% version('/cobrands/fixmystreet.com/images/fms-for-councils/oxfordshire-logo.png') %]" alt="" /></a><!-- + --><a href="https://www.zueriwieneu.ch/"><img src="[% version('/cobrands/fixmystreet.com/images/fms-for-councils/zurich-logo.png') %]" alt="" /></a><!-- + --><a href="http://eastsussex.fixmystreet.com/"><img src="[% version('/cobrands/fixmystreet.com/images/fms-for-councils/east-sussex-logo.png') %]" alt="" /></a><!-- + --><a href="https://fix.angus.gov.uk/"><img src="[% version('/cobrands/fixmystreet.com/images/fms-for-councils/angus-logo.png') %]" alt="" /></a> </div> </div> diff --git a/templates/web/fixmystreet.com/header_extra.html b/templates/web/fixmystreet.com/header_extra.html index d37c141f2..08f1251aa 100644 --- a/templates/web/fixmystreet.com/header_extra.html +++ b/templates/web/fixmystreet.com/header_extra.html @@ -1,11 +1,11 @@ <meta name='theme-color' content='#ffd000'> <link rel="Shortcut Icon" type="image/x-icon" href="/cobrands/fixmystreet.com/favicon.ico"> -<script src="[% start %][% version('/js/jquery.cookie.min.js') %]"></script> -<script src="[% start %][% version('/cobrands/fixmystreet.com/js.js') %]"></script> +<script src="[% version('/js/jquery.cookie.min.js') %]"></script> +<script src="[% version('/cobrands/fixmystreet.com/js.js') %]"></script> [%# We are conducting an A/B experiment %] -[% IF c.config.BASE_URL == "https://www.fixmystreet.com" %] +[% IF c.config.BASE_URL == "https://www.fixmystreet.com" AND not admin %] <script src="//www.google-analytics.com/cx/api.js?experiment=ZwMlZkAhSbK_tP_QG64QrQ"></script> <script> var variation = cxApi.chooseVariation(), diff --git a/templates/web/hart/header.html b/templates/web/hart/header.html index 23264066c..a1472105d 100644 --- a/templates/web/hart/header.html +++ b/templates/web/hart/header.html @@ -12,17 +12,15 @@ [% INCLUDE 'header_opengraph.html' %] -[% SET start = c.config.ADMIN_BASE_URL IF admin %] - - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="(min-width:48em)"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="(min-width:48em)"> <link rel="stylesheet" href="[% version('/cobrands/hart/hart.css') %]"> [% extra_css %] <!--[if (lt IE 9) & (!IEMobile)]> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> <![endif]--> - <script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script> + <script src="[% version('/js/modernizr.custom.js') %]" charset="utf-8"></script> [% INCLUDE 'common_header_tags.html' %] [% extra_js %] diff --git a/templates/web/oxfordshire/header.html b/templates/web/oxfordshire/header.html index 0e4281df4..f9761aa96 100644 --- a/templates/web/oxfordshire/header.html +++ b/templates/web/oxfordshire/header.html @@ -10,16 +10,14 @@ <meta name="HandHeldFriendly" content="true"> <meta name="mobileoptimized" content="0"> -[% SET start = c.config.ADMIN_BASE_URL IF admin %] - - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="(min-width:48em)"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="(min-width:48em)"> [% extra_css %] <!--[if (lt IE 9) & (!IEMobile)]> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> <![endif]--> - <script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script> + <script src="[% version('/js/modernizr.custom.js') %]" charset="utf-8"></script> [% INCLUDE 'common_header_tags.html' %] [% extra_js %] diff --git a/templates/web/warwickshire/header.html b/templates/web/warwickshire/header.html index 4877e9a7c..14d1db37a 100644 --- a/templates/web/warwickshire/header.html +++ b/templates/web/warwickshire/header.html @@ -10,22 +10,22 @@ <link rel="shortcut icon" href="/cobrands/warwickshire/gamma/images/favicon.ico" /> <!-- Style --> - <link rel="stylesheet" type="text/css" href="[% start %][% version ('/cobrands/' _ c.cobrand.moniker _ '/gamma/style.css') %]" /> - <link rel="stylesheet" type="text/css" href="[% start %][% version ('/cobrands/' _ c.cobrand.moniker _ '/gamma/bootstrap-responsive.css') %]"> + <link rel="stylesheet" type="text/css" href="[% version ('/cobrands/' _ c.cobrand.moniker _ '/gamma/style.css') %]" /> + <link rel="stylesheet" type="text/css" href="[% version ('/cobrands/' _ c.cobrand.moniker _ '/gamma/bootstrap-responsive.css') %]"> <!-- Scripts --> - <script src="[% start %][% version ('/cobrands/' _ c.cobrand.moniker _ '/gamma/modernizr-2.6.2-respond-1.1.0.min.js') %]" type="text/javascript"></script> - <script src="[% start %][% version ('/cobrands/' _ c.cobrand.moniker _ '/gamma/jquery-1.9.0.min.js') %]" type="text/javascript"></script> - <script src="[% start %][% version ('/cobrands/' _ c.cobrand.moniker _ '/gamma/bootstrap.min.js') %]" type="text/javascript"></script> - <script src="[% start %][% version ('/cobrands/' _ c.cobrand.moniker _ '/gamma/main.js') %]" type="text/javascript"></script> + <script src="[% version ('/cobrands/' _ c.cobrand.moniker _ '/gamma/modernizr-2.6.2-respond-1.1.0.min.js') %]" type="text/javascript"></script> + <script src="[% version ('/cobrands/' _ c.cobrand.moniker _ '/gamma/jquery-1.9.0.min.js') %]" type="text/javascript"></script> + <script src="[% version ('/cobrands/' _ c.cobrand.moniker _ '/gamma/bootstrap.min.js') %]" type="text/javascript"></script> + <script src="[% version ('/cobrands/' _ c.cobrand.moniker _ '/gamma/main.js') %]" type="text/javascript"></script> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="(min-width:48em)"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="(min-width:48em)"> [% extra_css %] <!--[if (lt IE 9) & (!IEMobile)]> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> <![endif]--> - <script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script> + <script src="[% version('/js/modernizr.custom.js') %]" charset="utf-8"></script> [% INCLUDE 'common_header_tags.html' %] diff --git a/templates/web/zurich/header.html b/templates/web/zurich/header.html index a5efaabda..bf4d7e478 100644 --- a/templates/web/zurich/header.html +++ b/templates/web/zurich/header.html @@ -10,20 +10,18 @@ <meta name="HandHeldFriendly" content="true"> <meta name="mobileoptimized" content="0"> -[% SET start = c.config.ADMIN_BASE_URL IF admin %] - - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="screen and (min-width:48em)"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="screen and (min-width:48em)"> [% extra_css %] <!--[if (lt IE 9) & (!IEMobile)]> - <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> <![endif]--> <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/redmond/jquery-ui.css"> - <script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script> + <script src="[% version('/js/modernizr.custom.js') %]" charset="utf-8"></script> [% INCLUDE 'common_header_tags.html' %] - <script src="[% start %][% version('/cobrands/zurich/validation_rules.js') %]"></script> + <script src="[% version('/cobrands/zurich/validation_rules.js') %]"></script> [% extra_js %] <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js" charset="utf-8"></script> diff --git a/web/cobrands/fiksgatami/_colours.scss b/web/cobrands/fiksgatami/_colours.scss index 8899f4c97..8924e577a 100644 --- a/web/cobrands/fiksgatami/_colours.scss +++ b/web/cobrands/fiksgatami/_colours.scss @@ -1,4 +1,4 @@ -$image-sprite: '/cobrands/fiksgatami/sprite.png'; +$image-sprite: 'sprite.png'; /* COLOURS */ diff --git a/web/cobrands/fixamingata/_colours.scss b/web/cobrands/fixamingata/_colours.scss index 8ebd0712f..7be050a23 100644 --- a/web/cobrands/fixamingata/_colours.scss +++ b/web/cobrands/fixamingata/_colours.scss @@ -1,12 +1,13 @@ /* COLOURS */ +$image-sprite: 'images/sprite.png'; $menu-image: 'menu-black'; $primary: #00b1da; $primary_b: #0087a6; $primary_text: #222; -$base_bg: #eee url(/cobrands/fixamingata/images/tile.jpg) 0 0 repeat; +$base_bg: #eee url(images/tile.jpg) 0 0 repeat; $base_fg: $primary_text; $map_nav_bg: #eee; diff --git a/web/cobrands/fixamingata/base.scss b/web/cobrands/fixamingata/base.scss index 99d1e99db..af7a56cef 100644 --- a/web/cobrands/fixamingata/base.scss +++ b/web/cobrands/fixamingata/base.scss @@ -4,8 +4,6 @@ * layout for browsers that can't handle media queries. Baseline grid of 1.5em. */ -$image-sprite: '/cobrands/fixamingata/images/sprite.png'; - @import "../sass/h5bp"; @import "./_colours"; @import "../sass/mixins"; @@ -20,7 +18,7 @@ $image-sprite: '/cobrands/fixamingata/images/sprite.png'; width: 185px; margin-top: 8px; margin-left: 10px; - background: url('/cobrands/fixamingata/images/fms-logo.png') no-repeat; + background: url('images/fms-logo.png') no-repeat; } #report-cta { diff --git a/web/cobrands/fixamingata/layout.scss b/web/cobrands/fixamingata/layout.scss index db035e2c6..2d4ab90cf 100644 --- a/web/cobrands/fixamingata/layout.scss +++ b/web/cobrands/fixamingata/layout.scss @@ -1,5 +1,3 @@ -$image-sprite: '/cobrands/fixamingata/images/sprite.png'; - @font-face { font-family: 'MuseoSans'; src: url('../fixmystreet.com/fonts/MuseoSans_300-webfont.eot'); diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss index 3048ae300..52075889b 100644 --- a/web/cobrands/sass/_base.scss +++ b/web/cobrands/sass/_base.scss @@ -3,7 +3,7 @@ $body-font: MuseoSans, Helmet, Freesans, sans-serif !default; $meta-font: Helmet, Freesans, sans-serif !default; $heading-font: 'Museo300-display', MuseoSans, Helmet, Freesans, sans-serif !default; -$image-sprite: '/cobrands/fixmystreet/images/sprite.png' !default; +$image-sprite: '../fixmystreet/images/sprite.png' !default; $menu-image: 'menu-white' !default; $itemlist_item_background: #f6f6f6 !default; @@ -477,7 +477,7 @@ p.label-valid { #nav-link { width: 3em; height: 3em; // same height as #site-header - background: transparent url(/cobrands/fixmystreet/images/#{$menu-image}.png) center center no-repeat; + background: transparent url(../fixmystreet/images/#{$menu-image}.png) center center no-repeat; background-image: inline-image("../fixmystreet/images/#{$menu-image}.svg"), none; background-size: 22px 18px; display: block; diff --git a/web/cobrands/sass/_layout.scss b/web/cobrands/sass/_layout.scss index 51d32828f..3622ca0f0 100644 --- a/web/cobrands/sass/_layout.scss +++ b/web/cobrands/sass/_layout.scss @@ -1,6 +1,6 @@ @import "_mixins"; -$image-sprite: '/cobrands/fixmystreet/images/sprite.png' !default; +$image-sprite: '../fixmystreet/images/sprite.png' !default; $layout_front_stats_color: $primary !default; $mappage-header-height: 4em !default; @@ -672,7 +672,7 @@ body.authpage { } .iel8 #sub_map_links #map_links_toggle { height: 1.75em; - background: #000 url('/cobrands/fixmystreet/images/ie_sub_map_links_sprite.gif') center -143px no-repeat; + background: #000 url('../fixmystreet/images/ie_sub_map_links_sprite.gif') center -143px no-repeat; &.closed { background-position: center -183px; } @@ -802,7 +802,7 @@ body.authpage { } &#closed { padding-top:5em; - background-image:url(/cobrands/fixmystreet/images/sprite.png); + background-image:url($image-sprite); background-position:-318px -326px; background-repeat:no-repeat; &:before { |