aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-05-26 19:57:20 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-05-26 19:57:20 +0100
commit2255555673e31b28b239fb7d83aca2b44f46c885 (patch)
tree6c2c061913f40f114b64488bbacb21d9440312d6
parentefc53f171be30edc9995762cad949eda01294e96 (diff)
Photo URL fix, and pass through photo ID for updates as it does for problems/questionnaires.
-rw-r--r--perllib/FixMyStreet/DB/Result/Comment.pm2
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm2
-rw-r--r--templates/web/default/report/display.html4
3 files changed, 6 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm
index 4c70dd902..f51c939ff 100644
--- a/perllib/FixMyStreet/DB/Result/Comment.pm
+++ b/perllib/FixMyStreet/DB/Result/Comment.pm
@@ -134,7 +134,7 @@ sub get_photo_params {
my $photo = {};
( $photo->{width}, $photo->{height} ) =
Image::Size::imgsize( \$self->photo );
- $photo->{url} = '/photo/?c=' . $self->id;
+ $photo->{url} = '/photo?c=' . $self->id;
return $photo;
}
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index c1ecd6576..2836f6c92 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -246,7 +246,7 @@ sub get_photo_params {
my $photo = {};
( $photo->{width}, $photo->{height} ) =
Image::Size::imgsize( \$self->photo );
- $photo->{url} = '/photo/?id=' . $self->id;
+ $photo->{url} = '/photo?id=' . $self->id;
return $photo;
}
diff --git a/templates/web/default/report/display.html b/templates/web/default/report/display.html
index 959f76d2b..2225934a5 100644
--- a/templates/web/default/report/display.html
+++ b/templates/web/default/report/display.html
@@ -118,6 +118,10 @@
<div class='form-error'>[% photo_error %]</div>
[% END %]
<div id="fileupload_normalUI">
+ [% IF upload_fileid %]
+ <p>[% loc('You have already attached a photo to this report, attaching another one will replace it.') %]</p>
+ <input type="hidden" name="upload_fileid" value="[% upload_fileid %]">
+ [% END %]
<label for="form_photo">[% loc('Photo:') %]</label>
<input type="file" name="photo" id="form_photo">
</div>