$("#agent_allocations_dialog").modal("show");

$("#agent_allocations_table").html("<table class='table table-condensed table-striped'><thead><th>Agent</th><th>Test File</th><th>Assigned at</th><th>Duration</th><th></th></thead><tbody><%  @allocations.each do |aloc| %><tr><td><%= aloc.agent_name %></td> <td><a href='#file_<%= aloc.test_file_name.parameterize %>'><%= aloc.test_file_name %></a></td> <td><%= aloc.assigned_at.strftime('%Y-%m-%d %H:%M') %></td><td width='40' align='right'><%= (Time.now - aloc.assigned_at).round(1) rescue nil %></td><td align='right'><a href='javascript:void(0)' onclick='cancel_allocation(<%= @build.id%>, <%= aloc.test_file_id %>)'><i class='fa fa-trash red'></i></a></td></tr><% end %></tbody></table>")