<%# locals: { field_values, parent_id, schema, field_name, table_header, template_locale } %>
<% ttip = nil %>
<% field_values = [] if field_values.nil? %>
<% field_label = field_label || 'No label defined' %>
<div class="col-md-12">
  <fieldset class="answer-fieldset">
    <legend class="answer-fieldset"><%= field_label %></legend>
    <table class="table table-hover linked-fragments-list <%= schema.classname %>-list">
      <thead>
        <% unless field_values.empty? %>
          <tr><th scope="col"><%= table_header %></th><th scope="col">Actions</th></tr>
        <% end %>      </thead>
      <tbody>
        <%= render(partial: 'shared/dynamic_form/linked_fragment/list', locals: {
              obj_list: field_values, 
              parent_id: parent_id,
              schema: schema,
              readonly: readonly,
              template_locale: template_locale
              }
            ) %>
      </tbody>
    </table>
    <% unless parent_id.nil? || readonly %>
      <%= link_to d_('dmpopidor', 'Create'), new_edit_linked_madmp_fragments_url(
              nil, 
              :parent_id => parent_id, 
              :schema_id => schema.id, 
              :template_locale => template_locale
      ),  {
        :remote => true, 
        :target => "_self",
        :class => "btn btn-primary",
        'data-toggle' =>  "modal", 
        'data-target' => '#modal-window'
      }  %>
    <% end %>
  </fieldset>
</div>