<% my_module ||= report_element.my_module %>
<% repository ||= report_element.repository %>
<% repository = assigned_repository_or_snapshot(my_module, repository) %>
<% if repository %>
  <% rows_json = my_module.repository_json_hot(repository, :desc) %>
  <div class="report-element report-module-repository-element">
    <div class="report-element-header">
      <div class="row">
        <div class="pull-left repository-icon">
          <i class="fas fa-list-alt"></i>
        </div>
        <div class="pull-left repository-name">
          <%= t('projects.reports.elements.module_repository.name', repository: repository.name, my_module: my_module.name) %>
          <i><%= t('projects.reports.index.deleted') if repository.is_a?(RepositorySnapshot) && !repository.original_repository %></i>
        </div>
        <% if defined?(export_all) && export_all %>
          <div class="pull-left table-name">
              <% file_link = @obj_filenames.dig(:repositories, repository.id, :file) %>
              <a href="<%= file_link %>">
                <em><%= t('projects.reports.elements.module_repository.table_name', name: file_link&.split('/')&.last) %></em>
              </a>
          </div>
        <% end %>
      </div>
    </div>
    <div class="report-element-body">
      <% if rows_json[:data].count > 0 %>
        <input type="hidden" class="hot-table-contents hot-repository-items" value='<%= rows_json.to_json.force_encoding(Encoding::UTF_8) %>' />
        <div class="hot-table-container"></div>
        <table class="report-common-table-format"></table>
      <% else %>
        <div class="row">
          <div class="col-xs-12">
            <em><%= t('projects.reports.elements.module_repository.no_items') %></em>
          </div>
        </div>
      <% end %>
    </div>
    <% if defined?(children) %>
      <div class="report-element-children">
        <%= children %>
      </div>
    <% end %>
  </div>
<% end %>
