diff options
author | Dave Arter <davea@mysociety.org> | 2016-08-30 18:48:07 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2016-09-09 12:01:45 +0100 |
commit | 638c5d3be601c3949f1d1ce7ecae5d8b77ad8f7c (patch) | |
tree | 064a223fdcc62298dfb3f88858ddbd53084d2e65 /templates/web/base | |
parent | 3f55b249eb6dfe46fa3f6855d90510ff2d4900e9 (diff) |
Add ‘Inspection required’ field to categories
Categories can now require reports to be marked as 'inspected' via the frontend
before they're sent by send-reports.
A side-effect here is that send-reports will perform an extra n queries for each
report, where n is the number of bodies that report is being sent to, but
hopefully in practice this won't matter as it's an offline cronjob.
See mysociety/fixmystreetforcouncils#50
Diffstat (limited to 'templates/web/base')
-rw-r--r-- | templates/web/base/admin/body.html | 10 | ||||
-rw-r--r-- | templates/web/base/admin/category_edit.html | 2 | ||||
-rw-r--r-- | templates/web/base/report/_inspect.html | 11 |
3 files changed, 23 insertions, 0 deletions
diff --git a/templates/web/base/admin/body.html b/templates/web/base/admin/body.html index a00c5ca4c..6d23c1458 100644 --- a/templates/web/base/admin/body.html +++ b/templates/web/base/admin/body.html @@ -204,6 +204,16 @@ <label for="non_public" class="inline">[% loc('Private') %]</label> </p> + <div class="admin-hint"> + <p> + [% loc("Check <strong>inspection required</strong> if reports in this category <strong>must be inspected</strong> before being sent.") %] + </p> + </div> + <p> + <input type="checkbox" name="inspection_required" value="1" id="inspection_required" [% 'checked' IF contact.get_extra_metadata('inspection_required') %]> + <label for="inspection_required" class="inline">[% loc('Inspection required') %]</label> + </p> + <p> <input type="hidden" name="posted" value="new" > <input type="hidden" name="token" value="[% csrf_token %]" > diff --git a/templates/web/base/admin/category_edit.html b/templates/web/base/admin/category_edit.html index 6537fe028..cdf371643 100644 --- a/templates/web/base/admin/category_edit.html +++ b/templates/web/base/admin/category_edit.html @@ -43,6 +43,8 @@ [% IF c.cobrand.moniker != 'zurich' %] <input type="checkbox" name="non_public" value="1" id="non_public"[% ' checked' IF contact.non_public %]> <label class="inline" for="non_public">[% loc('Private') %]</label> + <input type="checkbox" name="inspection_required" value="1" id="inspection_required"[% ' checked' IF contact.get_extra_metadata('inspection_required') %]> + <label class="inline" for="inspection_required">[% loc('Inspection required') %]</label> [% ELSE %] <input type="checkbox" name="photo_required" value="1" id="photo_required"[% ' checked' IF contact.get_extra_metadata('photo_required') %]> <label class="inline" for="photo_required">[% loc('Photo required') %]</label> diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html index 6f81cc04a..188816ec1 100644 --- a/templates/web/base/report/_inspect.html +++ b/templates/web/base/report/_inspect.html @@ -76,6 +76,17 @@ <a href="[% c.uri_for( '/report', problem.id ) %]" class="btn">[% loc('Cancel') %]</a> <input type="submit" value="[% loc('Save changes') %]" name="save" /> </p> + <p> + [% UNLESS problem.get_extra_metadata('inspected') %] + <input type="submit" value="[% loc('Save changes + send') %]" name="save_inspected" /> + [% ELSE %] + [% IF problem.whensent %] + [% loc("<strong>Note:</strong> This report has been sent onwards for action. Any changes made won't be passed on.") %] + [% ELSE %] + [% loc("<strong>Note:</strong> This report hasn't yet been sent onwards for action. Any changes made may not be passed on.") %] + [% END %] + [% END %] + </p> </form> </div> </div> |