{% load dynamicforms %}
{#This template is extended by dynamicforms/modal_dialog_rest#}

<div id="dialog-tmp-{{ serializer.uuid }}" class="jquery-ui-dialog dynamicforms-dialog" tabindex="-1" role="dialog"
     aria-hidden="true">
  {% block body %}{% endblock %}
  <div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
    <div class="ui-dialog-buttonset">{% block footer %}{% endblock %}</div>
  </div>

  <script type="text/javascript">
    var $dlgTmp = $('#dialog-tmp-{{ serializer.uuid }}');
    $dlgTmp.dialog({
      title:       "{{ title }}",
      modal:       true,
      resizable:   true,
      width:       'auto',
      dialogClass: "modal",
      close:       function (event, ui) { $dlgTmp.remove(); },
    });

    $dlgTmp.parent().attr("id", "dialog-{{ serializer.uuid }}");

    $dlgTmp.find('button').button();
    $dlgTmp.find(".close-btn").click(function (event) { $dlgTmp.dialog('close'); });
  </script>
</div>
