{% extends 'layout.html.twig' %}

{% block body %}
  {% set actionUrl = '/' ~ type ~ '/save' %}
  {% if back is defined and back is not null %}
    {% set actionUrl = actionUrl ~ '/' ~ back %}
  {% endif %}
  <form action="{{ actionUrl }}" method="post" class="margin-bottom-25">
    <input type="hidden" name="id" value="{{ element.id }}" />
    <div class="form-group">
      <label for="name">Name</label>
      <input id="name" name="name" value="{{ element.name }}" placeholder="Hier Name eintragen" class="form-control" required />
    </div>

    {% if subTemplate is defined %}
      {% include 'single_' ~ subTemplate ~ '.html.twig' with {'params': subTemplateParams} %}
    {% endif %}

    <a href="javascript:history.go(-1);" class="btn btn-default">Zurück</a>
    <button type="submit" class="btn btn-primary">Speichern</button>
  </form>
  {% if modals is defined %}
    {% for modal in modals %}
      {% include 'partials/' ~ modal ~ '_modal.html.twig' %}
    {% endfor %}
  {% endif %}

  {% include 'partials/confirm.html.twig' %}


{% endblock %}



{% block javascripts %}
{% if javascript is defined and javascript == true %}
<script src="/libs/betterschool/{{ subTemplate }}.js"></script>
{% endif %}
{% endblock %}

