Merge branch 'master' into 2257-inequality-conditions
[arvados.git] / apps / workbench / app / views / collections / _index_tbody.html.erb
index a34b213e5ab6cdae1fb0c04c3e9b1c40ffdd310d..96b73979eb60a645b69a9be0d67c4fa91d553617 100644 (file)
@@ -1,6 +1,9 @@
 <% @collections.each do |c| %>
 
 <tr class="collection" data-object-uuid="<%= c.uuid %>">
+  <td>
+    <%= render :partial => "selection_checkbox", :locals => {:object => c} %>
+  </td>
   <td>
     <%= link_to_if_arvados_object c.uuid %>
   </td>
   <td>
     <%= raw(distance_of_time_in_words(c.created_at, Time.now).sub('about ','~').sub(' ','&nbsp;')) if c.created_at %>
   </td>
-  <td class="add-tag-button">
-    <span>
-    <% if @collection_info[c.uuid] %>
-      <% @collection_info[c.uuid][:tags].uniq.each do |tag| %>
-        <span class="label label-info removable-tag" data-tag-link-uuid=""><%= tag %>&nbsp;<a>&times;</a></span><br/>
-      <% end %>
-    <% end %>
-    </span>
-    <a class="btn btn-xs btn-info add-tag-button"><i class="glyphicon glyphicon-plus"></i>&nbsp;Add</a>
-  </td>
   <td>
     <% if @collection_info[c.uuid][:wanted_by_me] %>
       <span class="label label-info">2&times;</span>
       <span class="label">cache</span>
     <% end %>
   </td>
+  <td class="add-tag-button">
+    <a class="btn btn-xs btn-info add-tag-button pull-right" data-remote-href="<%= url_for(controller: 'links', action: 'create') %>" data-remote-method="post"><i class="glyphicon glyphicon-plus"></i>&nbsp;Add</a>
+    <span class="removable-tag-container">
+    <% if @collection_info[c.uuid] %>
+      <% @collection_info[c.uuid][:tag_links].each do |tag_link| %>
+        <span class="label label-info removable-tag" data-tag-link-uuid="<%= tag_link.uuid %>"><%= tag_link.name %>
+          <% if tag_link.owner_uuid == current_user.uuid %>
+          &nbsp;<a title="Delete tag"><i class="glyphicon glyphicon-trash"></i></a>
+          <% end %>
+        </span>&nbsp;
+      <% end %>
+    <% end %>
+    </span>
+  </td>
 </tr>
 
 <% end %>