aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2013-01-24 14:57:45 +0000
committerMatthew Somerville <matthew@mysociety.org>2013-01-24 14:57:45 +0000
commite3e507fc06281bf8d23a112412da7e9a85e8553c (patch)
tree99d85e513bc746899aaf04753141b38b23a017f4
parent2562f16ffebb6e1b3e93396fe495eb9722403ccf (diff)
Make sure title not shown on pins on unconfirmed Zurich reports.
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm2
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm6
-rw-r--r--perllib/FixMyStreet/Map.pm2
3 files changed, 8 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index 8f651fae2..9a754f063 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -192,7 +192,7 @@ sub display_location : Private {
longitude => $p->longitude,
colour => $colour,
id => $p->id,
- title => $p->title,
+ title => $p->title_safe,
}
} @$on_map_all, @$around_map;
}
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index c7fb37a84..38326bfc7 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -312,6 +312,12 @@ around service => sub {
return $s;
};
+sub title_safe {
+ my $self = shift;
+ return _('Awaiting moderation') if $self->cobrand eq 'zurich' && $self->state eq 'unconfirmed';
+ return $self->title;
+}
+
=head2 check_for_errors
$error_hashref = $problem->check_for_errors();
diff --git a/perllib/FixMyStreet/Map.pm b/perllib/FixMyStreet/Map.pm
index a1876e150..f2dd0da6d 100644
--- a/perllib/FixMyStreet/Map.pm
+++ b/perllib/FixMyStreet/Map.pm
@@ -129,7 +129,7 @@ sub map_pins {
my $colour = $c->cobrand->pin_colour( $p, 'around' );
[ $p->latitude, $p->longitude,
$colour,
- $p->id, $p->title
+ $p->id, $p->title_safe
]
} @$around_map, @$nearby;