[Apt-listbugs-commits] [SCM] apt-listbugs development tree branch, master, updated. apt-listbugs/0.1.9-18-g2dc3666

Francesco Poli (wintermute) invernomuto at paranoici.org
Sat Jul 20 18:13:47 UTC 2013


The following commit has been merged in the master branch:
commit 2dc3666edf4cdf1d37395375ea9bab509de7daf4
Author: Francesco Poli (wintermute) <invernomuto at paranoici.org>
Date:   Sat Jul 20 20:00:04 2013 +0200

    turn HTML display into XHTML + external CSS

diff --git a/bug-list.css b/bug-list.css
new file mode 100644
index 0000000..28a316e
--- /dev/null
+++ b/bug-list.css
@@ -0,0 +1,121 @@
+/*
+
+Copyright (C) 2013  Francesco Poli <invernomuto at paranoici.org>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License with
+the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL-2;
+if not, write to the Free Software Foundation, Inc., 51 Franklin St,
+Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+.nocss { display: none; }
+
+body
+{
+    color: black;
+    background-color: white;
+    padding: 0.1em;
+}
+
+/* links */
+body a
+{
+    text-decoration: none;
+}
+
+body a:link
+{
+    color: blue;
+    border-bottom: 1px blue solid;
+}
+
+body a:visited
+{
+    color: black;
+    border-bottom: 1px black solid;
+}
+
+body a:hover
+{
+    color: blue;
+    border-bottom: 1px blue dashed;
+}
+
+/* title */
+div#page_title h1.title
+{
+    color: black;
+    background-color: white;
+    font-size: 180%;
+    text-align: center;
+    width: 80%;
+    margin: 0.6em auto 0.1em;
+    padding: 0.1em 0.1em 0.1em;
+    border-top: 1px black solid;
+    border-bottom: 1px black solid;
+}
+
+div#page_title h5.generated
+{
+    color: black;
+    background-color: white;
+    font-size: 80%;
+    text-align: right;
+    margin: 1.2em 0.1em 1.2em;
+    padding: 0.1em 0.1em 0.1em;
+}
+
+/* tables */
+div#page_body table.bug_table
+{
+    text-align: center;
+    vertical-align: middle;
+    margin: 1.5em auto 0.5em;
+    border: 0px;
+}
+
+div#page_body table.bug_table .pkg
+{
+    text-align: right;
+}
+
+div#page_body table.bug_table .desc
+{
+    text-align: left;
+}
+
+div#page_body table.bug_table caption
+{
+    font-size: 110%;
+    margin: 0.5em auto 0.5em;
+}
+
+div#page_body table.bug_table th
+{
+    margin: 1px;
+    border: 0px;
+    padding: 0.1em 0.5em;
+}
+
+div#page_body table.bug_table tr.row
+{
+    background-color: #eee;
+}
+
+div#page_body table.bug_table td
+{
+    margin: 1px;
+    border: 0px;
+    padding: 0.1em 0.5em;
+}
diff --git a/debian/changelog b/debian/changelog
index d4b735e..fb25fd2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,7 +7,8 @@ apt-listbugs (0.1.10) UNRELEASED; urgency=low
     [pending,forwarded,pending-fixed,fixed,done]
   * improved internationalization
   * dropped the deprecated tempfile in the cron.daily job (replaced by mktemp)
-  * improved HTML bug lists
+  * improved HTML bug lists (turned into XHTML + external CSS stored in
+    /etc/apt/listbugs/bug-list.css)
   * fixed references to GPL in common-licenses so that they point to
     /usr/share/common-licenses/GPL-2
 
diff --git a/debian/install b/debian/install
index 303d08c..7c3eeca 100644
--- a/debian/install
+++ b/debian/install
@@ -1,6 +1,7 @@
 apt-listbugs usr/sbin/
 10apt-listbugs etc/apt/apt.conf.d/
 ignore_bugs usr/share/apt-listbugs/
+bug-list.css etc/apt/listbugs/
 aptcleanup usr/share/apt-listbugs/
 lib/debian/*.rb usr/share/apt-listbugs/debian/
 lib/apt-listbugs/*.rb usr/share/apt-listbugs/apt-listbugs/
diff --git a/lib/apt-listbugs/logic.rb b/lib/apt-listbugs/logic.rb
index c807b0a..bab78f2 100644
--- a/lib/apt-listbugs/logic.rb
+++ b/lib/apt-listbugs/logic.rb
@@ -602,11 +602,18 @@ class Viewer
       stats.each { |stat|
         sub = bugs.sub("stat", stat)
         if sub.size > 0
-          o.puts "<table border=2 width=100%>"
-          o.puts " <caption>" + @config.statmap(stat) + "</caption>"
-          o.puts " <tr><th>" + _("package") + "</th><th>" + _("version change") + "</th><th>" + _("severity") + "</th><th>" + _("bug number") + "</th><th>" + _("description") + "</th></tr>"
+          o.puts "\n    <table class=\"bug_table\">"
+          o.puts "      <caption>\n        " + @config.statmap(stat)
+          o.puts "      </caption>"
+          o.puts "\n      <tr class=\"header\">"
+          o.puts "        <th class=\"pkg\">" + _("package") + "</th>"
+          o.puts "\n        <th>" + _("version change") + "</th>"
+          o.puts "\n        <th>" + _("severity") + "</th>"
+          o.puts "\n        <th>" + _("bug number") + "</th>"
+          o.puts "\n        <th class=\"desc\">" + _("description") + "</th>"
+          o.puts "      </tr>"
           yield sub
-          o.puts "</table><br>"
+          o.puts "    </table>\n    <hr class=\"nocss\" />"
         end
       }
     end
@@ -617,22 +624,34 @@ class Viewer
       bug_exist = 0
 
       tmp = HtmlTempfile.new("apt-listbugs")
-      tmp.puts "<html><head><title>" + _("Relevant bugs for your upgrade") + "</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=#{Locale.charset}\"></head><body>"
-      tmp.puts "<h1 align=\"center\">" + _("Relevant bugs for your upgrade") + "</h1>"
-      tmp.puts "<p align=\"right\">" + _("by apt-listbugs") + "</p><hr>"
-      tmp.puts "<h2>" + _("Bug reports") + "</h2>"
+      tmp.puts "<?xml version=\"1.0\" encoding=\"#{Locale.charset}\"?>"
+      tmp.puts "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
+      tmp.puts "    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
+      tmp.puts "\n<html xmlns=\"http://www.w3.org/1999/xhtml\">"
+      tmp.puts "<head>\n  <meta name=\"generator\" content=\"apt-listbugs\" />"
+      tmp.puts "\n  <title>" + _("Relevant bugs for your upgrade") + "</title>"
+      tmp.puts "  <link href=\"/etc/apt/listbugs/bug-list.css\" rel=\"stylesheet\" type=\"text/css\" />"
+      tmp.puts "</head>\n\n<body>\n  <div id=\"page_title\">"
+      tmp.puts "    <h1 class=\"title\">" + _("Relevant bugs for your upgrade") + "</h1>"
+      tmp.puts "\n    <h5 class=\"generated\">" + _("by apt-listbugs") + "</h5>"
+      tmp.puts "  </div>\n\n  <div id=\"page_body\">"
+      tmp.puts "    <hr class=\"nocss\" />"
 
       each_state_table(tmp, bugs, @config.stats) { |bugs|
         bugs.each { |bug|
           pkg = bug.pkg_name
-          tmp.puts "<tr><td>#{pkg}</td><td>"
-          tmp.puts "#{cur_pkgs[pkg]['version']} " if cur_pkgs[pkg] != nil
-          tmp.puts "-> #{new_pkgs[pkg]['version']}" if new_pkgs[pkg] != nil
-          tmp.puts "</td><td>#{bug.severity}</td><td><a href=\"http://bugs.debian.org/#{bug.bug_number}\">##{bug.bug_number}</a></td><td>#{bug.desc}</td></tr>"
+          tmp.puts "\n      <tr class=\"row\">"
+          tmp.puts "        <td class=\"pkg\">#{pkg}</td>"
+          tmp.print "\n        <td>"
+          tmp.print "#{cur_pkgs[pkg]['version']} " if cur_pkgs[pkg] != nil
+          tmp.print "-> #{new_pkgs[pkg]['version']}" if new_pkgs[pkg] != nil
+          tmp.puts "</td>\n\n        <td>#{bug.severity}</td>"
+          tmp.puts "\n        <td><a href=\"http://bugs.debian.org/#{bug.bug_number}\">##{bug.bug_number}</a></td>"
+          tmp.puts "\n        <td class=\"desc\">#{bug.desc}</td>\n      </tr>"
         }
       }
 
-      tmp.puts "</body></html>"
+      tmp.puts "  </div>\n</body>\n</html>"
       tmp.close
 
       puts "Invoking browser for #{tmp.path}" if $DEBUG

-- 
apt-listbugs development tree



More information about the Apt-listbugs-commits mailing list