aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App')
-rw-r--r--perllib/FixMyStreet/App/Controller/Root.pm7
-rw-r--r--perllib/FixMyStreet/App/View/Web.pm3
2 files changed, 9 insertions, 1 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 {