Skip to content

Commit

Permalink
fixup! [WW][Bulky][Sutton] Bulky update images available logged out
Browse files Browse the repository at this point in the history
  • Loading branch information
MorayMySoc committed Sep 27, 2024
1 parent 96fa4f0 commit b209829
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion t/app/controller/report_inspect.t
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ FixMyStreet::override_config {
my $comment = $report->comments->order_by('-id')->first;
is $comment->photo, '74e3362283b6ef0c48686fb0e161da4043bbcc97.jpeg', 'photo added to comment';
$mech->get_ok("/report/$report_id");
$mech->content_contains("/photo/temp.74e3362283b6ef0c48686fb0e161da4043bbcc97.jpeg");
$mech->content_contains("/photo/c/" . $comment->id . ".0.jpeg");
};

};
Expand Down
4 changes: 3 additions & 1 deletion t/app/controller/report_updates.t
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,9 @@ for my $test (

my $update = $report->comments->first;
ok $update, 'found update';
$mech->content_contains('Photo of this report" src="/photo/temp') if $test->{fields}->{photo1};

$mech->content_contains("/photo/c/" . $update->id . ".0.jpeg") if $test->{fields}->{photo1};

if ( !defined( $test->{endstate_banner} ) ) {
is $mech->extract_problem_banner->{text}, undef, 'endstate banner';
} else {
Expand Down
5 changes: 3 additions & 2 deletions t/cobrand/zurich.t
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,9 @@ subtest 'Photo publishing' => sub {
$mech->content_contains('photo/' . $report->id . '.1.fp.jpeg');
$mech->content_lacks('photo/' . $report->id . '.2.fp.jpeg');
$mech->get_ok( '/report/' . $report->id );
my @photo_links = $mech->content =~ m#(Photo of this report" src="/photo/.*?")#g;
is @photo_links == 1, 1, "Only one photo shown";
$mech->content_lacks('photo/' . $report->id . '.0.jpeg');
$mech->content_contains('photo/' . $report->id . '.1.jpeg');
$mech->content_lacks('photo/' . $report->id . '.2.jpeg');

# Internal notes
$mech->get_ok( '/admin/report_edit/' . $report->id );
Expand Down
5 changes: 5 additions & 0 deletions templates/web/base/report/photo.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
[% FOR photo IN object.photos %]
[% IF c.cobrand.allow_photo_display(object, photo.idx) %]
<div class="update-img">
[% IF alert_to_reporter %]
<a href="[% photo.url_temp_full %]" rel="fancy">
<img alt="Photo of this report" src="[% photo.url_temp %]">
[% ELSE %]
<a href="[% photo.url_full%]" rel="fancy">
<img alt="Photo of this report" src="[% photo.url %]">
[% END %]
<span>zoom</span></a>
[% IF can_moderate %]
<p class="moderate-edit">
Expand Down

0 comments on commit b209829

Please sign in to comment.