aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-04-24 17:52:40 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-04-24 17:52:40 +0100
commitc84e7651e0c8a888495205ad1c19b7f3e89f95ea (patch)
tree3d40914248b93868f2ca91d13e27e94ed1f97af8
parentbb5897ce61bf2c813e33b242594f14c73a65c2ed (diff)
Fewer photos on /alert for Bromley.
-rw-r--r--perllib/FixMyStreet/App/Controller/Alert.pm3
-rw-r--r--perllib/FixMyStreet/Cobrand/Bromley.pm6
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm1
-rw-r--r--perllib/FixMyStreet/Cobrand/UKCouncils.pm2
-rw-r--r--templates/web/bromley/index.html2
-rw-r--r--templates/web/default/index.html2
-rw-r--r--templates/web/fixmystreet/index.html2
7 files changed, 13 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Alert.pm b/perllib/FixMyStreet/App/Controller/Alert.pm
index 2698c6ac0..c127b7460 100644
--- a/perllib/FixMyStreet/App/Controller/Alert.pm
+++ b/perllib/FixMyStreet/App/Controller/Alert.pm
@@ -470,6 +470,7 @@ sub add_recent_photos : Private {
{
$c->stash->{photos} = $c->cobrand->recent_photos(
+ 'alert',
$num_photos,
$c->stash->{latitude},
$c->stash->{longitude},
@@ -477,7 +478,7 @@ sub add_recent_photos : Private {
);
}
else {
- $c->stash->{photos} = $c->cobrand->recent_photos($num_photos);
+ $c->stash->{photos} = $c->cobrand->recent_photos('alert', $num_photos);
}
return 1;
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm
index 90661c0c3..a9088f32a 100644
--- a/perllib/FixMyStreet/Cobrand/Bromley.pm
+++ b/perllib/FixMyStreet/Cobrand/Bromley.pm
@@ -31,6 +31,12 @@ sub example_places {
return ( 'BR1 3UH', 'Glebe Rd, Bromley' );
}
+sub recent_photos {
+ my ( $self, $area, $num, $lat, $lon, $dist ) = @_;
+ $num = 3 if $num > 3 && $area eq 'alert';
+ return $self->problems->recent_photos( $num, $lat, $lon, $dist );
+}
+
sub process_extras {
my $self = shift;
my $ctx = shift;
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index cee320cca..6a86db979 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -173,6 +173,7 @@ EASTING and NORTHING.
sub recent_photos {
my $self = shift;
+ my $area = shift;
return $self->problems->recent_photos(@_);
}
diff --git a/perllib/FixMyStreet/Cobrand/UKCouncils.pm b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
index 9014035b6..9b70727ca 100644
--- a/perllib/FixMyStreet/Cobrand/UKCouncils.pm
+++ b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
@@ -77,7 +77,7 @@ sub all_councils_report {
}
sub recent_photos {
- my ( $self, $num, $lat, $lon, $dist ) = @_;
+ my ( $self, $area, $num, $lat, $lon, $dist ) = @_;
$num = 2 if $num == 3;
return $self->problems->recent_photos( $num, $lat, $lon, $dist );
}
diff --git a/templates/web/bromley/index.html b/templates/web/bromley/index.html
index 370ab3f75..4b95230df 100644
--- a/templates/web/bromley/index.html
+++ b/templates/web/bromley/index.html
@@ -68,7 +68,7 @@ kinds of problems like missed bins use our
[%
- recent_photos = c.cobrand.recent_photos(5);
+ recent_photos = c.cobrand.recent_photos('front', 5);
%]
[% IF recent_photos.size %]
diff --git a/templates/web/default/index.html b/templates/web/default/index.html
index e5f98b0c5..4d178d192 100644
--- a/templates/web/default/index.html
+++ b/templates/web/default/index.html
@@ -51,7 +51,7 @@
</div>
[%
- recent_photos = c.cobrand.recent_photos(3);
+ recent_photos = c.cobrand.recent_photos('front', 3);
probs = c.cobrand.recent();
%]
diff --git a/templates/web/fixmystreet/index.html b/templates/web/fixmystreet/index.html
index 998a88469..42c60d051 100644
--- a/templates/web/fixmystreet/index.html
+++ b/templates/web/fixmystreet/index.html
@@ -65,7 +65,7 @@ Modernizr.load({
[%
- recent_photos = c.cobrand.recent_photos(5);
+ recent_photos = c.cobrand.recent_photos('front', 5);
%]
[% IF recent_photos.size %]