diff options
author | Dave Arter <davea@mysociety.org> | 2016-10-14 15:44:31 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2016-10-19 14:20:56 +0100 |
commit | 7e4d4793c3af6a54667db90565f11e59e401693e (patch) | |
tree | 437936b4e7b80aceaf5f4679eee5b19abefb5e6a /web | |
parent | c78d8884f86bbd4bf6c5230937ccb6d2b35d15b8 (diff) |
Extract category edit form into its own template
* The same template is now used for creating new contacts as well as editing
existing ones.
* Zurich template for editing contacts has been left unchanged for now
* Reputation threshold is included on form
* Fields are in a more intuitive order
* Required fields are marked as such in DOM for client-side validation
* Rename ‘notes’ field to make its meaning clearer
Diffstat (limited to 'web')
-rw-r--r-- | web/js/fixmystreet-admin.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/web/js/fixmystreet-admin.js b/web/js/fixmystreet-admin.js index 6f4580feb..e0605b443 100644 --- a/web/js/fixmystreet-admin.js +++ b/web/js/fixmystreet-admin.js @@ -83,10 +83,17 @@ $(function(){ // On category edit page, hide the reputation input if inspection isn't required $("form#category_edit #inspection_required").change(function() { var $p = $("form#category_edit #reputation_threshold").closest("p"); + var $hint = $p.prevUntil().first(); if (this.checked) { $p.removeClass("hidden"); + if ($hint.length) { + $hint.removeClass("hidden"); + } } else { $p.addClass("hidden"); + if ($hint.length) { + $hint.addClass("hidden"); + } } }); }); |