<table class="table">
  <thead>
    <tr class="contain-align-left">
      <th>
	id
      </th><th>
	class
      </th><th>
	name
      </th><th>
	tail
      </th><th>
	head
      </th><th>
	properties
      </th><th>
      </th>
    </tr>
  </thead>
  <tbody>

    <% @objects.sort_by { |link| link[:created_at] }.each do |link| %>

    <tr>
      <td>
        <%= link_to_if_arvados_object link %>
      </td><td>
        <%= render_editable_attribute link, 'link_class' %>
      </td><td>
        <%= render_editable_attribute link, 'name' %>
      </td><td>
        <%= render_editable_attribute link, 'tail_uuid' %>
      </td><td>
        <%= render_editable_attribute link, 'head_uuid' %>
      </td><td>
        <%= link.properties %>
      </td>

      <td>
        <% if current_user and (current_user.is_admin or current_user.uuid == link.owner_uuid) %>
        <%= link_to raw('<i class="glyphicon glyphicon-trash"></i>'), { action: 'destroy', id: link.uuid }, { confirm: 'Delete this link?', method: 'delete' } %>
        <% end %>
      </td>

    </tr>

    <% end %>
    <% if @objects.count == 0 %>
    <tr>
      <td colspan="7">
        (no links)
      </td>
    </tr>
    <% end %>

  </tbody>
</table>