diff options
author | Struan Donald <struan@exo.org.uk> | 2011-09-08 10:05:06 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-09-08 10:05:06 +0100 |
commit | b1bd589b2fc8075cab39679d23db2b7d285f8345 (patch) | |
tree | 933ce962203f846d6d53b53851b36949f921a869 /perllib/FixMyStreet/App/View/Web.pm | |
parent | ba9172907f5e41840cf5324cc335277bbd031ed2 (diff) | |
parent | 3423cfe5e16e9130a25238cd76de76ec2bf07c67 (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into open311-consumer
Conflicts:
web/css/core.css
web/js/fixmystreet.js
Diffstat (limited to 'perllib/FixMyStreet/App/View/Web.pm')
-rw-r--r-- | perllib/FixMyStreet/App/View/Web.pm | 12 |
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; |