3421: Make Workbench project contents tables variable width. 3421-wide-project-tables-wip
authorBrett Smith <brett@curoverse.com>
Wed, 13 Aug 2014 16:07:06 +0000 (12:07 -0400)
committerBrett Smith <brett@curoverse.com>
Wed, 13 Aug 2014 16:07:06 +0000 (12:07 -0400)
This change will ensure that users can see the "edit name" buttons, by
letting a table row grow as needed to accommodate long names.  It puts
each row's buttons in dedicated cells to try to stay true to the
original layout as much as possible.

apps/workbench/app/views/projects/_show_contents_rows.html.erb
apps/workbench/app/views/projects/_show_tab_contents.html.erb

index d3a2e98cc313e7564a6e6486de86dd9c7e96c705..e1996a7f406f2700dbfb291b07cd1d7962d6164e 100644 (file)
@@ -9,7 +9,9 @@
       <div style="width:1em; display:inline-block;">
         <%= render partial: 'selection_checkbox', locals: {object: name_object, friendly_name: ((name_object.name rescue '') || '')} %>
       </div>
+    </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: "Remove #{object.class_for_display.downcase} #{name_object.name rescue object.uuid} from this project?", toggle: 'tooltip', placement: 'top'}, class: 'btn btn-sm btn-default btn-nodecorate', title: 'remove') do %>
           <i class="fa fa-fw fa-trash-o"></i>
       <% else %>
         <i class="fa fa-fw"></i><%# placeholder %>
       <% end %>
+    </td>
 
+    <td>
       <%= render :partial => "show_object_button", :locals => {object: object, size: 'sm', name_link: name_link} %>
+    </td>
 
+    <td>
       <%= render_editable_attribute (name_link || object), 'name', nil, {tiptitle: 'rename'} %>
     </td>
+
     <td class="arv-description-in-table">
       <%= render_controller_partial(
           'show_object_description_cell.html',
index c9c4dc06d1e41062571de3e31629e02ad23203a8..e3884b629287584581fffcf57cd85e15cecc486d 100644 (file)
     </div>
   </div>
 
-  <table class="table table-condensed table-fixedlayout arv-index arv-project-<%= tab_pane %>" style="overflow-x: hidden">
+  <table class="table table-condensed arv-index arv-project-<%= tab_pane %>">
     <colgroup>
-      <col width="40%" />
-      <col width="60%" />
+      <col width="0*" style="max-width: fit-content;" />
+      <col width="0*" style="max-width: fit-content;" />
+      <col width="0*" style="max-width: fit-content;" />
+      <col width="60%" style="width: 60%;" />
+      <col width="40%" style="width: 40%;" />
     </colgroup>
     <tbody data-infinite-scroller="#<%= tab_pane %>-scroll" data-infinite-content-href="<%= url_for partial: :contents_rows, filters: filters.to_json %>">
     </tbody>
     <thead>
       <tr>
-        <th>
-        </th>
-        <th>
-          description
-        </th>
+        <th></th>
+        <th></th>
+        <th></th>
+        <th>name</th>
+        <th>description</th>
       </tr>
     </thead>
   </table>