1 {% extends "workflow/viewport-element.html" %}
8 <form action="/wf/workflow/" method="POST" id="software_config_form" class="form">
10 <p>Give it a name:</p>
13 <p>And a description:</p>
14 {{ form.description }}
27 <td>{{form.installer}}</td>
28 <td>{{form.scenario}}</td>
36 var supported = {{supported|safe}};
37 var installer_drop = document.getElementById("id_installer");
38 installer_drop.addEventListener("change", filter);
39 var scenario_drop = document.getElementById("id_scenario");
40 var scenario_options = {};
41 for(var i=0; i<scenario_drop.options.length; i++){
42 var option = scenario_drop.options[i];
43 scenario_options[option.text] = option;
46 scenario_drop.disabled=true;
49 //clear out existing options
50 while(scenario_drop.firstChild){
51 scenario_drop.removeChild(scenario_drop.firstChild)
53 var installer = installer_drop.options[installer_drop.selectedIndex].text;
54 var options = supported[installer];
55 for(var i=0; i<options.length; i++){
56 scenario_drop.appendChild(scenario_options[options[i]]);
58 scenario_drop.disabled = false;
62 {% endblock content %}
65 var ajaxForm = $("#software_config_form");
66 var formData = ajaxForm.serialize();
67 req = new XMLHttpRequest();
68 req.open("POST", "/wf/workflow/", false);
69 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
70 req.onerror = function() { alert("problem submitting form"); }