1 {% extends 'admin/change_form.html' %}
6 {% for dn in deployment_nodes %}
7 [{{ dn.0 }}, {{ dn.1 }} , "{{ dn.2 }}"],
11 deployment_flavors = [
12 {% for dn in deployment_flavors %}
13 [{{ dn.0 }}, {{ dn.1 }} , "{{ dn.2 }}"],
19 [{{ s.0 }}, {{ s.1 }}],
24 function update_nodes(deployment_select, node_select_id) {
25 deployment_id = $(deployment_select).val();
26 html = "<option value=''>---------</option>\n";
27 for (i in deployment_nodes) {
28 dn = deployment_nodes[i];
29 if (dn[0] == deployment_id) {
30 html = html + '<option value="' + dn[1] + '">' + dn[2] + '</option>\n'
34 $("#"+node_select_id).empty().append(html);
37 function update_flavors(deployment_select, flavor_select_id) {
38 deployment_id = $(deployment_select).val();
39 html = "<option value=''>---------</option>\n";
40 for (i in deployment_flavors) {
41 dn = deployment_flavors[i];
42 if (dn[0] == deployment_id) {
43 html = html + '<option value="' + dn[1] + '">' + dn[2] + '</option>\n'
47 $("#"+flavor_select_id).empty().append(html);
50 function sliver_deployment_changed(deployment_select) {
51 /* the inscrutable jquery selector below says:
52 find the closest parent "tr" to the current element
53 then find the child with class "field-node"
54 then find the child with that is a select
57 nodes_select_id = $($(deployment_select).closest('tr')[0]).find('.field-node select')[0].id;
58 update_nodes(deployment_select, nodes_select_id);
59 flavors_select_id = $($(deployment_select).closest('tr')[0]).find('.field-flavor select')[0].id;
60 update_flavors(deployment_select, flavors_select_id);
63 function update_slice_prefix(site_select, slice_name_id) {
64 site_id = $(site_select).val();
66 if (site_id in sites) {
67 slice_prefix=sites[site_id]+"_";
69 $("#"+slice_name_id).val(slice_prefix);