#881607 DDPO: align columns in all tables, and allow long package names to wrap

#881607#5
Date:
2017-11-13 09:59:37 UTC
From:
To:
Dear Maintainer,

Please see the attached patches, as well as the attached screenshot.

Note that the screenshot was produced by manually editing the DOM elements in
Firefox, I did not get a chance to test out the patch yet. If they are buggy,
the screenshot indicates "what was intended" so let me know and I'll fix it.

As comparison, this is what it looks like now:
https://qa.debian.org/developer.php?login=infinity0&version=testing&bin=1

X

#881607#10
Date:
2017-11-13 15:11:00 UTC
From:
To:
Ximin Luo:

I realised that my patch may break the "sorttable" functionality because everything is now combined into the same table.

However it can probably be fixed by making the javascript smarter, applying the sort only to the <tr> inside the implicit <tbody> directly after the <thead> that actually gets clicked. (And probably we should explicitly insert <tbody> in the source).

I'll add a new patch to fix this when I get some time, but in the meantime comments on the existing patches I attached would be appreciated.

X

#881607#13
Date:
2017-11-18 16:40:27 UTC
From:
To:
Re: Ximin Luo 2017-11-13 <151056717749.32421.12032705499339191390.reportbug@localhost>

I applied the break-long-package-names one, thanks!

The other one is a good idea as well, but it needs more work.
Unfortunately there's two functions in there that basically do
print_developer(), the other one being output_carnivoreid(). (I hate
that!)

I added html_table_begin() there as well, but the result is eww:
https://qa.debian.org/~myon/qa/developer.php?login=pkg-postgresql-public@lists.alioth.debian.org

Christoph

Current diff:
Index: developer.css
===================================================================
--- developer.css	(Revision 3674)
+++ developer.css	(Arbeitskopie)
@@ -53,6 +53,11 @@
 	text-align: center;
 	vertical-align: middle;
 }
+.packagetable th.pkgsection-header {
+	text-align: left;
+	color: inherit;
+	border: 0;
+}
 .packagetable td {
 	border: 1px solid #333333;
 	padding: 2px;
Index: developer.wml
===================================================================
--- developer.wml	(Revision 3674)
+++ developer.wml	(Arbeitskopie)
@@ -787,7 +787,7 @@
     $line_data = html_b(html_a($package_quoted,
             "https://tracker.debian.org/pkg/$urlpackage",
             $uploader ? "uploader" : "own_package", $description, $package_quoted)) .
-        "<wbr /><sup>" . $com_nr . $dmpackage . $wnpp_info . "</sup>" .
+        "<sup>" . $com_nr . $dmpackage . $wnpp_info . "</sup>" .
         html_br() .
         html_a("PTS", "https://packages.qa.debian.org/".get_rep($urlpackage)."/$urlpackage.html") . html_blank() .
         html_a("Pool", $pool);
@@ -1229,8 +1229,6 @@

     if (!count($trs)) return;

-    print html_h(html_a_name(html_em($branch) . " (" . count($trs) . ")", $branch), 3);
-
     /* contruct the table header */
     $ths = html_th("Source" . html_blank(). "Name", "", 2);
     if(isdisplayed('description')) $ths .= html_th("Description", "", 2);
@@ -1294,10 +1292,11 @@
     }
     if(isdisplayed('ci')) $ths .= html_th(html_a("Rep", "https://tests.reproducible-builds.org", "", "Reproducible builds"));

+    $th3 = html_h(html_a_name(html_em($branch) . " (" . count($trs) . ")", $branch), 3);
+    $th3 = $th_level1 . html_tr("<th class=\"pkgsection-header\" colspan=\"999\">$th3</th>");
     $ths = $th_level1 . html_tr($ths);
-    print html_table_begin("<thead>$ths</thead>", "", "packagetable sortable");
+    print "<thead>$th3$ths</thead>";
     foreach ($trs as $line) print $line;
-    print html_table_end();
 }

 function subscribe_db()
@@ -1475,6 +1474,8 @@
     print_header_entries_top($login, $name);
     print_header_entries_body($login, $name);

+    print html_table_begin("", "", "packagetable sortable");
+
     /* ordering 3: print subscribed packages first. Subscribed packages will
      * not show up in main/contrib/non-free (and vice-versa for other
      * orderings) */
@@ -1501,6 +1502,8 @@
         foreach ($uploaders as $uploader)
             print_uploaded_packages(array($uploader));
     }
+
+    print html_table_end();
 }

 function delete_duplicates_from_array( $array )
@@ -1654,6 +1657,8 @@
         print html_br();
     }

+    print html_table_begin("", "", "packagetable sortable");
+
     if(isdisplayed('ordering') == 3)
         foreach( $emails as $email )
             print_subscribed_packages( $email );
@@ -1698,6 +1703,8 @@

     print_given_dm_permissions( $carnivoreid );

+    print html_table_end();
+
     $global_carnivoreid = "";
 }