<% assigned_repositories.each do |repository| %>
  <div class="assigned-repository panel shared" data-repository-id="<%= repository.id %>">
    <a class="assigned-repository-caret collapsed"
       role="button"
       data-toggle="collapse"
       href="#assigned-repository-items-container-<%= repository.id %>"
       data-parent="#assigned-items-container"
    >
      <i class="sn-icon sn-icon-right"></i>
      <span class="assigned-repository-title" data-rows-count="<%= repository.assigned_rows_count %>">
        <%= repository.name %>
      </span>
      <% if repository.is_a?(RepositorySnapshot) %>
        <span class="snapshot-tag">
          <%= t('my_modules.repository.snapshots.simple_view.snapshot_tag') %>
        </span>
      <% end %>
    </a>
    <div class="collapse assigned-repository-container"
         id="assigned-repository-items-container-<%= repository.id %>"
         data-repository-url="<%= repository.is_a?(RepositorySnapshot) ?
          shared_protocol_snapshot_items_path(repository, uuid: @my_module.shareable_link.uuid) :
          shared_protocol_items_path(repository, uuid: @my_module.shareable_link.uuid) %>"
         data-footer-label="<%= assigned_repository_simple_view_footer_label(repository) %>"
         data-name-column-id="<%=  assigned_repository_simple_view_name_column_id(repository) %>"
    >
      <table class="table repository-table"
             data-stock-management="<%= repository.has_stock_management? && repository.has_stock_consumption? %>"
             data-stock-consumption-editable="false">
        <thead>
          <tr>
            <th class="row-name"><%= t("repositories.table.row_name") %></th>
            <% if repository.has_stock_management? && repository.has_stock_consumption? %>
              <th class="row-stock" data-columns-visible="false"><%= repository.repository_stock_column.name %></th>
              <th class="row-consumption" data-columns-visible="false"><%= t("repositories.table.row_consumption") %></th>
            <% end %>
          </tr>
        </thead>
        <tbody></tbody>
      </table>
    </div>
  </div>
<% end %>
