Scott Baker | 510fdbb | 2014-08-05 17:19:24 -0700 | [diff] [blame] | 1 | {% extends 'admin/change_form.html' %} |
| 2 | {% block extrahead %} |
| 3 | {{ block.super }} |
| 4 | <script> |
| 5 | deployment_nodes = [ |
| 6 | {% for dn in deployment_nodes %} |
| 7 | [{{ dn.0 }}, {{ dn.1 }} , "{{ dn.2 }}"], |
| 8 | {% endfor %} |
| 9 | ]; |
Scott Baker | 34b502f | 2014-08-05 18:33:31 -0700 | [diff] [blame^] | 10 | |
| 11 | function update_nodes(deployment_select, node_select_id) { |
| 12 | deployment_id = $(deployment_select).val(); |
| 13 | html = "<option value=''>---------</option>\n"; |
| 14 | for (i in deployment_nodes) { |
| 15 | dn = deployment_nodes[i]; |
| 16 | if (dn[0] == deployment_id) { |
| 17 | html = html + '<option value="' + dn[1] + '">' + dn[2] + '</option>\n' |
| 18 | } |
| 19 | } |
| 20 | //console.log(html); |
| 21 | $("#"+node_select_id).empty().append(html); |
| 22 | } |
Scott Baker | 510fdbb | 2014-08-05 17:19:24 -0700 | [diff] [blame] | 23 | </script> |
Scott Baker | 34b502f | 2014-08-05 18:33:31 -0700 | [diff] [blame^] | 24 | |
Scott Baker | 510fdbb | 2014-08-05 17:19:24 -0700 | [diff] [blame] | 25 | {% endblock %} |
| 26 | |