diff options
author | Dave Arter <davea@mysociety.org> | 2017-02-13 15:13:12 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2017-03-23 12:54:24 +0000 |
commit | 3f21a9742d89c3e4fda47a0be6ec2a17f802c99a (patch) | |
tree | 3f199f8f6b43aa8818dc3c5349623bb2d4a5e8a3 /web | |
parent | 6fb4eca34fd47612216f642985cac74359727b15 (diff) |
Add customisable defect types.
Problems can have an associated defect type, that can be assigned during
an inspection. Include an admin interface for managing these types, that
can also be assigned on a per-category basis, currently available to the
Oxfordshire cobrand.
(Also include 'TM' in traffic management Exor RDI output.)
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/fixmystreet/admin.js | 2 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 33 |
2 files changed, 18 insertions, 17 deletions
diff --git a/web/cobrands/fixmystreet/admin.js b/web/cobrands/fixmystreet/admin.js index 02eb30766..f7fcaf276 100644 --- a/web/cobrands/fixmystreet/admin.js +++ b/web/cobrands/fixmystreet/admin.js @@ -48,6 +48,8 @@ $(function(){ } }); + $("select.js-multiple[multiple]").make_multi(); + // on a body's page, hide/show deleted contact categories var $table_with_deleted_contacts = $('table tr.is-deleted td.contact-category').closest('table'); if ($table_with_deleted_contacts.length == 1) { diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index c09eeb803..e92395661 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -109,6 +109,20 @@ function isR2L() { $drawer.hide(); }); }); + }, + + make_multi: function() { + var $this = $(this), + all = $this.data('all'); + $this.multiSelect({ + allText: all, + noneText: all, + positionMenuWithin: $('#side'), + presets: [{ + name: all, + options: [] + }] + }); } }); @@ -535,23 +549,8 @@ $.extend(fixmystreet.set_up, { // to refresh the map when the filter inputs are changed. $(".report-list-filters [type=submit]").hide(); - function make_multi(id) { - var $id = $('#' + id), - all = $id.data('all'), - none = $id.data('none') || all, - allOpts = $id.data('allOptions') || []; - $id.multiSelect({ - allText: all, - noneText: none, - positionMenuWithin: $('#side'), - presets: [{ - name: all, - options: allOpts - }] - }); - } - make_multi('statuses'); - make_multi('filter_categories'); + $('#statuses').make_multi(); + $('#filter_categories').make_multi(); }, mobile_ui_tweaks: function() { |