aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--Vagrantfile2
-rwxr-xr-xbin/install_packages13
-rw-r--r--perllib/FixMyStreet/Map/MasterMap.pm3
-rwxr-xr-xscript/bootstrap10
-rw-r--r--t/map/mastermap.t2
-rw-r--r--templates/web/base/maps/openlayers.html3
-rw-r--r--templates/web/fixamingata/footer.html33
-rw-r--r--templates/web/fixamingata/footer_extra.html28
-rw-r--r--templates/web/fixamingata/front/footer-marketing.html27
-rw-r--r--templates/web/fixamingata/front/recent.html21
-rw-r--r--templates/web/fixamingata/front/tips.html6
-rw-r--r--templates/web/fixamingata/header_opengraph.html6
-rw-r--r--templates/web/fixamingata/open311/index.html143
-rw-r--r--web/cobrands/bexley/assets.js2
-rw-r--r--web/cobrands/fixamingata/videos/fixamingata.mp4bin5600425 -> 0 bytes
-rw-r--r--web/cobrands/fixamingata/videos/fixamingata.webmbin6580431 -> 0 bytes
-rw-r--r--web/cobrands/fixamingata/videos/poster.jpgbin218837 -> 0 bytes
-rw-r--r--web/cobrands/fixmystreet/map.js2
-rw-r--r--web/cobrands/isleofwight/assets.js7
-rw-r--r--web/cobrands/northamptonshire/assets.js5
-rw-r--r--web/cobrands/peterborough/assets.js7
-rw-r--r--web/js/map-mastermap.js3
23 files changed, 72 insertions, 252 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8d7a5714b..437f48656 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -84,6 +84,7 @@
- Add configuration for setting Content-Security-Policy header.
- Add banner on staging website/emails, and STAGING_FLAGS option to hide it.
- Do not hard code site name in database fixture.
+ - Ensure OS dependencies are kept updated in development environments.
- Open311 improvements:
- Support use of 'private' service definition <keywords> to mark
reports made in that category private. #2488
diff --git a/Vagrantfile b/Vagrantfile
index 6ac85c163..17eebe4b5 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -105,7 +105,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# When using the mySociety box, just mount the local perl modules and run `script/update`
# For any other box, just run the full setup process.
- if "#{baseBox}" == "mysociety/fixmystreet"
+ if "#{baseBox}" == "mysociety/fixmystreet" || "#{baseBox}" == "fms-local"
config.vm.provision "shell", run: "always", inline: $mount_modules
config.vm.provision "shell", run: "always", inline: $update
else
diff --git a/bin/install_packages b/bin/install_packages
new file mode 100755
index 000000000..7b4bfd8e1
--- /dev/null
+++ b/bin/install_packages
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -e
+
+cd "$(dirname "${BASH_SOURCE[0]}")/.."
+
+PACKAGE_FILE=conf/packages
+
+[ -n "$1" ] && PACKAGE_FILE="conf/packages.${1}"
+
+apt-get update
+
+grep -v ^# $PACKAGE_FILE | grep -v ^$ | xargs apt-get install -qq -y
+
diff --git a/perllib/FixMyStreet/Map/MasterMap.pm b/perllib/FixMyStreet/Map/MasterMap.pm
index a2e0acd54..d66234bbf 100644
--- a/perllib/FixMyStreet/Map/MasterMap.pm
+++ b/perllib/FixMyStreet/Map/MasterMap.pm
@@ -23,7 +23,8 @@ sub map_tiles {
my ( $self, %params ) = @_;
my ( $x, $y, $z ) = ( $params{x_tile}, $params{y_tile}, $params{zoom_act} );
if ($z >= 17) {
- my $base = "//%stilma.mysociety.org/mastermap/%d/%d/%d.png";
+ my $layer = FixMyStreet->config('STAGING_SITE') ? 'mastermap-staging' : 'mastermap';
+ my $base = "//%stilma.mysociety.org/$layer/%d/%d/%d.png";
return [
sprintf($base, 'a.', $z, $x-1, $y-1),
sprintf($base, 'b.', $z, $x, $y-1),
diff --git a/script/bootstrap b/script/bootstrap
index dfebd7449..5345b163e 100755
--- a/script/bootstrap
+++ b/script/bootstrap
@@ -4,4 +4,14 @@ set -e
cd "$(dirname "$0")/.."
git submodule --quiet update --init --recursive --rebase
+
+# Let's see if we can't work out where we might be running.
+if cut -d/ -f2 /proc/self/cgroup | sort -u | grep -q docker ; then
+ # Docker
+ sudo bin/install_packages docker
+else
+ # Fallback
+ sudo bin/install_packages generic
+fi
+
bin/install_perl_modules
diff --git a/t/map/mastermap.t b/t/map/mastermap.t
index 109142379..79522cdea 100644
--- a/t/map/mastermap.t
+++ b/t/map/mastermap.t
@@ -5,7 +5,7 @@ use FixMyStreet::Map::MasterMap;
subtest 'correct map tiles used' => sub {
my %test = (
16 => [ '-', 'oml' ],
- 20 => [ '.', 'mastermap' ]
+ 20 => [ '.', 'mastermap-staging' ]
);
foreach my $zoom (qw(16 20)) {
my $tiles = FixMyStreet::Map::MasterMap->map_tiles(x_tile => 123, y_tile => 456, zoom_act => $zoom);
diff --git a/templates/web/base/maps/openlayers.html b/templates/web/base/maps/openlayers.html
index 48a2f0890..f4c78767c 100644
--- a/templates/web/base/maps/openlayers.html
+++ b/templates/web/base/maps/openlayers.html
@@ -6,6 +6,9 @@
<input type="hidden" name="zoom" value="[% map.zoom %]">
<div id="js-map-data"
+[%- IF c.config.STAGING_SITE %]
+ data-staging=1
+[%- END %]
[%- UNLESS c.cobrand.call_hook('hide_areas_on_reports') %]
data-area="[% map.area.join(',') %]"
[%- END %]
diff --git a/templates/web/fixamingata/footer.html b/templates/web/fixamingata/footer.html
deleted file mode 100644
index ad4d6c4a6..000000000
--- a/templates/web/fixamingata/footer.html
+++ /dev/null
@@ -1,33 +0,0 @@
- [% IF pagefooter %]
- <footer role="contentinfo">
- [% INCLUDE 'front/footer-marketing.html' %]
- </footer>
- [% END %]
- </div><!-- .content role=main -->
- </div><!-- .container -->
- </div><!-- .table-cell -->
-
- <div class="nav-wrapper">
- <div class="container">
- <div id="main-nav" role="navigation">
- <ul class="nav-menu nav-menu--main">
- <li><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn"
- >[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/my' %]span[% ELSE %]a href="/my"[% END
- %]>[% c.user_exists ? loc("Your account") : loc("Sign in") %]</[% c.req.uri.path == '/my' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/reports' %]span[% ELSE %]a href="/reports"[% END
- %]>[% loc("All reports") %]</[% c.req.uri.path == '/reports' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/alert' %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END
- %]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]></li>[%
- %]<li><[% IF c.req.uri.path == '/faq' %]span[% ELSE %]a href="/faq"[% END
- %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li>
- </ul>
- </div>
- </div>
- </div>
- </div> <!-- .wrapper -->
-
- [% INCLUDE 'common_footer_tags.html' %]
-</body>
-
-</html>
diff --git a/templates/web/fixamingata/footer_extra.html b/templates/web/fixamingata/footer_extra.html
new file mode 100644
index 000000000..260b3af2f
--- /dev/null
+++ b/templates/web/fixamingata/footer_extra.html
@@ -0,0 +1,28 @@
+<footer class="fmg-footer">
+ <div class="container">
+ <div id="footer-mobileapps">
+ <!--
+ <h4></h4>
+ <p>
+ </p>
+ -->
+ </div>
+
+ <div id="footer-help">
+ <ul>
+ <li>
+ <h4>Sekretess och kakor</h4>
+ <p>Vill du veta mer om det juridiska? Läs vår information <a href="/privacy">om Dataskyddsförordning, sekretess och kakor</a>.</p>
+ </li>
+ <li>
+ <h4>Är du en utvecklare?</h4>
+ <p>[% loc('Would you like to contribute to FixMyStreet? Our code is open source and <a href="https://fixmystreet.org">available at fixmystreet.org</a>.') %]</p>
+ </li>
+ <li>
+ <h4>Är du anställd i en kommun?</h4>
+ <p>Vill du veta mer om FixaMinGata eller hur det kan fungera för er kommun? <a href="/about/council">Läs mer om FixaMinGata för kommuner</a>.</p>
+ </li>
+ </ul>
+ </div>
+ </div>
+</footer>
diff --git a/templates/web/fixamingata/front/footer-marketing.html b/templates/web/fixamingata/front/footer-marketing.html
index a597ae85a..f8c497a22 100644
--- a/templates/web/fixamingata/front/footer-marketing.html
+++ b/templates/web/fixamingata/front/footer-marketing.html
@@ -1,26 +1,3 @@
- <div class="tablewrapper bordered">
- <div id="footer-mobileapps">
- <!--
- <h4></h4>
- <p>
- </p>
- -->
- </div>
-
- <div id="footer-help">
- <ul>
- <li>
- <h4>Sekretess och kakor</h4>
- <p>Vill du veta mer om det juridiska? Läs vår information <a href="/privacy">om Dataskyddsförordning, sekretess och kakor</a>.</p>
- </li>
- <li>
- <h4>Är du en utvecklare?</h4>
- <p>[% loc('Would you like to contribute to FixMyStreet? Our code is open source and <a href="https://fixmystreet.org">available at fixmystreet.org</a>.') %]</p>
- </li>
- <li>
- <h4>Är du anställd i en kommun?</h4>
- <p>Vill du veta mer om FixaMinGata eller hur det kan fungera för er kommun? <a href="/kommun">Läs mer om FixaMinGata för kommuner</a>.</p>
- </li>
- </ul>
- </div>
+ <div class="tablewrapper bordered footer-marketing">
+ <div style="padding-bottom: 32px;"><a href="https://play.google.com/store/apps/details?id=se.sambruk.fixamingata"><img alt="FixaMinGata på Google Play" src="/cobrands/fixamingata/images/google_play_logo.png" style="height: 32px; width: 108px;"></a><a href="http://appstore.com/fixamingata"><img alt="FixaMinGata på App Store" src="/cobrands/fixamingata/images/itunes_store_logo.png" style="height: 32px; margin-left: 16px; width: 108px;"></a><a href="https://twitter.com/FixaMinGata"><img alt="FixaMinGata på Twitter" src="/cobrands/fixamingata/images/icon-twitter-black.png" style="height: 32px; margin-left: 16px; width: 32px;"></a><a href="https://www.facebook.com/FixaMinGata"><img alt="FixaMinGata på Facebook" src="/cobrands/fixamingata/images/icon-facebook-black.png" style="height: 32px; padding-left: 16px; width: 32px;"></a></div>
</div>
diff --git a/templates/web/fixamingata/front/recent.html b/templates/web/fixamingata/front/recent.html
deleted file mode 100644
index 4cff9eba9..000000000
--- a/templates/web/fixamingata/front/recent.html
+++ /dev/null
@@ -1,21 +0,0 @@
- [%
- recent_photos = c.cobrand.recent_photos('front', 5);
- %]
-
- <div id="front-recently">
- <div style="padding-bottom: 32px;"><a href="https://play.google.com/store/apps/details?id=se.sambruk.fixamingata"><img alt="FixaMinGata på Google Play" src="/cobrands/fixamingata/images/google_play_logo.png" style="height: 32px; width: 108px;"></a><a href="http://appstore.com/fixamingata"><img alt="FixaMinGata på App Store" src="/cobrands/fixamingata/images/itunes_store_logo.png" style="height: 32px; margin-left: 16px; width: 108px;"></a><a href="https://twitter.com/FixaMinGata"><img alt="FixaMinGata på Twitter" src="/cobrands/fixamingata/images/icon-twitter-black.png" style="height: 32px; margin-left: 16px; width: 32px;"></a><a href="https://www.facebook.com/FixaMinGata"><img alt="FixaMinGata på Facebook" src="/cobrands/fixamingata/images/icon-facebook-black.png" style="height: 32px; padding-left: 16px; width: 32px;"></a></div>
- [% IF recent_photos.size %]
- <h2>
- [% loc('Recently reported problems') %]
- </h2>
-
- <section class="full-width">
- <ul class="item-list item-list--reports">
- [% FOREACH problem IN recent_photos %]
- [% INCLUDE 'report/_item.html', no_fixed = 1 %]
- [% END %]
- </ul>
- </section>
-
- [% END %]
- </div>
diff --git a/templates/web/fixamingata/front/tips.html b/templates/web/fixamingata/front/tips.html
index 11a9abfc2..cfa2c36f7 100644
--- a/templates/web/fixamingata/front/tips.html
+++ b/templates/web/fixamingata/front/tips.html
@@ -1,8 +1,8 @@
<div style="padding-top: 20px;">
<h2>Så här enkelt används FixaMinGata</h2>
- <video controls poster="/cobrands/fixamingata/videos/poster.jpg" style="width: 100%;">
- <source src="/cobrands/fixamingata/videos/fixamingata.webm" type="video/webm">
- <source src="/cobrands/fixamingata/videos/fixamingata.mp4" type="video/mp4">
+ <video controls poster="/static/poster2019.png" style="width: 100%;">
+ <source src="/static/FMG2019.mp4" type="video/mp4">
+ <track label="Svenska" kind="subtitles" srclang="sv" src="/static/sv.vtt">
Din webbläsare kan tyvärr inte spela upp videoklippet.
</video>
</div>
diff --git a/templates/web/fixamingata/header_opengraph.html b/templates/web/fixamingata/header_opengraph.html
deleted file mode 100644
index 7d09d6009..000000000
--- a/templates/web/fixamingata/header_opengraph.html
+++ /dev/null
@@ -1,6 +0,0 @@
- <meta property="og:url" content="[% c.cobrand.base_url %][% c.req.uri.path %]">
- <meta property="og:title" content="[% title || site_name %]">
- <meta property="og:site_name" content="[% site_name %]">
- [% IF c.req.uri.path == '/' %]<meta property="og:description" content="Rapportera, visa, eller diskutera lokala problem.">[% END %]
- <meta property="og:type" content="website">
- [% INCLUDE 'header_opengraph_image.html' %]
diff --git a/templates/web/fixamingata/open311/index.html b/templates/web/fixamingata/open311/index.html
deleted file mode 100644
index 6e86a933b..000000000
--- a/templates/web/fixamingata/open311/index.html
+++ /dev/null
@@ -1,143 +0,0 @@
-[% INCLUDE 'header.html', title => 'Open311' %]
-
-<h1>[% loc('Open311 API for the mySociety FixMyStreet server') %]</h1>
-
-[% IF error %]
-<p>[% tprintf( loc('Note: <strong>%s</strong>'), error ) %]</p>
-[% END %]
-
-<p>[% loc('At the moment only searching for and looking at reports work.') %]</p>
-<p>[% loc('This API implementation is work in progress and not yet stabilized. It will change without warnings in the future.') %]</p>
-
-<ul>
-<li><a rel="nofollow" href="http://www.open311.org/">[% loc('Open311 initiative web page') %]</a></li>
-<li><a rel="nofollow" href="http://wiki.open311.org/GeoReport_v2">[% loc('Open311 specification') %]</a></li>
-</ul>
-
-<p>[% tprintf( loc('At most %d requests are returned in each query. The returned requests are ordered by requested_datetime, so to get all requests, do several searches with rolling start_date and end_date.'), c.config.OPEN311_LIMIT ) %]</p>
-
-<p>[% loc('The following Open311 v2 attributes are returned for each request: service_request_id, description, lat, long, media_url, status, requested_datetime, updated_datetime, service_code and service_name.') %]</p>
-
-<p>[% loc('In addition, the following attributes that are not part of the Open311 v2 specification are returned: agency_sent_datetime, title (also returned as part of description), interface_used, comment_count, requestor_name (only present if requestor allowed the name to be shown on this site).') %]</p>
-
-<p>[% loc('The Open311 v2 attribute agency_responsible is used to list the administrations that received the problem report, which is not quite the way the attribute is defined in the Open311 v2 specification.') %]</p>
-
-<p>[% tprintf( loc('With request searches, it is also possible to search for agency_responsible to limit the requests to those sent to a single administration. The search term is the administration ID provided by <a href="%s">MaPit</a>.'), c.config.MAPIT_URL ) %]</p>
-
-<p>[% loc('Examples:') %]</p>
-
-<ul>
-
-[% jurisdiction_id = 'fixamingata.se' %]
-[% examples = [
- {
- url = c.cobrand.base_url _ "/open311/v2/discovery.xml?jurisdiction_id=$jurisdiction_id",
- info = 'discovery-information',
- },
- {
- url = c.cobrand.base_url _ "/open311/v2/services.xml?jurisdiction_id=$jurisdiction_id",
- info = 'Lista alla feltyper, t ex Trasig lampa, hål i gatan osv',
- },
- {
- url = c.cobrand.base_url _ "/open311/v2/services.xml?jurisdiction_id=$jurisdiction_id&lat=59&long=18",
- info = 'Lista feltyper för WGS84 koordinater latityd 59 longityd 18',
- },
- {
- url = c.cobrand.base_url _ "/open311/v2/requests/1.xml?jurisdiction_id=$jurisdiction_id",
- info = 'Felrapport nummer 1',
- },
- {
- url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=open&agency_responsible=37&end_date=2013-04-10",
- info = 'Alla öppna felrapporter innan 2013-04-10 för Stockholm (kommun-id 37)',
- },
- {
- url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=open&agency_responsible=37|38",
- info = 'Alla öppna felrapporter för Stockholm (id 37) och Järfälla (id 38)',
- },
- {
- url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&service_code=Hål i gatan",
- info = "Alla felrapporter av typen 'Hål i gatan'",
- },
- {
- url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=closed",
- info = 'Alla stängda felrapporter',
- },
-] %]
-[% FOREACH examples %]
- <li><a href="[% url %]">[% info %]</a>
- <br>[% url | html %]</li>
-[% END %]
-
-</ul>
-
-<h2>Searching</h2>
-
-<p>The following search parameters can be used:</p>
-
-<dl>
-
-<dt>service_request_id</dt>
-<dd>Search for numeric ID of specific request.
- Using this is identical to asking for a individual request using
- the /requests/number.format URL.</dd>
-<dt>service_code</dt>
-<dd>Search for the given category / service type string.</dd>
-
-<dt>status</dt>
-<dd>Search for open or closed (fixed) requests.</dd>
-
-<dt>start_date<dt>
-<dd>Only return requests with requested_datetime set after or at the
- date and time specified. The format is YYYY-MM-DDTHH:MM:SS+TZ:TZ.</dd>
-
-<dt>end_date<dt>
-<dd>Only return requests with requested_datetime set before the date
- and time specified. Same format as start_date.</dd>
-
-<dt>agency_responsible</dt>
-<dd>ID of government body receiving the request. Several IDs can be
- specified with | as a separator.</dd>
-
-<dt>interface_used<dt>
-<dd>Name / identifier of interface used.</dd>
-
-<dt>has_photo<dt>
-<dd>Search for entries with or without photos. Use value 'true' to
-only get requests created with images, and 'false' to get those
-created without images.</dd>
-
-<dt>max_requests</dt>
-<dd>Max number of requests to return from the search. If it is larger
-than the site specific max_requests value specified in the discovery
-call, the value provided is ignored.</dd>
-
-<dl>
-
-<p>The search result might look like this:</p>
-
-<pre>[% "
- <requests>
- <request>
- <agency_responsible>
- <recipient>Stockholm</recipient>
- </agency_responsible>
- <agency_sent_datetime>2012-11-16T10:35:12,534712Z</agency_sent_datetime>
- <description>Test: Test</description>
- <detail>Test</detail>
- <interface_used>Web interface</interface_used>
- <lat>59.336044310435</lat>
- <long>18.05058735521</long>
- <requested_datetime>2012-11-16T10:31:30,702990Z</requested_datetime>
- <requestor_name>Jonas Öberg</requestor_name>
- <service_code>Trasig gatubelysning</service_code>
- <service_name>Trasig gatubelysning</service_name>
- <service_request_id>10</service_request_id>
- <status>open</status>
- <title>Test</title>
- <updated_datetime>2012-11-16T10:35:12,534712Z</updated_datetime>
- </request>
- </requests>
-" | html %]</pre>
-
-[% INCLUDE 'footer.html' %]
-
diff --git a/web/cobrands/bexley/assets.js b/web/cobrands/bexley/assets.js
index f81c7f62e..541d47ea4 100644
--- a/web/cobrands/bexley/assets.js
+++ b/web/cobrands/bexley/assets.js
@@ -91,7 +91,7 @@ fixmystreet.assets.add(road_defaults, {
fixmystreet.assets.add(defaults, {
http_options: {
- url: "https://tilma.staging.mysociety.org/mapserver/bexley",
+ url: "https://tilma.mysociety.org/mapserver/bexley",
params: {
TYPENAME: "Trees"
}
diff --git a/web/cobrands/fixamingata/videos/fixamingata.mp4 b/web/cobrands/fixamingata/videos/fixamingata.mp4
deleted file mode 100644
index 44e047033..000000000
--- a/web/cobrands/fixamingata/videos/fixamingata.mp4
+++ /dev/null
Binary files differ
diff --git a/web/cobrands/fixamingata/videos/fixamingata.webm b/web/cobrands/fixamingata/videos/fixamingata.webm
deleted file mode 100644
index 1f44c5c55..000000000
--- a/web/cobrands/fixamingata/videos/fixamingata.webm
+++ /dev/null
Binary files differ
diff --git a/web/cobrands/fixamingata/videos/poster.jpg b/web/cobrands/fixamingata/videos/poster.jpg
deleted file mode 100644
index a1f568d1e..000000000
--- a/web/cobrands/fixamingata/videos/poster.jpg
+++ /dev/null
Binary files differ
diff --git a/web/cobrands/fixmystreet/map.js b/web/cobrands/fixmystreet/map.js
index 048e180b6..b88dc5c36 100644
--- a/web/cobrands/fixmystreet/map.js
+++ b/web/cobrands/fixmystreet/map.js
@@ -3,7 +3,7 @@ var fixmystreet = fixmystreet || {};
(function(){
var map_data = document.getElementById('js-map-data'),
- map_keys = [ 'area', 'latitude', 'longitude', 'zoomToBounds', 'zoom', 'pin_prefix', 'pin_new_report_colour', 'numZoomLevels', 'zoomOffset', 'map_type', 'key', 'bodies' ],
+ map_keys = [ 'area', 'latitude', 'longitude', 'zoomToBounds', 'zoom', 'pin_prefix', 'pin_new_report_colour', 'numZoomLevels', 'zoomOffset', 'map_type', 'key', 'bodies', 'staging' ],
numeric = { zoom: 1, numZoomLevels: 1, zoomOffset: 1, id: 1 },
bool = { draggable: 1 },
pin_keys = [ 'lat', 'lon', 'colour', 'id', 'title', 'type', 'draggable' ];
diff --git a/web/cobrands/isleofwight/assets.js b/web/cobrands/isleofwight/assets.js
index e8d30e596..2710a9de7 100644
--- a/web/cobrands/isleofwight/assets.js
+++ b/web/cobrands/isleofwight/assets.js
@@ -4,14 +4,9 @@ if (!fixmystreet.maps) {
return;
}
-var is_live = false;
-if ( location.hostname === 'www.fixmystreet.com' || location.hostname === 'fms.islandroads.com' ) {
- is_live = true;
-}
-
var defaults = {
http_options: {
- url: is_live ? "https://tilma.mysociety.org/mapserver/iow": "https://staging.tilma.mysociety.org/mapserver/iow",
+ url: fixmystreet.staging ? "https://tilma.staging.mysociety.org/mapserver/iow": "https://tilma.mysociety.org/mapserver/iow",
params: {
SERVICE: "WFS",
VERSION: "1.1.0",
diff --git a/web/cobrands/northamptonshire/assets.js b/web/cobrands/northamptonshire/assets.js
index b6f8f07f3..2b6cdeb69 100644
--- a/web/cobrands/northamptonshire/assets.js
+++ b/web/cobrands/northamptonshire/assets.js
@@ -4,10 +4,7 @@ if (!fixmystreet.maps) {
return;
}
-var is_live = false;
-if ( location.hostname === 'www.fixmystreet.com' || location.hostname == 'fixmystreet.northamptonshire.gov.uk' ) {
- is_live = true;
-}
+var is_live = !fixmystreet.staging;
var layers = [
/*
diff --git a/web/cobrands/peterborough/assets.js b/web/cobrands/peterborough/assets.js
index 2fb9075c8..b3cac5f6c 100644
--- a/web/cobrands/peterborough/assets.js
+++ b/web/cobrands/peterborough/assets.js
@@ -4,9 +4,10 @@ if (!fixmystreet.maps) {
return;
}
+
var defaults = {
http_options: {
- url: "https://tilma.mysociety.org/mapserver/peterborough",
+ url: fixmystreet.staging ? "https://tilma.staging.mysociety.org/mapserver/peterborough" : "https://tilma.mysociety.org/mapserver/peterborough",
params: {
SERVICE: "WFS",
VERSION: "1.1.0",
@@ -58,9 +59,6 @@ var trees_defaults = $.extend(true, {}, defaults, {
asset_found: fixmystreet.message_controller.asset_found,
asset_not_found: fixmystreet.message_controller.asset_not_found
},
- http_options: {
- url: "https://tilma.mysociety.org/mapserver/peterborough"
- },
attributes: {
tree_code: 'TREE_CODE'
},
@@ -96,7 +94,6 @@ fixmystreet.assets.add(trees_defaults, {
// The new tree request category is disabled in the other tree point layer.
fixmystreet.assets.add(defaults, {
http_options: {
- url: "https://tilma.mysociety.org/mapserver/peterborough",
params: {
TYPENAME: "tree_points"
}
diff --git a/web/js/map-mastermap.js b/web/js/map-mastermap.js
index d12a79bd0..bb9adf532 100644
--- a/web/js/map-mastermap.js
+++ b/web/js/map-mastermap.js
@@ -13,7 +13,8 @@ OpenLayers.Layer.MasterMap = OpenLayers.Class(OpenLayers.Layer.BingUK, {
var urls = [];
var servers = [ '', 'a.', 'b.', 'c.' ];
- var base = "//{S}tilma.mysociety.org/mastermap/${z}/${x}/${y}.png";
+ var layer = fixmystreet.staging ? 'mastermap-staging' : 'mastermap';
+ var base = "//{S}tilma.mysociety.org/" + layer + "/${z}/${x}/${y}.png";
for (var i=0; i < servers.length; i++) {
urls.push( base.replace('{S}', servers[i]) );
}