diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Open311.pm | 2 | ||||
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Rss.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 5 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 6 | ||||
-rw-r--r-- | templates/web/default/report/photo.html | 2 | ||||
-rw-r--r-- | templates/web/fixmystreet/report/photo-js.html | 2 | ||||
-rw-r--r-- | templates/web/zurich/report/_item.html | 2 | ||||
-rw-r--r-- | templates/web/zurich/report/_main.html | 2 |
8 files changed, 16 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Open311.pm b/perllib/FixMyStreet/App/Controller/Open311.pm index a4e72e9bd..b336a44f0 100644 --- a/perllib/FixMyStreet/App/Controller/Open311.pm +++ b/perllib/FixMyStreet/App/Controller/Open311.pm @@ -272,7 +272,7 @@ sub output_requests : Private { $request->{'comment_count'} = [ $updates ]; } - my $display_photos = $c->cobrand->allow_photo_display; + my $display_photos = $c->cobrand->allow_photo_display($problem); if ($display_photos && $problem->photo) { my $url = $c->cobrand->base_url(); my $imgurl = $url . "/photo/$id.full.jpeg"; diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm index 90ab7ad41..ed47f6f87 100755 --- a/perllib/FixMyStreet/App/Controller/Rss.pm +++ b/perllib/FixMyStreet/App/Controller/Rss.pm @@ -280,7 +280,7 @@ sub add_row : Private { $item{pubDate} = $pubDate if $pubDate; $item{category} = $row->{category} if $row->{category}; - if ($c->cobrand->allow_photo_display && $row->{photo}) { + if ($c->cobrand->allow_photo_display($row) && $row->{photo}) { my $key = $alert_type->item_table eq 'comment' ? 'c/' : ''; $item{description} .= ent("\n<br><img src=\"". $base_url . "/photo/$key$row->{id}.jpeg\">"); } diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 96b3625a8..978968ba6 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -364,7 +364,10 @@ Return a boolean indicating whether the cobrand allows photo display =cut -sub allow_photo_display { return 1; } +sub allow_photo_display { + my ( $self, $r ) = @_; + return 1; +} =head2 allow_update_reporting diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 9c725e7aa..7f7125b29 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -103,6 +103,12 @@ sub updates_as_hashref { return $hashref; } +sub allow_photo_display { + my ( $self, $r ) = @_; + my $extra = ref($r) eq 'HASH' ? $r->{extra} : $r->extra; + return $extra->{publish_photo}; +} + sub show_unconfirmed_reports { 1; } diff --git a/templates/web/default/report/photo.html b/templates/web/default/report/photo.html index 02ab9228b..c463c34c4 100644 --- a/templates/web/default/report/photo.html +++ b/templates/web/default/report/photo.html @@ -1,4 +1,4 @@ -[% IF c.cobrand.allow_photo_display && object.photo %] +[% IF c.cobrand.allow_photo_display(object) && object.photo %] [% photo = object.get_photo_params %] <div class="update-img"> [% IF photo.url_full %]<a href="[% photo.url_full %]" rel="fancy">[% END diff --git a/templates/web/fixmystreet/report/photo-js.html b/templates/web/fixmystreet/report/photo-js.html index df0e2f92d..9075ce005 100644 --- a/templates/web/fixmystreet/report/photo-js.html +++ b/templates/web/fixmystreet/report/photo-js.html @@ -1,4 +1,4 @@ -[% IF c.cobrand.allow_photo_display %] +[% IF c.cobrand.allow_photo_display(problem) %] [% extra_css = BLOCK %] <link rel="stylesheet" href="[% version('/js/fancybox/jquery.fancybox-1.3.4.css') %]"> [% END %] diff --git a/templates/web/zurich/report/_item.html b/templates/web/zurich/report/_item.html index 7adb7cdd4..22b39a2c8 100644 --- a/templates/web/zurich/report/_item.html +++ b/templates/web/zurich/report/_item.html @@ -1,6 +1,6 @@ <li> <a class="text" href="[% c.uri_for('/report', problem.id ) %]"> - [% IF problem.state != 'unconfirmed' AND problem.photo AND problem.extra.publish_photo; + [% IF problem.state != 'unconfirmed' AND problem.photo AND c.cobrand.allow_photo_display(problem); photo = problem.get_photo_params %] <img class="img" height="60" width="90" src="[% photo.url_fp %]" alt=""> diff --git a/templates/web/zurich/report/_main.html b/templates/web/zurich/report/_main.html index c5fbabf1c..d80eeb9a4 100644 --- a/templates/web/zurich/report/_main.html +++ b/templates/web/zurich/report/_main.html @@ -6,7 +6,7 @@ </p> [% IF problem.state != 'unconfirmed' %] - [% IF problem.extra.publish_photo %] + [% IF c.cobrand.allow_photo_display(problem) %] [% INCLUDE 'report/photo.html' object=problem %] [% END %] [% add_links( problem.detail ) | html_para %] |