Skip to contentSkip to conversation

toaster: Improve directory structure layout

PATCH New Elliot Smith 1 participant 1 message Oct 14, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toaster: Improve directory structure layout

From: Belen Barros Pena <[email protected]>

File names in the directory structure often wrap due to big indenting for nested files and directories, unnecessary width in certain columns, and not using colspan when the symlink and package cells are empty. The wrapping makes the table harder to read.

This patch reduces the amount of indenting, limits the width of the 'Size', 'Permissions', 'Owner' and 'Group' columns, and sets colspan to use the white space of the symlink and package names when empty.

---
 bitbake/lib/toaster/toastergui/static/css/default.css  |  4 ++++
 .../toaster/toastergui/static/js/jquery.treetable.js   |  2 +-
 bitbake/lib/toaster/toastergui/templates/dirinfo.html  | 18 +++++++++++-------
 3 files changed, 16 insertions(+), 8 deletions(-)
bitbake/lib/toaster/toastergui/static/css/default.css +4 -0
index cce3e31..06d9976 100644
@@ -164,6 +164,10 @@ table { table-layout: fixed; word-wrap: break-word; }
 /* Remove bottom margin for forms inside modal dialogs */
 #dependencies-modal-form { margin-bottom: 0px; }
 
+/* Custom column widths */
+.narrow-col { width: 8%; }
+.medium-col { width: 12%; }
+
 /* Configuration styles */
 .icon-trash { color: #B94A48; font-size: 16px; padding-left: 5px; }
 .icon-trash:hover { color: #943A38; text-decoration: none; cursor: pointer; }
bitbake/lib/toaster/toastergui/static/js/jquery.treetable.js +1 -1
index 42e7427..794b902 100644
@@ -421,7 +421,7 @@
         columnElType: "td", // i.e. 'td', 'th' or 'td,th'
         expandable: false,
         expanderTemplate: "<a href='#'>&nbsp;</a>",
-        indent: 19,
+        indent: 10,
         indenterTemplate: "<span class='indenter'></span>",
         initialState: "collapsed",
         nodeIdAttr: "ttId", // maps to data-tt-id
bitbake/lib/toaster/toastergui/templates/dirinfo.html +11 -7
index a5bc481..7819894 100644
@@ -103,12 +103,16 @@
             name += '</td>';
         }
         else {
-            name = '<td>';
             if (o.link_to == null) {
-                name += '<i class="icon-file"></i>';
+                namespan = 2;
+                if (o.package == null) {
+                  namespan = 3;
+                }
+                var colspan = 'colspan="' + namespan + '"';
+                name = '<td ' + colspan + '><i class="icon-file"></i>';
             }
             else {
-                name += '<i class="icon-hand-right"></i>';
+                name = '<td><i class="icon-hand-right"></i>';
             }
             name += '&nbsp;' + o.name;
             name += '</td>';
@@ -207,10 +211,10 @@
                     <th>Directory / File</th>
                     <th>Symbolic link to</th>
                     <th>Source package</th>
-                    <th>Size</th>
-                    <th>Permissions</th>
-                    <th>Owner</th>
-                    <th>Group</th>
+                    <th class="narrow-col">Size</th>
+                    <th class="medium-col">Permissions</th>
+                    <th class="narrow-col">Owner</th>
+                    <th class="narrow-col">Group</th>
                 </tr>
             </thead>
             <tbody>
Signature · 12 lines
1.9.3

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.