diff options
author | Dave Arter <davea@mysociety.org> | 2016-04-13 10:35:56 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2016-07-08 15:28:22 +0100 |
commit | d2ef2aaa0155809b31ea577c8c26afeff5bec98b (patch) | |
tree | 902aa2db854fbf77caa85761d5eb02b03f84771b /perllib/FixMyStreet | |
parent | d6c1252f1ac1d802a63d7b719d8b676e89b40a06 (diff) |
Display link to FMS for Councils on reports
When viewing on FMS.com a report made via a council cobrand, this
adds a link to the FMS for Councils page for more info.
This works by breaking out the report meta line ('Reported in the
Street lighting category by Joe Bloggs at 09:51, Tuesday 1 March 2016')
into its own template which can be overridden for the fixmystreet.com cobrand.
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index a2167032a..d6bcea55c 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -868,4 +868,24 @@ sub get_time_spent { return $admin_logs ? $admin_logs->get_column('sum_time_spent') : 0; } +=head2 get_cobrand_logged + +Get a cobrand object for the cobrand the problem was logged for. + +e.g. if a problem was logged at www.fixmystreet.com, this will be a +FixMyStreet::Cobrand::FixMyStreet object. + +=cut + +has get_cobrand_logged => ( + is => 'ro', + lazy => 1, + default => sub { + my $self = shift; + my $cobrand_class = FixMyStreet::Cobrand->get_class_for_moniker( $self->cobrand ); + return $cobrand_class->new; + }, +); + + 1; |