aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/View/Web.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-09-05 16:59:05 +0100
committerStruan Donald <struan@exo.org.uk>2011-09-05 16:59:05 +0100
commiteb823376088f47abf23050a0193225a45b51d6d3 (patch)
treea6eb5fc8cf694a7dd70d7d1a957d65ec09a6c60a /perllib/FixMyStreet/App/View/Web.pm
parentbc39723b98a0bb07cc8d57e99489e3a014d857ef (diff)
parent7fc1083eb431312a59758c473e8ff52ceb8585ef (diff)
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into js-validation
Conflicts: templates/web/default/common_header_tags.html
Diffstat (limited to 'perllib/FixMyStreet/App/View/Web.pm')
-rw-r--r--perllib/FixMyStreet/App/View/Web.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/View/Web.pm b/perllib/FixMyStreet/App/View/Web.pm
index 5579d0d53..43d46ae25 100644
--- a/perllib/FixMyStreet/App/View/Web.pm
+++ b/perllib/FixMyStreet/App/View/Web.pm
@@ -19,7 +19,7 @@ __PACKAGE__->config(
render_die => 1,
expose_methods => [
'loc', 'nget', 'tprintf', 'display_crosssell_advert', 'prettify_epoch',
- 'add_links',
+ 'add_links', 'version',
],
FILTERS => {
escape_js => \&escape_js,
@@ -165,5 +165,15 @@ sub html_filter {
return $text;
}
+my %version_hash;
+sub version {
+ my ( $self, $c, $file ) = @_;
+ unless ($version_hash{$file}) {
+ my $path = FixMyStreet->path_to('web', $file);
+ $version_hash{$file} = ( stat( $path ) )[9];
+ }
+ return "$file?$version_hash{$file}";
+}
+
1;