diff options
author | Matthew Somerville <matthew@mysociety.org> | 2016-01-12 16:37:45 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2016-01-12 17:31:54 +0000 |
commit | b8685054be0e16bc836dc568c0687a6f86400f38 (patch) | |
tree | 2cf64446203b4c9e8985a982e50d9c4f6b271df1 /templates | |
parent | df98fe4dfff0a707c9800050f658100c57783654 (diff) |
Add ability to have multiple update photos.
Also adds admin ability to rotate update photos.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/web/base/admin/update_edit.html | 23 | ||||
-rw-r--r-- | templates/web/base/questionnaire/index.html | 28 | ||||
-rw-r--r-- | templates/web/base/report/update-form.html | 39 | ||||
-rw-r--r-- | templates/web/bromley/report/display.html | 39 | ||||
-rw-r--r-- | templates/web/eastsussex/report/update-form.html | 39 |
5 files changed, 111 insertions, 57 deletions
diff --git a/templates/web/base/admin/update_edit.html b/templates/web/base/admin/update_edit.html index 54e6d52d2..a956bb2cb 100644 --- a/templates/web/base/admin/update_edit.html +++ b/templates/web/base/admin/update_edit.html @@ -51,11 +51,26 @@ <li>[% loc('Created:') %] [% PROCESS format_time time=update.created %]</li> [% IF update.photo %] -[% photo = update.photos.first %] -<li><img alt="Photo of this update" src="[% c.cobrand.base_url %][% photo.url_temp %]"> -<input type="checkbox" id="remove_photo" name="remove_photo" value="1"> -<label for="remove_photo" class="inline">[% loc("Remove photo (can't be undone!)") %]</label></li> +<li> +<ul> + [% FOR photo IN update.photos %] + <li> + <div class="update-img"> + <a href="[% c.cobrand.base_url %][% photo.url_temp_full %]" rel="fancy"> + <img alt="Photo of this update" src="[% c.cobrand.base_url %][% photo.url_temp %]"> + <span>zoom</span> + </a> + </div> + <input type="submit" name="rotate_photo_[% loop.index %]" value="[% loc('Rotate Left') %]"> + <input type="submit" name="rotate_photo_[% loop.index %]" value="[% loc('Rotate Right') %]"> + <input type="checkbox" id="remove_photo_[% loop.index %]" name="remove_photo_[% loop.index %]" value="1"> + <label class="inline" for="remove_photo_[% loop.index %]">[% loc("Remove photo (can't be undone!)") %]</label></li> + </li> + [% END %] +</ul> +</li> [% END %] + </ul> <input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></form> diff --git a/templates/web/base/questionnaire/index.html b/templates/web/base/questionnaire/index.html index ab3bde9ad..82f0534f4 100644 --- a/templates/web/base/questionnaire/index.html +++ b/templates/web/base/questionnaire/index.html @@ -71,15 +71,27 @@ <p><textarea name="update" rows="7" cols="30" placeholder="[% loc('What was your experience of getting the problem fixed?') %]">[% update | html %]</textarea></p> [% IF c.cobrand.allow_photo_upload %] -<p id="fileupload_normalUI"> - [% IF upload_fileid %] - <img align="right" src="/photo/[% upload_fileid %].temp.jpeg" alt=""> - <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 %]"> + <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> + <label for="form_photo">[% loc('Photo') %]</label> + + [% IF field_errors.photo %] + <p class='form-error'>[% field_errors.photo %]</p> + [% END %] + + <div id="form_photos"> + [% IF upload_fileid %] + <script> + fixmystreet.uploaded_files = "[% upload_fileid %]".split(','); + </script> + <p>[% loc('You have already attached photos to this update. Note that you can attach a maximum of 3 to this update (if you try to upload more, the oldest will be removed).') %]</p> + [% FOREACH id IN upload_fileid.split(',') %] + <img align="right" src="/photo/[% id %].temp.jpeg" alt=""> + [% END %] [% END %] - <label for="form_photo">[% loc('Photo:') %]</label> - <input type="file" name="photo" id="form_photo"> -</p> + <input type="file" name="photo1" id="form_photo"> + <input type="file" name="photo2" id="form_photo2"> + <input type="file" name="photo3" id="form_photo3"> + </div> [% END %] [% IF c.cobrand.moniker != 'emptyhomes' %] diff --git a/templates/web/base/report/update-form.html b/templates/web/base/report/update-form.html index be93ca82e..8c812cd08 100644 --- a/templates/web/base/report/update-form.html +++ b/templates/web/base/report/update-form.html @@ -16,6 +16,30 @@ <input type="hidden" name="submit_update" value="1"> <input type="hidden" name="id" value="[% problem.id | html %]"> + [% IF c.cobrand.allow_photo_upload %] + <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> + <label for="form_photo">[% loc('Photo') %]</label> + + [% IF field_errors.photo %] + <p class='form-error'>[% field_errors.photo %]</p> + [% END %] + + <div id="form_photos"> + [% IF upload_fileid %] + <script> + fixmystreet.uploaded_files = "[% upload_fileid %]".split(','); + </script> + <p>[% loc('You have already attached photos to this update. Note that you can attach a maximum of 3 to this update (if you try to upload more, the oldest will be removed).') %]</p> + [% FOREACH id IN upload_fileid.split(',') %] + <img align="right" src="/photo/[% id %].temp.jpeg" alt=""> + [% END %] + [% END %] + <input type="file" name="photo1" id="form_photo"> + <input type="file" name="photo2" id="form_photo2"> + <input type="file" name="photo3" id="form_photo3"> + </div> + [% END %] + <label for="form_update">[% loc( 'Update' ) %]</label> [% IF field_errors.update %] <div class='form-error'>[% field_errors.update %]</div> @@ -49,21 +73,6 @@ [% END %] [% END %] - [% IF c.cobrand.allow_photo_upload %] - <div id="fileupload_normalUI"> - [% IF upload_fileid %] - <img align="right" src="/photo/[% upload_fileid %].temp.jpeg" alt=""> - <p>[% loc('You have already attached a photo to this update, attaching another one will replace it.') %]</p> - <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> - [% END %] - <label for="form_photo">[% loc('Photo') %]</label> - [% IF field_errors.photo %] - <p class='form-error'>[% field_errors.photo %]</p> - [% END %] - <input type="file" name="photo" id="form_photo"> - </div> - [% END %] - [% IF c.user_exists %] [% INCLUDE name %] diff --git a/templates/web/bromley/report/display.html b/templates/web/bromley/report/display.html index 75b7700a5..c9b0e9847 100644 --- a/templates/web/bromley/report/display.html +++ b/templates/web/bromley/report/display.html @@ -60,6 +60,30 @@ <input type="hidden" name="submit_update" value="1"> <input type="hidden" name="id" value="[% problem.id | html %]"> + [% IF c.cobrand.allow_photo_upload %] + <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> + <label for="form_photo">[% loc('Photo') %]</label> + + [% IF field_errors.photo %] + <p class='form-error'>[% field_errors.photo %]</p> + [% END %] + + <div id="form_photos"> + [% IF upload_fileid %] + <script> + fixmystreet.uploaded_files = "[% upload_fileid %]".split(','); + </script> + <p>[% loc('You have already attached photos to this update. Note that you can attach a maximum of 3 to this update (if you try to upload more, the oldest will be removed).') %]</p> + [% FOREACH id IN upload_fileid.split(',') %] + <img align="right" src="/photo/[% id %].temp.jpeg" alt=""> + [% END %] + [% END %] + <input type="file" name="photo1" id="form_photo"> + <input type="file" name="photo2" id="form_photo2"> + <input type="file" name="photo3" id="form_photo3"> + </div> + [% END %] + <label for="form_update">[% loc( 'Update' ) %]</label> [% IF field_errors.update %] <div class='form-error'>[% field_errors.update %]</div> @@ -98,21 +122,6 @@ [% END %] [% END %] - [% IF c.cobrand.allow_photo_upload %] - <div id="fileupload_normalUI"> - [% IF upload_fileid %] - <img align="right" src="/photo/[% upload_fileid %].temp.jpeg" alt=""> - <p>[% loc('You have already attached a photo to this update, attaching another one will replace it.') %]</p> - <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> - [% END %] - <label for="form_photo">[% loc('Photo') %]</label> - [% IF field_errors.photo %] - <p class='form-error'>[% field_errors.photo %]</p> - [% END %] - <input type="file" name="photo" id="form_photo"> - </div> - [% END %] - [% IF c.user_exists %] [% INCLUDE name %] diff --git a/templates/web/eastsussex/report/update-form.html b/templates/web/eastsussex/report/update-form.html index af966f417..55d79a930 100644 --- a/templates/web/eastsussex/report/update-form.html +++ b/templates/web/eastsussex/report/update-form.html @@ -60,6 +60,30 @@ <input type="hidden" name="submit_update" value="1"> <input type="hidden" name="id" value="[% problem.id | html %]"> + [% IF c.cobrand.allow_photo_upload %] + <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> + <label for="form_photo">[% loc('Photo') %]</label> + + [% IF field_errors.photo %] + <p class='form-error'>[% field_errors.photo %]</p> + [% END %] + + <div id="form_photos"> + [% IF upload_fileid %] + <script> + fixmystreet.uploaded_files = "[% upload_fileid %]".split(','); + </script> + <p>[% loc('You have already attached photos to this update. Note that you can attach a maximum of 3 to this update (if you try to upload more, the oldest will be removed).') %]</p> + [% FOREACH id IN upload_fileid.split(',') %] + <img align="right" src="/photo/[% id %].temp.jpeg" alt=""> + [% END %] + [% END %] + <input type="file" name="photo1" id="form_photo"> + <input type="file" name="photo2" id="form_photo2"> + <input type="file" name="photo3" id="form_photo3"> + </div> + [% END %] + <label for="form_update">[% loc( 'Update:' ) %] <span class="label-warning public-warning"> [% loc('public') %] @@ -97,21 +121,6 @@ [% END %] [% END %] - [% IF c.cobrand.allow_photo_upload %] - <div id="fileupload_normalUI"> - [% IF upload_fileid %] - <img align="right" src="/photo/[% upload_fileid %].temp.jpeg" alt=""> - <p>[% loc('You have already attached a photo to this update, attaching another one will replace it.') %]</p> - <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> - [% END %] - <label for="form_photo">[% loc('Photo') %]</label> - [% IF field_errors.photo %] - <p class='form-error'>[% field_errors.photo %]</p> - [% END %] - <input type="file" name="photo" id="form_photo"> - </div> - [% END %] - [% IF c.user_exists %] [% INCLUDE name %] |