Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fewer photos on /alert for Bromley.

  • Loading branch information...
commit c84e7651e0c8a888495205ad1c19b7f3e89f95ea 1 parent bb5897c
@dracos dracos authored
View
3  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;
View
6 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;
View
1  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(@_);
}
View
2  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 );
}
View
2  templates/web/bromley/index.html
@@ -68,7 +68,7 @@ <h1 class="main mob-only">Reporting a problem in Bromley&rsquo;s streets or park
[%
- recent_photos = c.cobrand.recent_photos(5);
+ recent_photos = c.cobrand.recent_photos('front', 5);
%]
[% IF recent_photos.size %]
View
2  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();
%]
View
2  templates/web/fixmystreet/index.html
@@ -65,7 +65,7 @@
[%
- recent_photos = c.cobrand.recent_photos(5);
+ recent_photos = c.cobrand.recent_photos('front', 5);
%]
[% IF recent_photos.size %]
Please sign in to comment.
Something went wrong with that request. Please try again.