aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/View/Web.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-09-02 15:43:26 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-09-02 15:59:14 +0100
commit810dc52bee762bb9211041b4cb9e70386c783068 (patch)
treec0a8b0d1955f9d7bcb2fc8e5137cedc1394fc10e /perllib/FixMyStreet/App/View/Web.pm
parent6b01e62f553afadc644bdda4c3f460757a20ffef (diff)
Versioning of CSS files, remove generated CSS files from repo.
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..2d0fb87d0 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', 'css',
],
FILTERS => {
escape_js => \&escape_js,
@@ -165,5 +165,15 @@ sub html_filter {
return $text;
}
+my %css_hash;
+sub css {
+ my ( $self, $c, $file ) = @_;
+ unless ($css_hash{$file}) {
+ my $path = FixMyStreet->path_to('web', $file);
+ $css_hash{$file} = ( stat( $path ) )[9];
+ }
+ return "$file?$css_hash{$file}";
+}
+
1;