<% repository ||= Repository.find(element_id) %>
<% if my_module.blank? and @my_module.present? then my_module = @my_module end %>
<% rows = my_module.repository_rows.where(repository: repository) %>
<% if order.blank? and @order.present? then order = @order end %>
<% timestamp = Time.current + 1.year - 1.days %>
<% rows_json = my_module.repository_json_hot(repository.id, order) %>
<div class="report-element report-module-repository-element" data-sort-hot="1" data-ts="<%= timestamp.to_i %>" data-type="my_module_repository" data-id='{ "my_module_id": <%= my_module.id %>, "repository_id": <%= repository.id %> }' data-scroll-id="<%= "#{my_module.id}_#{repository.id}" %>" data-order="<%= order == :asc ? "asc" : "desc" %>" data-name="<%= repository.name %>" data-icon-class="fas fa-list-alt">
  <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 %>
      </div>
      <div class="pull-right controls">
        <%= render partial: "reports/elements/element_controls.html.erb", locals: { show_sort: true } %>
      </div>
    </div>
  </div>
  <div class="report-element-body">
    <% if rows_json[:data].count > 0 %>
      <input type="hidden" class="hot-table-contents hot-samples" value='<%= rows_json.to_json.force_encoding(Encoding::UTF_8) %>' />
      <div class="hot-table-container"></div>
    <% else %>
      <div class="row">
        <div class="col-xs-12">
          <em><%=t "projects.reports.elements.module_repository.no_items" %></em>
        </div>
      </div>
    <% end %>
  </div>
  <div class="report-element-children">
    <%= children if (defined? children and children.present?) %>
  </div>
</div>
