2762: Merge branch 'master' into 2762-owner-uuid-integrity
[arvados.git] / apps / workbench / app / views / folders / show.html.erb
index e2fca647397e01b4cf01c528af628ac3c0c56e9c..11bb52c70b7bbb8290f6dabf1e4670d354fa61c1 100644 (file)
@@ -3,7 +3,7 @@
     <div class="panel panel-info">
       <div class="panel-heading">
        <h3 class="panel-title">
-         <%= render_editable_attribute @object, 'name', nil, { 'data-emptytext' => "New folder" } %>
+         <%= render_editable_attribute @object, 'name', nil, {data: {emptytext: "New folder"}} %>
        </h3>
       </div>
       <div class="panel-body">
           </div>
           <div class="col-md-6">
             <div class="input-group input-group-sm pull-right">
-              <input type="text" class="form-control" placeholder="Search folder contents"/>
+              <input type="text" class="form-control search-folder-contents" placeholder="Search folder contents"/>
             </div>
           </div>
         </div>
               <col width="30%" />
               <col width="15%" />
               <col width="15%" />
-              <col width="24%" />
-              <col width="5%" />
+              <col width="20%" />
+              <col width="8%" />
             </colgroup>
             <% @objects_and_names.each do |object, name_link| %>
-            <tr>
-              <td>
-                <%= render :partial => "selection_checkbox", :locals => {object: object} %>
-              </td>
-              <td>
-                <%= render :partial => "show_object_button", :locals => {object: object, size: 'xs'} %>
-              </td>
-              <td>
-                <%= render_editable_attribute name_link, 'name', nil, { 'data-emptytext' => "Unnamed #{object.class_for_display}" } %>
-              </td>
-              <td>
-                <%= object.content_summary %>
-              </td>
-              <td title="<%= object.modified_at %>">
-                <span>
-                  <%= raw distance_of_time_in_words(object.modified_at, Time.now).sub('about ','~').sub(' ','&nbsp;') + '&nbsp;ago' rescue object.modified_at %>
-                </span>
-              </td>
-              <td class="arvados-uuid">
-                <%= object.uuid %>
-              </td>
-              <td>
-                <% if @object.editable? %>
-                  <%= link_to({action: 'remove_item', id: @object.uuid, item_uuid: object.uuid}, method: :delete, remote: true, data: {confirm: "You are about to remove #{object.class_for_display} #{object.uuid} from this folder.\n\nAre you sure?"}, class: 'btn btn-xs btn-default') do %>
-                    Remove <i class="fa fa-fw fa-ban"></i>
+              <tr data-object-uuid="<%= (name_link && name_link.uuid) || object.uuid %>">
+                <td>
+                  <%= render :partial => "selection_checkbox", :locals => {object: object} %>
+                </td>
+                <td>
+                  <%= render :partial => "show_object_button", :locals => {object: object, size: 'xs'} %>
+                </td>
+                <td>
+                  <%= render_editable_attribute name_link, 'name', nil, {data: {emptytext: "Unnamed #{object.class_for_display}"}} %>
+                </td>
+                <td>
+                  <%= object.content_summary %>
+                </td>
+                <td title="<%= object.modified_at %>">
+                  <span>
+                    <%= raw distance_of_time_in_words(object.modified_at, Time.now).sub('about ','~').sub(' ','&nbsp;') + '&nbsp;ago' rescue object.modified_at %>
+                  </span>
+                </td>
+                <td class="arvados-uuid">
+                  <%= object.uuid %>
+                </td>
+                <td>
+                  <% if @object.editable? %>
+                    <%= link_to({action: 'remove_item', id: @object.uuid, item_uuid: ((name_link && name_link.uuid) || object.uuid)}, method: :delete, remote: true, data: {confirm: "You are about to remove #{object.class_for_display} #{object.uuid} from this folder.\n\nAre you sure?"}, class: 'btn btn-xs btn-default') do %>
+                      Remove <i class="fa fa-fw fa-ban"></i>
+                    <% end %>
                   <% end %>
-                <% end %>
-              </td>
-            </tr>
+                </td>
+              </tr>
             <% end %>
           </tbody>
           <thead>