Skip to contentSkip to conversation

toastergui: Improve directory structure layout

PATCH Superseded Belen Barros Pena 3 participants 3 messages Oct 6, 2015 – Oct 14, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toastergui: 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.

---
 .../toaster/toastergui/static/js/jquery.treetable.js   |  2 +-
 bitbake/lib/toaster/toastergui/templates/dirinfo.html  | 18 +++++++++++-------
 2 files changed, 12 insertions(+), 8 deletions(-)
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..c5e586e 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 width="8%">Size</th>
+                    <th width="12%">Permissions</th>
+                    <th width="8%">Owner</th>
+                    <th width="8%">Group</th>
                 </tr>
             </thead>
             <tbody>
Signature · 1 line
2.3.8 (Apple Git-58)
#1 lore raw
Quoted 62 lines · Belen Barros Pena

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.

---
 .../toaster/toastergui/static/js/jquery.treetable.js   |  2 +-
 bitbake/lib/toaster/toastergui/templates/dirinfo.html  | 18
+++++++++++-------
 2 files changed, 12 insertions(+), 8 deletions(-)
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 +7 -3
index a5bc481..c5e586e 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>

bitbake/lib/toaster/toastergui/templates/dirinfo.html line 218

Quoted 10 lines
bitbake/lib/toaster/toastergui/templates/dirinfo.html +4 -4
                     <th>Source package</th>
-                    <th>Size</th>
-                    <th>Permissions</th>
-                    <th>Owner</th>
-                    <th>Group</th>
+                    <th width="8%">Size</th>
+                    <th width="12%">Permissions</th>
+                    <th width="8%">Owner</th>
+                    <th width="8%">Group</th>
 

"width" is a deprecated HTML attribute. We should use CSS to define these instead. Either style="width: 8%;" or in the stylesheet (which is probably cleaner, but would need extra classes/attributes on the th elements too).

Elliot

Quoted 12 lines
bitbake/lib/toaster/toastergui/templates/dirinfo.html +0 -0
                 </tr>
             </thead>
             <tbody>

--
2.3.8 (Apple Git-58)

--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster

Signature · 3 lines
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
#2 lore raw
Quoted 79 lines · Elliot

On 6 October 2015 at 16:52, Belen Barros Pena
<[email protected]> wrote:

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.

---
.../toaster/toastergui/static/js/jquery.treetable.js | 2 +-
bitbake/lib/toaster/toastergui/templates/dirinfo.html | 18
+++++++++++-------

2 files changed, 12 insertions(+), 8 deletions(-)
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 +7 -3
index a5bc481..c5e586e 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 <http://o.name>;
            name += '</td>';
bitbake/lib/toaster/toastergui/templates/dirinfo.html +4 -4
@@ -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 width="8%">Size</th>
+                    <th width="12%">Permissions</th>
+                    <th width="8%">Owner</th>
+                    <th width="8%">Group</th>
 
 
 
Quoted 4 lines

"width" is a deprecated HTML attribute. We should use CSS to define these instead. Either style="width: 8%;" or in the stylesheet (which is probably cleaner, but would need extra classes/attributes on the th elements too).

Thanks for the feedback. Will send a v2

Cheers

Belén

Quoted 33 lines

Elliot

                </tr>
            </thead>
            <tbody>

--
2.3.8 (Apple Git-58)

--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster

Signature · 3 lines
Elliot Smith
Software Engineer
Intel Open Source Technology Centre