[Qa-jenkins-scm] [jenkins.debian.net] 01/05: reproducible: use CSS for numbering the rows

Holger Levsen holger at moszumanska.debian.org
Fri Mar 13 15:22:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 1ff7243f2cd9886c043803a641eb8b38870fe8f6
Author: Holger Levsen <holger at layer-acht.org>
Date:   Fri Mar 13 14:39:10 2015 +0100

    reproducible: use CSS for numbering the rows
---
 bin/reproducible_html_indexes.py | 10 +++++-----
 userContent/static/style.css     | 12 ++++++++++++
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/bin/reproducible_html_indexes.py b/bin/reproducible_html_indexes.py
index 966bbd6..0a5a084 100755
--- a/bin/reproducible_html_indexes.py
+++ b/bin/reproducible_html_indexes.py
@@ -44,7 +44,7 @@ section must have at least a `query` defining what to file in.
 
 queries = {
     'count_total': 'SELECT COUNT(*) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite="{suite}" AND s.architecture="{arch}"',
-    'scheduled': 'SELECT (select count(*) FROM schedule AS sch_b WHERE sch.date_scheduled >= sch_b.date_scheduled), sch.date_scheduled, s.suite, s.architecture, s.name FROM schedule AS sch JOIN sources AS s ON sch.package_id=s.id WHERE sch.date_build_started = "" ORDER BY sch.date_scheduled',
+    'scheduled': 'SELECT sch.date_scheduled, s.suite, s.architecture, s.name FROM schedule AS sch JOIN sources AS s ON sch.package_id=s.id WHERE sch.date_build_started = "" ORDER BY sch.date_scheduled',
     'reproducible_all': 'SELECT s.name FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite="{suite}" AND s.architecture="{arch}" AND r.status="reproducible" ORDER BY r.build_date DESC',
     'reproducible_last24h': 'SELECT s.name FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite="{suite}" AND s.architecture="{arch}" AND r.status="reproducible" AND r.build_date > datetime("now", "-24 hours") ORDER BY r.build_date DESC',
     'reproducible_last48h': 'SELECT s.name FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite="{suite}" AND s.architecture="{arch}" AND r.status="reproducible" AND r.build_date > datetime("now", "-48 hours") ORDER BY r.build_date DESC',
@@ -295,14 +295,14 @@ def build_page_section(page, section, suite, arch):
         return (html, footnote)           # do not output anything on the page.
     html += build_leading_text_section(section, rows, suite, arch)
     if page == 'scheduled':
-        html += '<p><table class="body">\n' + tab + '<tr><th>#</th><th>scheduled at</th><th>suite</th><th>architecture</th><th>source package</th></tr>\n'
+        html += '<p><table class="scheduled">\n' + tab + '<tr><th>#</th><th>scheduled at</th><th>suite</th><th>architecture</th><th>source package</th></tr>\n'
     else:
         html += '<p>\n' + tab + '<code>\n'
     for row in rows:
         if page == 'scheduled':
-            pkg = row[4]
-            url = RB_PKG_URI + '/' + row[2] + '/' + row[3] + '/' + pkg + '.html'
-            html += tab + '<tr><td>' + str(row[0]) + '</td><td>' + row[1] + '</td><td>' + row[2] + '</td><td>' + row[3] + '</td><td><code>'
+            pkg = row[3]
+            url = RB_PKG_URI + '/' + row[1] + '/' + row[2] + '/' + pkg + '.html'
+            html += tab + '<tr><td> </td><td>' + row[0] + '</td><td>' + row[1] + '</td><td>' + row[2] + '</td><td><code>'
         else:
             pkg = row[0]
             url = RB_PKG_URI + '/' + suite + '/' + arch + '/' + pkg + '.html'
diff --git a/userContent/static/style.css b/userContent/static/style.css
index e28cb94..fb9b819 100644
--- a/userContent/static/style.css
+++ b/userContent/static/style.css
@@ -129,6 +129,7 @@ h3 {
 }
 
 table {
+	counter-reset: rowNumber; /* used for automatic row count with CSS */
 	border: 1px solid #ddd;
 	border-radius: 0.5em;
 	border-collapse: collapse;
@@ -161,6 +162,17 @@ tr:nth-child(odd) {
 	background-color: #fafafa;
 }
 
+/* automatic row count with CSS */
+table.scheduled tr:not(:first-child) {
+    counter-increment: rowNumber;
+}
+table.scheduled tr td:first-child::before {
+    content: counter(rowNumber);
+    min-width: 1em;
+    margin-right: 0.5em;
+}
+/* end automatic row count with CSS */
+
 a.bug-patch:after {
 	content: "+";
 	color: red;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list