<% if my_module.blank? and @my_module.present? then my_module = @my_module end %>
<% if order.blank? and @order.present? then order = @order end %>
<% timestamp = Time.current + 1.year - 1.days %>
<% samples_json = my_module.samples_json_hot(order) %>
<div class="report-element report-module-samples-element" data-ts="<%= timestamp.to_i %>" data-type="my_module_samples" data-id="<%= my_module.id %>" data-order="<%= order == :asc ? "asc" : "desc" %>" data-name="<%=t "projects.reports.elements.module_samples.sidebar_name" %>" data-icon-class="glyphicon-tint">
  <div class="report-element-header">
    <div class="row">
      <div class="pull-left samples-icon">
        <span class="glyphicon glyphicon-tint"></span>
      </div>
      <div class="pull-left samples-name">
        <%=t "projects.reports.elements.module_samples.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 samples_json[:data].count > 0 %>
      <input type="hidden" class="hot-table-contents hot-samples" value='<%= samples_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_samples.no_samples" %></em>
        </div>
      </div>
    <% end %>
  </div>
  <div class="report-element-children">
    <%= children if (defined? children and children.present?) %>
  </div>
</div>
