{% extends "layout_local_experiment.html" %}

{% block content %}

<div class="content-section">
    {% if type == "web" %}
        <form method="POST" enctype="multipart/form-data" action="{{ url_for('web_experiments.web_export', experiment_title=experiment.title, username=experiment.author) }}" class="needs-validation" novalidate>
    {% else %}
        <form method="POST" enctype="multipart/form-data" action="{{ url_for('local_experiments.local_export', experiment_title=experiment.title, username=experiment.author) }}" class="needs-validation" novalidate>
    {% endif %}

            {{ form.hidden_tag() }}
            <fieldset class="form-group">
                <legend class="border-bottom mb-4"><b>{{ experiment.title }}</b>: {{ legend }}</legend>

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

                        <div class="invalid-feedback">
                            {% for error in form.file_type.errors %}
                                <span>{{ error }}</span>
                            {% endfor %}
                        </div>
                        
                    {% else %}
                    {{ form.file_type(class="form-control form-control-lg") }}
                    {% 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") }}
                    {% endif %}
                    
                    <small id="passwordHelpBlock" class="form-text text-muted">
                      By pressing <code>command</code> (Mac) or <code>Strg</code> (Windows) while clicking, you can select multiple versions at once. If you select "all versions", all data will be exported, no matter which other versions you select.
                    </small>
                </div>

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

                        <div class="invalid-feedback">
                            {% for error in form.none_value.errors %}
                                <span>{{ error }}</span>
                            {% endfor %}
                        </div>
                        
                    {% else %}
                    {{ form.none_value(class="form-control form-control-lg") }}
                    {% endif %}
                    <small id="passwordHelpBlock" class="form-text text-muted">
                      Here, you can define a value that should be inserted for missing
                    </small>
                </div>

                <div class="form-check  ">
                    
                    {% if form.replace_none_with_empty_string.errors %}
                        {{ form.replace_none_with_empty_string(class="form-check-input is-invalid") }}

                        <div class="invalid-feedback">
                            {% for error in form.replace_none_with_empty_string.errors %}
                                <span>{{ error }}</span>
                            {% endfor %}
                        </div>
                        
                    {% else %}
                    {{ form.replace_none_with_empty_string(class="form-check-input") }}
                    {% endif %}
                    {{ form.replace_none_with_empty_string.label(class="form-check-label") }}

                    <small id="passwordHelpBlock" class="form-text text-muted">
                      If you check this box, the input to the field <code>{{ form.none_value.label }}</code> will be discarded.
                    </small>
                </div>

            </fieldset>

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

{% endblock content %}