diff options
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 20 | ||||
-rw-r--r-- | templates/web/base/report/_main.html | 3 | ||||
-rw-r--r-- | templates/web/base/report/_report_meta_info.html | 2 | ||||
-rw-r--r-- | templates/web/fixmystreet.com/report/_report_meta_info.html | 5 |
4 files changed, 28 insertions, 2 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; diff --git a/templates/web/base/report/_main.html b/templates/web/base/report/_main.html index 4821b3fa0..1eb6f809e 100644 --- a/templates/web/base/report/_main.html +++ b/templates/web/base/report/_main.html @@ -32,8 +32,7 @@ </label> </div> <p class="report_meta_info"> - [% problem.meta_line(c) | html %] - [%- IF !problem.used_map %]; <strong>([% loc('there is no pin shown as the user did not use the map') %])</strong>[% END %] + [% INCLUDE 'report/_report_meta_info.html' %] </p> [% INCLUDE 'report/_main_sent_info.html' %] diff --git a/templates/web/base/report/_report_meta_info.html b/templates/web/base/report/_report_meta_info.html new file mode 100644 index 000000000..da7339c81 --- /dev/null +++ b/templates/web/base/report/_report_meta_info.html @@ -0,0 +1,2 @@ +[% problem.meta_line(c) | html %] +[%- IF !problem.used_map %]; <strong>([% loc('there is no pin shown as the user did not use the map') %])</strong>[% END %] diff --git a/templates/web/fixmystreet.com/report/_report_meta_info.html b/templates/web/fixmystreet.com/report/_report_meta_info.html new file mode 100644 index 000000000..da0912a3f --- /dev/null +++ b/templates/web/fixmystreet.com/report/_report_meta_info.html @@ -0,0 +1,5 @@ +[% problem.meta_line(c) | html %] +[% IF c.cobrand.moniker != problem.get_cobrand_logged.moniker AND problem.get_cobrand_logged.is_council %] + using <a href="https://www.fixmystreet.com/about/council">FixMyStreet for Councils</a> +[% END %] +[%- IF !problem.used_map %]; <strong>([% loc('there is no pin shown as the user did not use the map') %])</strong>[% END %] |