<div class="modal fade" id="modal-info-repository-row" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title"><%= t('repository_row.modal_info.head_title', repository_row: @repository_row.name) %></h4>
      </div>

      <div class="modal-body">
        <ol class="breadcrumb breadcrumb-repository">
          <span class="fas fa-list-alt" aria-hidden="true"></span>
          <%= t('repositories.repository', name: @repository_row.repository.name) %>
        </ol>
        <p>
          <span>
            <%=t 'repository_row.modal_info.ID' %>
            <%= @repository_row.id %>
          </span>
          <br>
          <span>
            <%= t "repository_row.modal_info.added_on" %>:
            <%= l @repository_row.created_at, format: :full %>
          </span>
          <br>
          <span>
            <%= t "repository_row.modal_info.added_by" %>:
            <%= @repository_row.created_by.full_name %>
          </span>
          <% @repository_row.repository_cells.each do |repository_cell| %>
            <br>
            <span>
              <%= t "repository_row.modal_info.custom_field", cf: repository_cell.repository_column.name %>
              <% if repository_cell.value_type == 'RepositoryAssetValue' %>
                <%= render partial: "shared/asset_link", locals: { asset: repository_cell.value.asset, display_image_tag: false }, formats: :html %>
              <% else %>
                <%= custom_auto_link(repository_cell.value.formatted, simple_format: false, team: current_team) %>
              <% end %>
            </span>
          <% end %>
        </p>

      <% if @assigned_modules.count > 0 %>
        <div>
          <%= t("repository_row.modal_info.title", nr: @assigned_modules.count) %>
        </div>
        <div class="linked-children-datatable">
          <table id="repository_row-info-table" class="table dataTable no-footer" role="grid">
            <tbody>
              <% @assigned_modules.each_with_index do |element, i|  %>
                <tr role="row">
                  <td class="sorting_1">
                    <ol class='breadcrumb'>
                      <li><span class='fas fa-folder'></span>&nbsp;
                        <%= render partial: 'search/results/partials/project_text.html.erb',
                                  locals: { project: element.my_module.experiment.project } %>
                      </li>
                      <li><i class='fas fa-flask'></i>&nbsp;
                        <%= render partial: 'search/results/partials/experiment_text.html.erb',
                                  locals: { experiment: element.my_module.experiment } %>
                      </li>
                      <li><span class='fas fa-credit-card'></span>&nbsp;
                        <%= render partial: 'search/results/partials/my_module_text.html.erb',
                                  locals: { my_module: element.my_module,
                                            link_to_page: :repositories,
                                            repository: @repository_row.repository } %>
                      </li>
                    </ol>
                  </td>
                </tr>
              <% end %>
            </tbody>
            <thead>
              <tr>
                <th></th>
              </tr>
            </thead>
          </table>
        </div>
      <% else %>
        <em><%=t "repository_row.modal_info.no_tasks" %></em>
      <% end %>
      </div>
      <script>window.initPreviewModal()</script>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><%= t("general.close")%></button>
      </div>
    </div>
  </div>
</div>
