{% extends "base.html" %}
{% load i18n %}
{% get_current_language as lang %}

{% block menu %}
    {% include 'menu.html' with active='experiments' %}
{% endblock %}

{% block content %}
<div class="span12">
<div class="tabbable"> <!-- Only required for left/right tabs -->
  <ul class="nav nav-tabs" id="myTab2">
      <li><a href="{% url 'experiment-list' %}">{% trans "Experiments" %}</a></li>
      <li class="active"><a href="{% url 'experiment-new' %}">{% trans "New experiment" %}</a></li>
  </ul>
  <div class="tab-content">
    <div class="offset3">
    <form action="." method="post">{% csrf_token %}
        <h2> {% trans 'New experiment' %} </h2>
        {{ form.as_p }}
        <h3> {% trans 'Tasks' %} </h3>
        {{ tasks_form.management_form }}
        {% for task_form in tasks_form %}
        <p>
            {{ task_form }}
        </p>
        <button class="btn btn-primary" type='submit'>{% trans "Execute" %}</button>&nbsp;
        <button class="btn" type='submit'><i class="icon-plus"></i>{% trans " Task" %}</button>
        {% endfor %}
    </form>
    </div>
  </div>
</div>
{% endblock %}

{% extends "base.html" %}
{% load i18n %}
{% get_current_language as lang %}

{% block menu %}
    {% include 'menu.html' with active='experiments' %}
{% endblock %}

{% block content %}
<div class="span12">
<div class="tabbable"> <!-- Only required for left/right tabs -->
  <ul class="nav nav-tabs" id="myTab2">
      <li><a href="{% url 'experiment-list' %}">{% trans "Experiments" %}</a></li>
      <li class="active"><a href="{% url 'experiment-new' %}">{% trans "New experiment" %}</a></li>
  </ul>
  <div class="tab-content">
    <div class="offset3">
    <form action="." method="post">{% csrf_token %}
        <h2> {% trans 'New experiment' %} </h2>
        {{ form.as_p }}
        <button class="btn btn-primary" type='submit'>{% trans "Execute tasks" %}</button>
        <h3> {% trans 'Tasks' %} </h3>
        {{ tasks_form.management_form }}
        {% for task_form in tasks_form %}
        <p>
            {{ form.id }}
            <div class="inline"> 
                {{ task_form }}<br/>
            </div>
        </p>
        {% endfor %}
    </form>
    </div>
  </div>
</div>
{% endblock %}

{% block javascript %}
    {{ block.super }}
    <script src="/static/js/jquery.formset.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function() {
                $('.inline').formset({
                    prefix: "{{ tasks_form.prefix }}",
                 });
        })
    </script>
{% endblock %}

Enable remove and add additional tasks during Experiment creation.
Enable remove and add additional tasks during Experiment creation.
