{% load dynamicforms %}

{% if data.id %}
  {% set_var title=serializer.form_titles.edit %}
{% else %}
  {% set_var title=serializer.form_titles.new %}
{% endif %}

<div class="modal fade dynamicforms-dialog" id="dialog-{{ serializer.uuid }}" tabindex="-1" role="dialog"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered {{ dialog_classes }}" role="document">
    <div class="modal-content">
      <div class="modal-header {{ dialog_header_classes }}">
        <h5 class="modal-title" id="exampleModalLongTitle">{{ title }}</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        {% include serializer.template_name with serializer=serializer data=data %}
      </div>
      <div class="modal-footer">
        {% render_table_commands serializer 'form-buttons' button_position='dialog' %}
      </div>
    </div>
  </div>
</div>
