aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/workflow/confirm.html
blob: b7e6c46712df069e412792b75726363ac12953a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nx { color: #a6e22e } /* Name.Other */
.highlight .py { color: #f8f8f2 } /* Name.Property */
.highlight .nt { color: #f92672 } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow { color: #f92672 } /* Operator.Word */
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
.highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
.highlight .sa { color: #e6db74 } /* Literal.String.Affix */
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
.highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
.highlight .se { color: #ae81ff } /* Literal.String.Escape *
{% extends "workflow/viewport-element.html" %}
{% load staticfiles %}

{% load bootstrap3 %}

{% block content %}
<style>
.meta_container {
    padding: 50px;
}
</style>
{% bootstrap_form_errors form type='non_fields' %}
<div class="meta_container">
    <form id="meta_form" action="/wf/workflow/" method="POST" class="form">
    {% csrf_token %}
    <div class="form-group">
    {% bootstrap_field form.name %}
    {% bootstrap_field form.description %}
    </div>
    </form>
</div>
{% endblock content %}

{% block onleave %}
var ajaxForm = $("#meta_form");
var formData = ajaxForm.serialize();
req = new XMLHttpRequest();
req.open("POST", "/wf/workflow/", false);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.onerror = function() { alert("problem submitting form"); }
req.send(formData);
{% endblock %}
pan> %} {% load staticfiles %} {% load bootstrap4 %} {% block content %} <div class="text-center"> <h3>Confirm Session</h3> </div> <div id="vlan_warning"></div> <form id="vlan_form" action="/wf/workflow/" method="post"> {% csrf_token %} <input id="vlan_input" name="vlan_input" type="hidden"/> </form> <div class="container"> <div class="row justify-content-center"> <div class="col-auto"> <pre>{{confirmation_info|escape}}</pre> </div> </div> <div class="row"> <div class="col"> <div id="form_div" class="text-center p-4"> <form id="confirmation_form" action="/wf/workflow/" method="post"> {% csrf_token %} <div class="d-none"> {{form|default:"<p> No Form Loaded</p>"}} </div> </form> <div class="cform_buttons mx-auto"> <button id="confirm_button" class="btn btn-success" onclick="formconfirm()">Confirm</button> <button id="cancel_button" class="btn btn-danger" onclick="formcancel()">Cancel</button> </div> <div class="d-none"> <form id="manager_delete_form" action="/wf/workflow/finish/" method="post"> {% csrf_token %} </form> </div> </div> </div> </div> </div> <script> var select = document.getElementById("id_confirm"); function processResponseText(json) { var dict = JSON.parse(json); if( !dict["redir_url"] ) { window.top.refresh_iframe(); } else { top.window.location.href = dict["redir_url"]; } } function delete_manager() { var form = $("#manager_delete_form"); var formData = form.serialize(); var req = new XMLHttpRequest(); req.open("POST", "/wf/workflow/finish/", false); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.onerror = function() { alert("problem with cleaning up session"); } req.onreadystatechange = function() { if(req.readyState === 4 ) { processResponseText(req.responseText); }} req.send(formData); } function submitForm() { var form = $("#confirmation_form"); var formData = form.serialize(); var req = new XMLHttpRequest(); req.open("POST", "/wf/workflow/", false); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.onerror = function() { alert("problem submitting confirmation"); } req.onreadystatechange = function() { if(req.readyState === 4 ) { delete_manager(); } } req.send(formData); } function formconfirm() { select.value = "True"; submitForm(); } function formcancel() { select.value = "False"; submitForm(); } var confirmed = {{bypassed|default:"false"}}; if( confirmed ) { delete_manager(); } </script> <script> function fixVlans() { document.getElementById("vlan_input").value = "True"; var form = $("#vlan_form"); var formData = form.serialize(); var req = new XMLHttpRequest(); req.open("POST", "/wf/workflow/", false); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.onerror = function() { alert("problem submitting form"); } req.onreadystatechange = function() { //replaces current page with response if(req.readyState === 4 ) { var d = document.getElementById("vlan_warning").innerHTML = ""; document.getElementById("confirm_button").disabled = false; document.getElementById("cancel_button").disabled = false; } } req.send(formData); } var problem = {{vlan_warning|default:'false'}}; if(problem){ var d = document.getElementById("vlan_warning"); var h3 = document.createElement("h3"); h3.innerHTML = "WARNING: Vlans not available"; var h4 = document.createElement("h4"); h4.innerHTML = "The vlans you selected are not currently available. Would you like to automatically change them?"; var button1 = document.createElement("button"); button1.innerHTML = "Correct Vlans For Me"; button1.onclick = function() { fixVlans(); } var button2 = document.createElement("button"); button2.innerHTML = "Cancel. I will change my vlans"; button2.onclick = function() { formcancel(); } d.appendChild(h3); d.appendChild(h4); d.appendChild(button1); d.appendChild(button2); document.getElementById("confirm_button").disabled = true; document.getElementById("cancel_button").disabled = true; } </script> {% block element_messages %} {% endblock element_messages %} {% endblock content %} {% block onleave %} {% endblock %}