<% table_rows = @requests_data_table.rows %>
{
  "draw": "<%= @requests_data_table.draw %>",
  "recordsTotal": "<%= @requests_data_table.records_total %>",
  "recordsFiltered": "<%= @requests_data_table.count_requests %>",
  "data": [
    <% table_rows.each.with_index do |row, index| %>
      [
        "<%= escape_javascript(TimeComponent.new(time: row.created_at).human_time) %>",
        <% cache "request-table-row-#{row.id}-#{row.updated_at.to_i}" do %>
          "<%= escape_javascript(project_or_package_link(project: row.source_project, package: row.source_package, creator: row.creator, trim_to: 40, short: true)) %>",
          "<%= escape_javascript(target_project_link(row)) %>",
          "<%= escape_javascript(user_with_realname_and_icon(row.creator, short: true)) %>",
          "<%= escape_javascript(new_or_update_request(row)) %>",
          "<%= escape_javascript(row.priority) %>",
          "<%= escape_javascript(link_to(
            '<span class="fa-stack half-font-size me-2">
               <i class="far fa-file fa-stack-2x"></i>
               <i class="fas fa-search fa-stack-1x"></i>
             </span><span class="text-nowrap">View</span>'.html_safe,
            request_show_path(row.number),
            { title: "Show request ##{row.number}", class: :request_link })) %>"
        <% end %>
      ]
      <% unless index == table_rows.length - 1 %>
        ,
      <% end %>
    <% end %>
  ]
}
