<div class="modal-dialog madmp-fragment" role="document">
  <div class="modal-content">
    <div class="modal-header">
      <h2 class="modal-title" id="exampleModalLabel"><%= @classname.capitalize %> </h2>
      <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">&times;</span>
      </button>
    </div>
    <%= form_for @fragment, url: create_or_update_madmp_fragments_path(id: @fragment.id),
                        html: {method: :post, remote: true, class: 'form-horizontal', id: "modal_fragment_form" } do |f| %>  
      <%= f.hidden_field :dmp_id, id: nil %>
      <%= f.hidden_field :parent_id, id: nil %>
      <%= f.hidden_field :id, id: nil %>
      <%= f.hidden_field :schema_id, :value => @schema.id, id: nil%>
      <%= f.hidden_field :template_locale, :value => @templateLocale, id: nil%>
      <%= f.hidden_field "source", :value => "modal" %>
      <div class="modal-body">
        <fieldset aria-labelledby="answer-fieldset" <%= 'disabled' if @readonly %> >
          <%= render(partial: "shared/dynamic_form/form", locals: {
            f: f,
            fragment: @fragment, 
            fragment_id: @parent_fragment.id,
            schema: @schema,
            question_id: nil,
            classname: @classname,
            readonly: false,
            template_locale: @templateLocale
          })%>
        </fieldset>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal"><%= _('Close') %> </button>
        <%= f.button(_('Submit'), class: "btn btn-primary", type: "submit") unless @readonly %>
      </div>
    <% end %>
  </div>
</div>