{% extends "layout_experiment.html" %}

{% block content %}

<div class="content-section">
    <form method="POST" action="" class="needs-validation" novalidate>
        {{ form.hidden_tag() }}
        <fieldset class="form-group">
            <legend class="border-bottom">{{ legend }}</legend>

            <div class="form-group">

                {% if form.script.errors %}
                {{ form.script(class="form-control form-control-sm is-invalid", style="font-family: 'Dejavu Sans Mono', monospace;",  placeholder=experiment.script) }}

                <div class="invalid-feedback">
                    {% for error in form.script.errors %}
                    <span>{{ error }}</span>
                    {% endfor %}
                </div>

                {% else %}
                {{ form.script(class="form-control form-control-sm", style="font-family: 'Dejavu Sans Mono', monospace;", rows="30", placeholder=experiment.script) }}
                {% endif %}
            </div>

            <div class="form-group">
                {{ form.version.label(class="form-control-label") }}*
                {% if form.version.errors %}
                {{ form.version(class="form-control form-control-lg is-invalid") }}
                <!-- , placeholder=form.version.label.text -->

                <div class="invalid-feedback">
                    {% for error in form.version.errors %}
                    <span>{{ error }}</span>
                    {% endfor %}
                </div>

                {% else %}
                {{ form.version(class="form-control form-control-lg", placeholder=experiment.version) }}
                {% endif %}
                <small id="versionHelpBlock" class="form-text text-muted">
                    Changing the version number allows you to choose, for which versions of an experiment you want to
                    download data. If you made substantial changes to your experiment, you should change the version.
                </small>
            </div>


        </fieldset>
        <div class="form-group">
            {{ form.submit(class="btn btn-primary")}}
        </div>
    </form>
</div>

{% endblock content %}