aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2013-02-21 12:31:17 +0000
committerMatthew Somerville <matthew@mysociety.org>2013-02-21 12:31:17 +0000
commite2bf144a6aaa19779fc55a04081a3c269b9d0f81 (patch)
tree00318d801d35948938743608252fccd2d1b4e585 /perllib/FixMyStreet/App.pm
parenteb0c0d42f3596c5dc21e9bcdcc02a4008a541c34 (diff)
parentf8a8948ddb790e7e7593d538c55a3a278fbf3973 (diff)
Merge remote branch 'origin/zurich'
(locale ignored, will rerun .po extraction after to get all changes.) Conflicts: locale/FixMyStreet.po locale/cy_GB.UTF-8/LC_MESSAGES/EmptyHomes.po locale/de_CH.UTF-8/LC_MESSAGES/FixMyStreet.po locale/nb_NO.UTF-8/LC_MESSAGES/FixMyStreet.po locale/nn_NO.UTF-8/LC_MESSAGES/FixMyStreet.po templates/web/fixmystreet/report/banner.html templates/web/zurich/faq/faq-de-ch.html
Diffstat (limited to 'perllib/FixMyStreet/App.pm')
-rw-r--r--perllib/FixMyStreet/App.pm22
1 files changed, 17 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index b76f4d3ba..4469ad1c9 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -315,6 +315,7 @@ sub send_email {
{
_template_ => $email->body, # will get line wrapped
_parameters_ => {},
+ _line_indent => $c->cobrand->email_indent,
$email->header_pairs
}
) };
@@ -443,18 +444,29 @@ Hashref contains height, width and url keys.
sub get_photo_params {
my ($self, $key) = @_;
- $key = ($key eq 'id') ? '' : "/$key";
return {} unless $self->photo;
+ $key = ($key eq 'id') ? '' : "/$key";
+
+ my $pre = "/photo$key/" . $self->id;
+ my $post = '.jpeg';
my $photo = {};
+
if (length($self->photo) == 40) {
- $photo->{url_full} = '/photo' . $key . '/' . $self->id . '.full.jpeg';
+ $post .= '?' . $self->photo;
+ $photo->{url_full} = "$pre.full$post";
+ # XXX Can't use size here because {url} (currently 250px height) may be
+ # being used, but at this point it doesn't yet exist to find the width
+ # $str = FixMyStreet->config('UPLOAD_DIR') . $self->photo . '.jpeg';
} else {
- ( $photo->{width}, $photo->{height} ) =
- Image::Size::imgsize( \$self->photo );
+ my $str = \$self->photo;
+ ( $photo->{width}, $photo->{height} ) = Image::Size::imgsize( $str );
}
- $photo->{url} = '/photo' . $key . '/' . $self->id . '.jpeg';
+
+ $photo->{url} = "$pre$post";
+ $photo->{url_tn} = "$pre.tn$post";
+ $photo->{url_fp} = "$pre.fp$post";
return $photo;
}