diff options
-rw-r--r-- | templates/web/base/questionnaire/index.html | 25 | ||||
-rw-r--r-- | templates/web/base/report/form/photo_upload.html | 24 | ||||
-rw-r--r-- | templates/web/base/report/update/form_update.html | 25 |
3 files changed, 26 insertions, 48 deletions
diff --git a/templates/web/base/questionnaire/index.html b/templates/web/base/questionnaire/index.html index 36123013f..7a08d461d 100644 --- a/templates/web/base/questionnaire/index.html +++ b/templates/web/base/questionnaire/index.html @@ -74,30 +74,7 @@ <p><textarea class="form-control" name="update" rows="7" cols="30">[% update | html %]</textarea></p> -[% IF c.cobrand.allow_photo_upload %] - <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> - <label for="form_photo"> - <span data-singular="[% loc('Photo') %]" data-plural="[% loc('Photos') %]">[% loc('Photo') %]</span> - </label> - - [% IF field_errors.photo %] - <p class='form-error'>[% field_errors.photo %]</p> - [% END %] - - <div id="form_photos"> - [% IF upload_fileid %] - <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/temp.[% id %]" alt=""> - [% END %] - [% END %] - <input type="file" name="photo1" id="form_photo"> - <label for="form_photo2">[% loc('Photo') %]</label> - <input type="file" name="photo2" id="form_photo2"> - <label for="form_photo3">[% loc('Photo') %]</label> - <input type="file" name="photo3" id="form_photo3"> - </div> -[% END %] +[% INCLUDE report/form/photo_upload.html %] <div class="js-another-questionnaire"> <p>4. [% loc('Would you like to receive another questionnaire in 4 weeks, reminding you to check the status?') %]</p> diff --git a/templates/web/base/report/form/photo_upload.html b/templates/web/base/report/form/photo_upload.html new file mode 100644 index 000000000..960141210 --- /dev/null +++ b/templates/web/base/report/form/photo_upload.html @@ -0,0 +1,24 @@ +[% IF c.cobrand.allow_photo_upload %] + <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> + <label for="form_photo"> + <span data-singular="[% loc('Photo') %]" data-plural="[% loc('Photos') %]">[% loc('Photo') %]</span> + </label> + + [% IF field_errors.photo %] + <p class='form-error'>[% field_errors.photo %]</p> + [% END %] + + <div id="form_photos"> + [% IF upload_fileid %] + <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/temp.[% id %]" alt=""> + [% END %] + [% END %] + <input type="file" name="photo1" id="form_photo"> + <label for="form_photo2">[% loc('Photo') %]</label> + <input type="file" name="photo2" id="form_photo2"> + <label for="form_photo3">[% loc('Photo') %]</label> + <input type="file" name="photo3" id="form_photo3"> + </div> +[% END %] diff --git a/templates/web/base/report/update/form_update.html b/templates/web/base/report/update/form_update.html index 089d63f55..7132331bc 100644 --- a/templates/web/base/report/update/form_update.html +++ b/templates/web/base/report/update/form_update.html @@ -1,30 +1,7 @@ <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"> - <span data-singular="[% loc('Photo') %]" data-plural="[% loc('Photos') %]">[% loc('Photo') %]</span> - </label> - - [% IF field_errors.photo %] - <p class='form-error'>[% field_errors.photo %]</p> - [% END %] - - <div id="form_photos"> - [% IF upload_fileid %] - <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/temp.[% id %]" alt=""> - [% END %] - [% END %] - <input type="file" name="photo1" id="form_photo"> - <label for="form_photo2">[% loc('Photo') %]</label> - <input type="file" name="photo2" id="form_photo2"> - <label for="form_photo3">[% loc('Photo') %]</label> - <input type="file" name="photo3" id="form_photo3"> - </div> -[% END %] +[% INCLUDE report/form/photo_upload.html %] [% TRY %][% PROCESS 'report/update/before_update.html' %][% CATCH file %][% END %] |