From 26810773e64cef9b0d874676554aebb15e798044 Mon Sep 17 00:00:00 2001 From: Kristian Larsson Date: Thu, 25 Sep 2014 08:19:22 +0200 Subject: [PATCH] www: fix getting value of status field Simply incorrect reference to the drop down menu containing the value of the status field. It's a select element and not an input! XHR for edit_prefix didn't even pick up on the status field, it does now! Fixes #625. --- nipap-www/nipapwww/controllers/xhr.py | 3 +++ nipap-www/nipapwww/public/nipap.js | 2 +- nipap-www/nipapwww/templates/prefix_edit.html | 2 +- nipap-www/nipapwww/templates/prefix_form.html | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nipap-www/nipapwww/controllers/xhr.py b/nipap-www/nipapwww/controllers/xhr.py index 4b2b76ee0..04467b40e 100644 --- a/nipap-www/nipapwww/controllers/xhr.py +++ b/nipap-www/nipapwww/controllers/xhr.py @@ -643,6 +643,9 @@ def edit_prefix(self, id): else: p.node = request.params['node'].strip() + if 'status' in request.params: + p.status = request.params['status'].strip() + if 'pool' in request.params: if request.params['pool'].strip() == '': p.pool = None diff --git a/nipap-www/nipapwww/public/nipap.js b/nipap-www/nipapwww/public/nipap.js index a6f2261d2..e6af541a0 100644 --- a/nipap-www/nipapwww/public/nipap.js +++ b/nipap-www/nipapwww/public/nipap.js @@ -2234,7 +2234,7 @@ function prefixFormSubmit(e) { 'tags': $('input[name="prefix_tags"]').val(), 'node': $('input[name="prefix_node"]').val(), 'type': $('input[name="prefix_type"]:checked').val(), - 'status': $('input[name="prefix_status"]').val(), + 'status': $('select[name="prefix_status"]').val(), 'country': $('input[name="prefix_country"]').val(), 'order_id': $('input[name="prefix_order_id"]').val(), 'customer_id': $('input[name="prefix_customer_id"]').val(), diff --git a/nipap-www/nipapwww/templates/prefix_edit.html b/nipap-www/nipapwww/templates/prefix_edit.html index 1aba0d1db..1cb6c3759 100644 --- a/nipap-www/nipapwww/templates/prefix_edit.html +++ b/nipap-www/nipapwww/templates/prefix_edit.html @@ -33,7 +33,7 @@ 'comment': $('input[name="prefix_comment"]').val(), 'alarm_priority': $('input[name="prefix_alarm_priority"]:checked').val(), 'vlan': $('input[name="prefix_vlan"]').val(), - 'status': $('input[name="prefix_status"]').val(), + 'status': $('select[name="prefix_status"]').val(), 'tags': $("#tags").tagit("assignedTags") }; diff --git a/nipap-www/nipapwww/templates/prefix_form.html b/nipap-www/nipapwww/templates/prefix_form.html index 8f953da8a..1beb53b3a 100644 --- a/nipap-www/nipapwww/templates/prefix_form.html +++ b/nipap-www/nipapwww/templates/prefix_form.html @@ -78,7 +78,7 @@

Prefix options

Status *
-