aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-09-19 11:37:39 +0100
committerMatthew Somerville <matthew@mysociety.org>2019-10-04 11:26:25 +0100
commitd19fef1920c64d1d2871d30dbc573fafa9e430e1 (patch)
treea3e9d45f16c5ddbfc1fe519057ec71dddf8d0171
parente4d3a706de4600df182d18917165abf83971800f (diff)
[Northants] Blue pins and no ID for body reports.
-rw-r--r--perllib/FixMyStreet/Cobrand/Northamptonshire.pm11
-rw-r--r--t/cobrand/northamptonshire.t19
-rw-r--r--templates/web/northamptonshire/report/_council_sent_info.html2
-rw-r--r--web/i/pin-blue-big.pngbin0 -> 10796 bytes
-rw-r--r--web/i/pin-blue-mini.pngbin0 -> 1731 bytes
-rw-r--r--web/i/pin-blue-small.pngbin0 -> 2844 bytes
-rw-r--r--web/i/pin-blue.pngbin0 -> 5755 bytes
7 files changed, 30 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Northamptonshire.pm b/perllib/FixMyStreet/Cobrand/Northamptonshire.pm
index abea3bfd5..4ae3b6409 100644
--- a/perllib/FixMyStreet/Cobrand/Northamptonshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Northamptonshire.pm
@@ -55,6 +55,17 @@ sub updates_disallowed {
return $self->next::method(@_);
}
+sub is_defect {
+ my ($self, $p) = @_;
+ return $p->user_id == $self->body_obj->comment_user_id;
+}
+
+sub pin_colour {
+ my ($self, $p, $context) = @_;
+ return 'blue' if $self->is_defect($p);
+ return $self->SUPER::pin_colour($p, $context);
+}
+
sub problems_on_map_restriction {
my ($self, $rs) = @_;
# Northamptonshire don't want to show district/borough reports
diff --git a/t/cobrand/northamptonshire.t b/t/cobrand/northamptonshire.t
index 78f5e83e1..70df10340 100644
--- a/t/cobrand/northamptonshire.t
+++ b/t/cobrand/northamptonshire.t
@@ -96,8 +96,9 @@ subtest 'check updates sent for non defects' => sub {
is $comment->send_fail_count, 1, "comment sending attempted";
};
+my $cobrand = FixMyStreet::Cobrand::Northamptonshire->new;
+
subtest 'check updates disallowed correctly' => sub {
- my $cobrand = FixMyStreet::Cobrand::Northamptonshire->new;
is $cobrand->updates_disallowed($report), 0;
$report->update({ state => 'closed' });
is $cobrand->updates_disallowed($report), 1;
@@ -105,4 +106,20 @@ subtest 'check updates disallowed correctly' => sub {
is $cobrand->updates_disallowed($report), 1;
};
+subtest 'check pin colour / reference shown' => sub {
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => 'northamptonshire',
+ #MAPIT_URL => 'http://mapit.uk/',
+ }, sub {
+ is $cobrand->pin_colour($report, 'around'), 'blue';
+ $mech->get_ok('/report/' . $report->id);
+ $mech->content_lacks('ref:&nbsp;' . $report->id);
+ $report->update({ user => $user });
+ is $cobrand->pin_colour($report, 'around'), 'yellow';
+ is $cobrand->pin_colour($report, 'my'), 'red';
+ $mech->get_ok('/report/' . $report->id);
+ $mech->content_contains('ref:&nbsp;' . $report->id);
+ };
+};
+
done_testing();
diff --git a/templates/web/northamptonshire/report/_council_sent_info.html b/templates/web/northamptonshire/report/_council_sent_info.html
index a82de72f7..6329c51ad 100644
--- a/templates/web/northamptonshire/report/_council_sent_info.html
+++ b/templates/web/northamptonshire/report/_council_sent_info.html
@@ -1,7 +1,7 @@
[% SET duration_clause = problem.duration_string(c) %]
[% IF duration_clause || problem.whensent %]
<p class="council_sent_info">
- [%- IF problem.whensent %]
+ [%- IF problem.whensent AND NOT c.cobrand.is_defect(problem) %]
[%- external_ref_clause = tprintf(loc('ref:&nbsp;%s'), problem.id) %]
[%- END -%]
[% duration_clause %]
diff --git a/web/i/pin-blue-big.png b/web/i/pin-blue-big.png
new file mode 100644
index 000000000..e82084082
--- /dev/null
+++ b/web/i/pin-blue-big.png
Binary files differ
diff --git a/web/i/pin-blue-mini.png b/web/i/pin-blue-mini.png
new file mode 100644
index 000000000..a8edbb631
--- /dev/null
+++ b/web/i/pin-blue-mini.png
Binary files differ
diff --git a/web/i/pin-blue-small.png b/web/i/pin-blue-small.png
new file mode 100644
index 000000000..699a8226c
--- /dev/null
+++ b/web/i/pin-blue-small.png
Binary files differ
diff --git a/web/i/pin-blue.png b/web/i/pin-blue.png
new file mode 100644
index 000000000..2eaf9e589
--- /dev/null
+++ b/web/i/pin-blue.png
Binary files differ