<div class="panel panel-default">
    <div class="panel-heading">
        <div class="panel-title">
            <a data-toggle="collapse" href="#toggleForm" data-target="#rerun_form" id="toggle_form">
                <i class="fa fa-chevron-right"></i> Re-run reduction job
            </a>
        </div>
    </div>
    <div class="panel-body collapse" id="rerun_form">
        <form id="run_variables" method="POST" action="{% url 'run_confirmation' instrument=instrument.name %}" class="form-horizontal">
            {% csrf_token %}
            <input type="hidden" name="run_range" value="{{ run_number }}">
            <input type="hidden" name="run_version" value="{{ run_version }}">
            <div class="row">
                <div class="col-md-9">
                    {% include "snippets/variables/form_warnings.html" %}
                    <div class="form-group">
                        <label for="run_description" class="control-label col-md-2">
                            Re-run description
                            <a href="#" data-toggle="popover"
                               data-content="This will be appended onto the run number for you and others to identify the reason for re-submitting."
                               data-trigger="hover click focus" data-placement="top" data-container="body" aria-label="This will be appended onto the run number for you and others to identify the reason for re-submitting.">
                                <i class="fa fa-info-circle"></i>
                            </a>
                        </label>
                        <div class="col-md-10">
                            <input type="text" name="run_description" class="form-control" />
                        </div>
                    </div>
                    <div class="js-variables-container">
                        {% include "snippets/variables/form.html" with standard_variables=standard_variables advanced_variables=advanced_variables instrument=instrument.name only %}
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="well well-sm">
                        <div class="row">
                            <div class="col-md-12">
                                <h4>Additional Actions</h4>
                            </div>
                        </div>
                        <div class="row">
                            <ul class="js-form-actions">
                                {% include "snippets/reset_buttons.html" %}
                            </ul>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12 js-action-explaination"></div>
                    </div>
                </div>
            </div>
            <div class="form-group variables-buttons">
                <div class="col-md-9 text-right">
                    <input type="submit" value="Re-run with new variables" class="btn btn-success" id="variableSubmit" />
                </div>
            </div>
        </form>
    </div>
</div>
