diff options
Diffstat (limited to 'perllib/FixMyStreet/DB/Result')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 11 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 13 |
2 files changed, 3 insertions, 21 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index 958194eb8..195fe4019 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -132,21 +132,12 @@ sub confirm { =head2 get_photo_params Returns a hashref of details of any attached photo for use in templates. -Hashref contains height, width and url keys. =cut sub get_photo_params { my $self = shift; - - return {} unless $self->photo; - - my $photo = {}; - ( $photo->{width}, $photo->{height} ) = - Image::Size::imgsize( \$self->photo ); - $photo->{url} = '/photo?c=' . $self->id; - - return $photo; + return FixMyStreet::App::get_photo_params($self, 'c'); } =head2 meta_problem_state diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 7ceabf1da..ce7488703 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -329,7 +329,7 @@ sub check_for_errors { || $self->name =~ m/\ba\s*n+on+((y|o)mo?u?s)?(ly)?\b/i ) { $errors{name} = _( -'Please enter your full name, councils need this information - if you do not wish your name to be shown on the site, untick the box' +'Please enter your full name, councils need this information – if you do not wish your name to be shown on the site, untick the box below' ); } @@ -400,21 +400,12 @@ sub url { =head2 get_photo_params Returns a hashref of details of any attached photo for use in templates. -Hashref contains height, width and url keys. =cut sub get_photo_params { my $self = shift; - - return {} unless $self->photo; - - my $photo = {}; - ( $photo->{width}, $photo->{height} ) = - Image::Size::imgsize( \$self->photo ); - $photo->{url} = '/photo?id=' . $self->id; - - return $photo; + return FixMyStreet::App::get_photo_params($self, 'id'); } =head2 is_open |