aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/base/config_bundle/steps/define_software.html
blob: 43f3f5d0ce5132bf7877f2573d8166436e4b1bb3 (plain)
1
2
3
4

@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 {
{% extends "config_bundle/steps/table_formset.html" %}

{% load bootstrap4 %}

{% block table %}
    <thead>
        <tr>
            <th>Device</th>
            <th>Image</th>
            <th>HeadNode</th>
        </tr>
    </thead>
    <tbody>
{% for form in formset %}
    <tr>
        <td>{% bootstrap_field form.host_name show_label=False %}</td>
        <td>{% bootstrap_field form.image show_label=False %}</td>
        <td class="table_hidden_input_parent">
            <input id="radio_{{forloop.counter}}" class="my_radio" type="radio" name="headnode" value="{{forloop.counter}}">
            {{ form.headnode }}
        </td>
    </tr>
{% endfor %}
{{formset.management_form}}

{% endblock table %}

{% block tablejs %}
<script>
    document.getElementById("radio_{{headnode}}").checked = true;

    function radio_pre_submit(){
        var parents = document.getElementsByClassName("table_hidden_input_parent");
        for(const node of parents){
            const radio = node.getElementsByClassName("my_radio")[0];
            const checkbox = radio.nextElementSibling;
            if(radio.checked){
                checkbox.value = "True";
            }
        }
    }

    form_submission_callbacks.push(radio_pre_submit);
</script>
{% endblock tablejs %}