aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/View/Web.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/View/Web.pm')
-rw-r--r--perllib/FixMyStreet/App/View/Web.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/View/Web.pm b/perllib/FixMyStreet/App/View/Web.pm
index 496463700..fe200a8fc 100644
--- a/perllib/FixMyStreet/App/View/Web.pm
+++ b/perllib/FixMyStreet/App/View/Web.pm
@@ -18,6 +18,7 @@ __PACKAGE__->config(
expose_methods => [
'tprintf', 'prettify_dt',
'version', 'decode',
+ 'prettify_state',
],
FILTERS => {
add_links => \&add_links,
@@ -167,5 +168,15 @@ sub decode {
return $text;
}
+sub prettify_state {
+ my ($self, $c, $text) = @_;
+ # New template to prevent interaction with current one
+ my $tt = FixMyStreet::Template->new({ INCLUDE_PATH => $self->{include_path} });
+ my $var;
+ $tt->process('report/state-list.html', { state => $text }, \$var);
+ $var =~ s/ - .*//;
+ return $var;
+}
+
1;