aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2016-12-07 11:39:59 +0000
committerDave Arter <davea@mysociety.org>2017-02-15 17:36:55 +0000
commit4d44ea5530a7dc25122e5135c19d89b4cebc5f40 (patch)
tree28ff117ae830534ccd37d3bdc70c8e5dba7f53e9 /templates
parentcd7e3087567b0fa7e64f52d802e5e911708a7eb8 (diff)
[Oxfordshire] Add Exor RDI file download feature
The RDI file format encapsulates information about inspections that have taken place, and can be uploaded into Exor to create defects in bulk. This commit adds a page to the Oxfordshire cobrand's admin allowing RDI files to be generated and downloaded from FMS. For mysociety/fixmystreetforcouncils#127
Diffstat (limited to 'templates')
-rw-r--r--templates/web/base/admin/exordefects/index.html36
-rw-r--r--templates/web/base/report/_inspect.html12
2 files changed, 48 insertions, 0 deletions
diff --git a/templates/web/base/admin/exordefects/index.html b/templates/web/base/admin/exordefects/index.html
new file mode 100644
index 000000000..06d2aa7a5
--- /dev/null
+++ b/templates/web/base/admin/exordefects/index.html
@@ -0,0 +1,36 @@
+[% INCLUDE 'admin/header.html' title=loc('Download Exor RDI') -%]
+
+[% IF error_message %]
+ <h2>Error</h2>
+ <p>[% error_message %]</p>
+[% END %]
+
+<form method="get" action="[% c.uri_for('download') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <p>
+ <label for="start_date">[% loc('Start Date:') %]</label><input type="text" class="form-control"
+ placeholder="[% loc('Click here or enter as dd/mm/yyyy') %]" name="start_date" id="start_date"
+ value="[% start_date ? start_date.strftime( '%d/%m/%Y') : '' | html %]" />
+ </p>
+
+ <p>
+ <label for="end_date">[% loc('End Date:') %]</label><input type="text" class="form-control"
+ placeholder="[% loc('Click here or enter as dd/mm/yyyy') %]" name="end_date" id="end_date" size="5"
+ value="[% end_date ? end_date.strftime( '%d/%m/%Y') : '' | html %]" />
+ </p>
+
+ <p>
+ [% loc('Inspector:') %] <select class="form-control" id='user_id' name='user_id'>
+ <option value=''>[% loc('All inspectors') %]</option>
+ [% FOR inspector IN inspectors %]
+ <option value="[% inspector.id %]" [% 'selected' IF user_id == inspector.id %]>[% inspector.name %] ([% inspector.get_extra_metadata('initials') %])</option>
+ [% END %]
+ </select>
+ </p>
+
+ <p>
+ <input type="submit" class="btn" size="30" value="Download RDI file" />
+ </p>
+</form>
+
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html
index 33b548c76..625887eff 100644
--- a/templates/web/base/report/_inspect.html
+++ b/templates/web/base/report/_inspect.html
@@ -62,6 +62,18 @@
[% END %]
[% IF permissions.report_inspect %]
+ [% IF c.cobrand.defect_types %]
+ <p>
+ <label for="defect_type">[% loc('Defect type') %]</label>
+ [% defect_type = problem.get_extra_metadata('defect_type') %]
+ <select id="defect_type" name="defect_type" class="form-control">
+ <option value=""[% ' selected' IF NOT defect_type %]>-</option>
+ [% FOREACH dt IN c.cobrand.defect_types.pairs %]
+ <option[% ' selected' IF defect_type == dt.key %] value="[% dt.key | html %]">[% dt.value | html %]</option>
+ [% END %]
+ </select>
+ </p>
+ [% END %]
<p>
<label for="state">[% loc('State') %]</label>
[% INCLUDE 'report/inspect/state_groups_select.html' %]