aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/App/Controller/Root.pm7
-rw-r--r--perllib/FixMyStreet/App/View/Web.pm3
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm5
-rw-r--r--perllib/FixMyStreet/Cobrand/FiksGataMi.pm4
-rw-r--r--perllib/FixMyStreet/Cobrand/FixMyStreet.pm4
-rw-r--r--perllib/FixMyStreet/Cobrand/FixaMinGata.pm4
6 files changed, 13 insertions, 14 deletions
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 {