Skip to content

Commit

Permalink
www: fix getting value of status field
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
plajjan committed Sep 25, 2014
1 parent a15285a commit c7bf647
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions nipap-www/nipapwww/controllers/xhr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nipap-www/nipapwww/public/nipap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
3 changes: 2 additions & 1 deletion nipap-www/nipapwww/templates/prefix_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
'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")
};
log("damp " + $('select[name="prefix_status"]').val());

if ($('input[name="prefix_monitor"]').is(':checked')) {
data.monitor = 'true';
Expand Down
2 changes: 1 addition & 1 deletion nipap-www/nipapwww/templates/prefix_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h3 class="options-group-heading">Prefix options</h3>
Status <span class="required tiptip" title="This field is required, please fill in! :-)">*</span>
</dt>
<dd>
<select id="prefix_status">
<select name="prefix_status">
<option {% if c.prefix.status == 'assigned' %}selected{% endif %} value="assigned">Assigned</option>
<option {% if c.prefix.status == 'reserved' %}selected{% endif %} value="reserved">Reserved</option>
<option {% if c.prefix.status == 'quarantine' %}selected{% endif %} value="quarantine">Quarantine</option>
Expand Down

0 comments on commit c7bf647

Please sign in to comment.