Hi,
See attached or branch html5+external_css from
ssh://git.debian.org/git/collab-maint/secure-testing.git
These patches turn the html into html5 and introduce a modern, slick css style
inspired from tracker.d.o - enjoy! :)
Feedback welcome!
cheers thanks to Ulrike for the nice work!
Holger
From 1317d0e6a710195c3012f6b84afeebddfddfde20 Mon Sep 17 00:00:00 2001
From: Holger Levsen hol...@layer-acht.org
Date: Sun, 14 Sep 2014 22:36:54 +0200
Subject: [PATCH 1/4] tracker_service.py: add support for external css files
---
bin/tracker_service.css | 0
bin/tracker_service.py| 11 +--
lib/python/web_support.py | 6 +++---
3 files changed, 12 insertions(+), 5 deletions(-)
create mode 100644 bin/tracker_service.css
diff --git a/bin/tracker_service.css b/bin/tracker_service.css
new file mode 100644
index 000..e69de29
diff --git a/bin/tracker_service.py b/bin/tracker_service.py
index bb1411a..79662b0 100644
--- a/bin/tracker_service.py
+++ b/bin/tracker_service.py
@@ -160,6 +160,13 @@ function onSearch(query) {
self.register('data/pts/1', self.page_data_pts)
self.register('debsecan/**', self.page_debsecan)
self.register('data/report', self.page_report)
+self.register('style.css', self.page_style_css)
+
+def page_style_css(self, path, params, url):
+f=open('tracker_service.css', 'r')
+ content=f.read()
+ f.close()
+return BinaryResult(content,'text/css')
def page_home(self, path, params, url):
query = params.get('query', ('',))[0]
@@ -1198,13 +1205,13 @@ Debian bug number.'''),
data.append(':')
data.append(str(bugs))
data.append('\n')
-return BinaryResult(''.join(data))
+return BinaryResult(''.join(data),'application/octet-stream')
def page_debsecan(self, path, params, url):
obj = '/'.join(path)
data = self.db.getDebsecan(obj)
if data:
-return BinaryResult(data)
+return BinaryResult(data,'application/octet-stream')
else:
return self.create_page(
url, Object not found,
diff --git a/lib/python/web_support.py b/lib/python/web_support.py
index 3c3ab99..e8b055c 100644
--- a/lib/python/web_support.py
+++ b/lib/python/web_support.py
@@ -620,7 +620,7 @@ class RedirectResult(Result):
class HTMLResult(Result):
An object of this class combines a status code with HTML contents.
-def __init__(self, contents, status=200, doctype=''):
+def __init__(self, contents, doctype='', status=200):
self.contents = contents
self.status = status
self.doctype = doctype
@@ -649,8 +649,8 @@ class HTMLResult(Result):
class BinaryResult(Result):
An object of this class combines a status code with HTML contents.
-def __init__(self, contents, status=200,
- mimetype='application/octet-stream'):
+def __init__(self, contents,
+ mimetype='application/octet-stream', status=200):
self.contents = contents
self.status = status
self.mimetype = mimetype
--
1.9.1
From d172f236441c888a3e47a40363d4b1f283709a98 Mon Sep 17 00:00:00 2001
From: u451f u...@451f.org
Date: Sun, 14 Sep 2014 22:43:06 +0200
Subject: [PATCH 2/4] use modern html5 css. switch to external stylesheet.
---
bin/tracker_service.css | 133 ++
bin/tracker_service.py| 55 ---
lib/python/web_support.py | 12 -
3 files changed, 164 insertions(+), 36 deletions(-)
diff --git a/bin/tracker_service.css b/bin/tracker_service.css
index e69de29..0e02a61 100644
--- a/bin/tracker_service.css
+++ b/bin/tracker_service.css
@@ -0,0 +1,133 @@
+html {
+ font-size: 100%;
+ -webkit-text-size-adjust: 100%;
+-ms-text-size-adjust:100%;
+}
+
+body {
+ width: 90%;
+ max-width: 1200px;
+ margin: 2em auto 1em;
+ font-family: Helvetica Neue,Helvetica,Arial,sans-serif;
+ font-size: 14px;
+ line-height: 20px;
+ color: #33;
+}
+
+header {
+ border-bottom: 1px solid crimson;
+ margin-bottom: 2em;
+}
+
+a {
+ color:#0088cc;
+ text-decoration:none;
+}
+
+a:hover, a:focus {
+ color:#005580;
+ text-decoration:underline;
+}
+
+ul, li {
+ list-style: none;
+}
+
+ul, ol {
+ padding-left: 0;
+}
+
+h1 {
+ font-size : 250%;
+ padding: 0;
+ margin: 0;
+ line-height: 1.4em;
+}
+
+h2 {
+ font-size : 110%;
+ background: crimson;
+ margin: 1em 0 0;
+ padding: 0.5em;
+ color: #fff;
+ border-top-left-radius: 0.5em;
+ border-top-right-radius: 0.5em;
+}
+
+h3 {
+ font-size : 110%;
+}
+
+table {
+ width: 100%;
+ border: 1px solid #ddd;
+ border-radius: 0.5em;
+ border-collapse: collapse;
+ box-shadow: 0 1px 3px #eee;
+ margin-bottom: 2em;
+}
+
+tr(even) {
+ background-color: #fafafa;
+}
+
+td, th {
+ text-align: left;
+ padding: 0.25em 0.5em;
+ border-bottom: 1px solid #ddd;
+ border-collapse: collapse;
+ vertical-align: top;
+}
+
+table tr:last-child td {
+ border: none;
+}
+
+th {
+