From 5c9f71997913545cc71ddd96a8e838ca6e2b9782 Mon Sep 17 00:00:00 2001 From: Mike Bonnet Date: Fri, 3 Oct 2008 10:56:52 -0400 Subject: [PATCH] update the web UI to conform to XHTML 1.0 Transitional (thanks W3C Validator!) --- www/kojiweb/buildrootinfo.chtml | 4 ++-- www/kojiweb/builds.chtml | 8 ++++---- www/kojiweb/buildsbystatus.chtml | 10 +++++----- www/kojiweb/buildsbytarget.chtml | 14 +++++++------- www/kojiweb/buildsbyuser.chtml | 10 +++++----- www/kojiweb/buildtargetedit.chtml | 7 ++++--- www/kojiweb/buildtargets.chtml | 8 ++++---- www/kojiweb/fileinfo.chtml | 6 +++--- www/kojiweb/hosts.chtml | 8 ++++---- www/kojiweb/includes/header.chtml | 24 ++++++++++++------------ www/kojiweb/index.chtml | 12 ++++++------ www/kojiweb/index.py | 13 ++++++++++++- www/kojiweb/notificationedit.chtml | 10 +++++----- www/kojiweb/packageinfo.chtml | 8 ++++---- www/kojiweb/packages.chtml | 8 ++++---- www/kojiweb/packagesbyuser.chtml | 10 +++++----- www/kojiweb/rpminfo.chtml | 14 +++++++------- www/kojiweb/rpmlist.chtml | 8 ++++---- www/kojiweb/rpmsbyhost.chtml | 10 +++++----- www/kojiweb/searchresults.chtml | 8 ++++---- www/kojiweb/tagedit.chtml | 4 ++-- www/kojiweb/tags.chtml | 8 ++++---- www/kojiweb/tasks.chtml | 8 ++++---- www/kojiweb/tasksbyhost.chtml | 10 +++++----- www/kojiweb/tasksbyuser.chtml | 10 +++++----- www/kojiweb/userinfo.chtml | 8 ++++---- www/kojiweb/users.chtml | 8 ++++---- www/lib/kojiweb/util.py | 4 ++-- www/static/koji.css | 26 ++++++++++++++------------ 29 files changed, 150 insertions(+), 136 deletions(-) diff --git a/www/kojiweb/buildrootinfo.chtml b/www/kojiweb/buildrootinfo.chtml index 4369ddc2..fc23f0b3 100644 --- a/www/kojiweb/buildrootinfo.chtml +++ b/www/kojiweb/buildrootinfo.chtml @@ -44,10 +44,10 @@ Repo Created$util.formatTimeLong($buildroot.repo_create_event_time) - Component RPMs + Component RPMs - Built RPMs + Built RPMs diff --git a/www/kojiweb/builds.chtml b/www/kojiweb/builds.chtml index 5d7b1a6f..88fa1504 100644 --- a/www/kojiweb/builds.chtml +++ b/www/kojiweb/builds.chtml @@ -66,11 +66,11 @@ #if $len($buildPages) > 1 -
+ Page:
@@ -118,11 +118,11 @@ #if $len($buildPages) > 1 -
+ Page:
diff --git a/www/kojiweb/buildsbystatus.chtml b/www/kojiweb/buildsbystatus.chtml index a5a18f85..8a27dd01 100644 --- a/www/kojiweb/buildsbystatus.chtml +++ b/www/kojiweb/buildsbystatus.chtml @@ -4,7 +4,7 @@ #if not $label #set $label = $value #end if - + #end def #include "includes/header.chtml" @@ -13,7 +13,7 @@ - + - + - +
-
+ Show last
Succeededgraph row $numSucceeded
Failedgraph row $numFailed
Canceledgraph row $numCanceled
diff --git a/www/kojiweb/buildsbytarget.chtml b/www/kojiweb/buildsbytarget.chtml index 3605dc40..e68cb5bb 100644 --- a/www/kojiweb/buildsbytarget.chtml +++ b/www/kojiweb/buildsbytarget.chtml @@ -4,7 +4,7 @@ #if not $label #set $label = $value #end if - + #end def #include "includes/header.chtml" @@ -13,7 +13,7 @@ - + #end for @@ -74,11 +74,11 @@ - + #end for @@ -48,11 +48,11 @@ @@ -41,7 +41,7 @@ @@ -56,6 +56,7 @@ -
- + Show last
#if $len($targetPages) > 1 - + Page: @@ -62,7 +62,7 @@ #for $target in $targets
$target.namegraph row $target.builds
#if $len($targetPages) > 1 -
+ Page:
diff --git a/www/kojiweb/buildsbyuser.chtml b/www/kojiweb/buildsbyuser.chtml index f1394f9f..e3740fad 100644 --- a/www/kojiweb/buildsbyuser.chtml +++ b/www/kojiweb/buildsbyuser.chtml @@ -7,11 +7,11 @@
#if $len($userBuildPages) > 1 -
+ Page:
@@ -36,7 +36,7 @@ #for $userBuild in $userBuilds
$userBuild.namegraph row $userBuild.builds
#if $len($userBuildPages) > 1 -
+ Page:
diff --git a/www/kojiweb/buildtargetedit.chtml b/www/kojiweb/buildtargetedit.chtml index 9a62cf84..f550011c 100644 --- a/www/kojiweb/buildtargetedit.chtml +++ b/www/kojiweb/buildtargetedit.chtml @@ -30,7 +30,7 @@
+ + #include "includes/footer.chtml" diff --git a/www/kojiweb/buildtargets.chtml b/www/kojiweb/buildtargets.chtml index cb4041bc..395ca413 100644 --- a/www/kojiweb/buildtargets.chtml +++ b/www/kojiweb/buildtargets.chtml @@ -7,11 +7,11 @@ #if $len($targetPages) > 1 -
+ Page:
@@ -46,11 +46,11 @@ #if $len($targetPages) > 1 -
+ Page:
diff --git a/www/kojiweb/fileinfo.chtml b/www/kojiweb/fileinfo.chtml index a7bb15bc..eadc570e 100644 --- a/www/kojiweb/fileinfo.chtml +++ b/www/kojiweb/fileinfo.chtml @@ -2,11 +2,11 @@ #import urllib #include "includes/header.chtml" -

Information for file $file.name

+

Information for file $file.name

- + @@ -24,7 +24,7 @@ #set $epoch = ($rpm.epoch != None and $str($rpm.epoch) + ':' or '') - +
Name$file.nameName$file.name
MD5 Sum$file.md5
RPM$rpm.name-$epoch$rpm.version-$rpm.release.${rpm.arch}.rpmRPM$rpm.name-$epoch$rpm.version-$rpm.release.${rpm.arch}.rpm
diff --git a/www/kojiweb/hosts.chtml b/www/kojiweb/hosts.chtml index 53bfc9d9..3466cd6b 100644 --- a/www/kojiweb/hosts.chtml +++ b/www/kojiweb/hosts.chtml @@ -7,11 +7,11 @@ #if $len($hostPages) > 1 -
+ Page:
@@ -54,11 +54,11 @@ #if $len($hostPages) > 1 -
+ Page:
diff --git a/www/kojiweb/includes/header.chtml b/www/kojiweb/includes/header.chtml index a0cada82..e000293a 100644 --- a/www/kojiweb/includes/header.chtml +++ b/www/kojiweb/includes/header.chtml @@ -1,7 +1,7 @@ #import koji #import random - + #def greeting() #set $greetings = ('hello', 'hi', 'yo', "what's up", "g'day", 'back to work', @@ -65,16 +65,16 @@ diff --git a/www/kojiweb/index.chtml b/www/kojiweb/index.chtml index 9d4f7f31..409af01a 100644 --- a/www/kojiweb/index.chtml +++ b/www/kojiweb/index.chtml @@ -10,11 +10,11 @@ #if $len($buildPages) > 1 -
+ Page:
@@ -57,11 +57,11 @@ #if $len($taskPages) > 1 -
+ Page:
@@ -109,11 +109,11 @@ #if $len($packagePages) > 1 -
+ Page:
diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py index 9b990224..984d0ddd 100644 --- a/www/kojiweb/index.py +++ b/www/kojiweb/index.py @@ -4,6 +4,7 @@ import re import sys import mod_python import mod_python.Cookie +import Cheetah.Filters import Cheetah.Template import datetime import time @@ -85,6 +86,16 @@ def _initValues(req, title='Build System Info', pageID='summary'): return values +# Escape ampersands so the output can be valid XHTML +class XHTMLFilter(Cheetah.Filters.EncodeUnicode): + def filter(self, *args, **kw): + result = super(XHTMLFilter, self).filter(*args, **kw) + result = result.replace('&', '&') + result = result.replace('&nbsp;', ' ') + result = result.replace('&lt;', '<') + result = result.replace('&gt;', '>') + return result + def _genHTML(req, fileName): os.chdir(os.path.dirname(req.filename)) @@ -93,7 +104,7 @@ def _genHTML(req, fileName): else: req._values['currentUser'] = None - return Cheetah.Template.Template(file=fileName, searchList=[req._values], filter='EncodeUnicode').respond() + return Cheetah.Template.Template(file=fileName, searchList=[req._values], filter=XHTMLFilter).respond() def _getServer(req): serverURL = req.get_options().get('KojiHubURL', 'http://localhost/kojihub') diff --git a/www/kojiweb/notificationedit.chtml b/www/kojiweb/notificationedit.chtml index ac066e24..9907ea29 100644 --- a/www/kojiweb/notificationedit.chtml +++ b/www/kojiweb/notificationedit.chtml @@ -17,9 +17,9 @@ Package @@ -28,16 +28,16 @@ Tag Success Only? - + diff --git a/www/kojiweb/packageinfo.chtml b/www/kojiweb/packageinfo.chtml index 7ae06bd9..e0fcb716 100644 --- a/www/kojiweb/packageinfo.chtml +++ b/www/kojiweb/packageinfo.chtml @@ -20,11 +20,11 @@ #if $len($buildPages) > 1 -
+ Page:
@@ -68,11 +68,11 @@ #if $len($tagPages) > 1 -
+ Page:
diff --git a/www/kojiweb/packages.chtml b/www/kojiweb/packages.chtml index 9f79fee9..836cdca9 100644 --- a/www/kojiweb/packages.chtml +++ b/www/kojiweb/packages.chtml @@ -36,11 +36,11 @@ #if $len($packagePages) > 1 -
+ Page:
@@ -85,11 +85,11 @@ #if $len($packagePages) > 1 -
+ Page:
diff --git a/www/kojiweb/packagesbyuser.chtml b/www/kojiweb/packagesbyuser.chtml index ec6241d4..f32de512 100644 --- a/www/kojiweb/packagesbyuser.chtml +++ b/www/kojiweb/packagesbyuser.chtml @@ -7,11 +7,11 @@ #if $len($userPages) > 1 -
+ Page:
@@ -36,7 +36,7 @@ #for $user in $users $user.name - + graph row $user.packages #end for @@ -48,11 +48,11 @@ #if $len($userPages) > 1 -
+ Page:
diff --git a/www/kojiweb/rpminfo.chtml b/www/kojiweb/rpminfo.chtml index 896ccd61..7a3390b5 100644 --- a/www/kojiweb/rpminfo.chtml +++ b/www/kojiweb/rpminfo.chtml @@ -46,7 +46,7 @@ #for $dep in $provides - + #end for
$util.formatDep($dep.name, $dep.version, $dep.flags)$util.escapeHTML($util.formatDep($dep.name, $dep.version, $dep.flags))
@@ -62,7 +62,7 @@ #for $dep in $requires - + #end for
$util.formatDep($dep.name, $dep.version, $dep.flags)$util.escapeHTML($util.formatDep($dep.name, $dep.version, $dep.flags))
@@ -78,7 +78,7 @@ #for $dep in $obsoletes - + #end for
$util.formatDep($dep.name, $dep.version, $dep.flags)$util.escapeHTML($util.formatDep($dep.name, $dep.version, $dep.flags))
@@ -94,7 +94,7 @@ #for $dep in $conflicts - + #end for
$util.formatDep($dep.name, $dep.version, $dep.flags)$util.escapeHTML($util.formatDep($dep.name, $dep.version, $dep.flags))
@@ -111,11 +111,11 @@ #if $len($filePages) > 1 -
+ Page:
@@ -135,7 +135,7 @@ #for $file in $files - $file.name$file.size + $file.name$file.size #end for diff --git a/www/kojiweb/rpmlist.chtml b/www/kojiweb/rpmlist.chtml index 76493658..26b18e76 100644 --- a/www/kojiweb/rpmlist.chtml +++ b/www/kojiweb/rpmlist.chtml @@ -12,11 +12,11 @@ #if $len($rpmPages) > 1 -
+ Page:
@@ -57,11 +57,11 @@ #if $len($rpmPages) > 1 -
+ Page:
diff --git a/www/kojiweb/rpmsbyhost.chtml b/www/kojiweb/rpmsbyhost.chtml index c3018130..5503a826 100644 --- a/www/kojiweb/rpmsbyhost.chtml +++ b/www/kojiweb/rpmsbyhost.chtml @@ -39,11 +39,11 @@ #if $len($hostPages) > 1 -
+ Page:
@@ -68,7 +68,7 @@ #for $host in $hosts $host.name - + graph row $host.rpms #end for @@ -80,11 +80,11 @@ #if $len($hostPages) > 1 -
+ Page:
diff --git a/www/kojiweb/searchresults.chtml b/www/kojiweb/searchresults.chtml index df3b40c0..c0c21b5b 100644 --- a/www/kojiweb/searchresults.chtml +++ b/www/kojiweb/searchresults.chtml @@ -9,11 +9,11 @@ #if $len($resultPages) > 1 -
+ Page:
@@ -50,11 +50,11 @@ #if $len($resultPages) > 1 -
+ Page:
diff --git a/www/kojiweb/tagedit.chtml b/www/kojiweb/tagedit.chtml index e78bc0e6..242bdd6b 100644 --- a/www/kojiweb/tagedit.chtml +++ b/www/kojiweb/tagedit.chtml @@ -25,13 +25,13 @@ Locked - + Permission #for $pageNum in $tagPages - + #end for @@ -46,11 +46,11 @@ #if $len($tagPages) > 1 -
+ Page:
diff --git a/www/kojiweb/tasks.chtml b/www/kojiweb/tasks.chtml index acc96000..796002d8 100644 --- a/www/kojiweb/tasks.chtml +++ b/www/kojiweb/tasks.chtml @@ -108,11 +108,11 @@ All #if $len($taskPages) > 1 -
+ Page:
@@ -167,11 +167,11 @@ All #if $len($taskPages) > 1 -
+ Page:
diff --git a/www/kojiweb/tasksbyhost.chtml b/www/kojiweb/tasksbyhost.chtml index 5f2979b4..ba367565 100644 --- a/www/kojiweb/tasksbyhost.chtml +++ b/www/kojiweb/tasksbyhost.chtml @@ -23,11 +23,11 @@ #if $len($hostPages) > 1 -
+ Page:
@@ -52,7 +52,7 @@ #for $host in $hosts $host.name - + graph row $host.tasks #end for @@ -64,11 +64,11 @@ #if $len($hostPages) > 1 -
+ Page:
diff --git a/www/kojiweb/tasksbyuser.chtml b/www/kojiweb/tasksbyuser.chtml index 6c29ced5..1fe2704a 100644 --- a/www/kojiweb/tasksbyuser.chtml +++ b/www/kojiweb/tasksbyuser.chtml @@ -7,11 +7,11 @@ #if $len($userPages) > 1 -
+ Page:
@@ -36,7 +36,7 @@ #for $user in $users $user.name - + graph row $user.tasks #end for @@ -48,11 +48,11 @@ #if $len($userPages) > 1 -
+ Page:
diff --git a/www/kojiweb/userinfo.chtml b/www/kojiweb/userinfo.chtml index 42f40099..b5d980c5 100644 --- a/www/kojiweb/userinfo.chtml +++ b/www/kojiweb/userinfo.chtml @@ -22,11 +22,11 @@ #if $len($packagePages) > 1 -
+ Page:
@@ -66,11 +66,11 @@ #if $len($buildPages) > 1 -
+ Page:
diff --git a/www/kojiweb/users.chtml b/www/kojiweb/users.chtml index befd8be6..20dc2070 100644 --- a/www/kojiweb/users.chtml +++ b/www/kojiweb/users.chtml @@ -24,11 +24,11 @@ #if $len($userPages) > 1 -
+ Page:
@@ -69,11 +69,11 @@ #if $len($userPages) > 1 -
+ Page:
diff --git a/www/lib/kojiweb/util.py b/www/lib/kojiweb/util.py index 67a99233..451573bc 100644 --- a/www/lib/kojiweb/util.py +++ b/www/lib/kojiweb/util.py @@ -43,9 +43,9 @@ def sortImage(template, sortKey, orderVar='order'): """ orderVal = template.getVar(orderVar) if orderVal == sortKey: - return '' + return 'ascending sort' elif orderVal == '-' + sortKey: - return '' + return 'descending sort' else: return '' diff --git a/www/static/koji.css b/www/static/koji.css index 122f81f9..f9b97c0f 100644 --- a/www/static/koji.css +++ b/www/static/koji.css @@ -126,16 +126,16 @@ p#footer a { border-color: #ddd; } -body#summary #mainNav li#summary a, -body#tasks #mainNav li#tasks a, -body#tags #mainNav li#tags a, -body#builds #mainNav li#builds a, -body#packages #mainNav li#packages a, -body#users #mainNav li#users a, -body#hosts #mainNav li#hosts a, -body#buildtargets #mainNav li#buildtargets a, -body#reports #mainNav li#reports a, -body#search #mainNav li#search a { +body#summary #mainNav li#summaryTab a, +body#tasks #mainNav li#tasksTab a, +body#tags #mainNav li#tagsTab a, +body#builds #mainNav li#buildsTab a, +body#packages #mainNav li#packagesTab a, +body#users #mainNav li#usersTab a, +body#hosts #mainNav li#hostsTab a, +body#buildtargets #mainNav li#buildtargetsTab a, +body#reports #mainNav li#reportsTab a, +body#search #mainNav li#searchTab a { background-color: #eee; color: #000; } @@ -325,11 +325,13 @@ tr.list-header th { } tr.list-header th:first-child { - -moz-border-radius-topleft: 15px; + -moz-border-radius-topleft: 1em; + -webkit-border-top-left-radius: 1em; } tr.list-header th:last-child { - -moz-border-radius-topright: 15px; + -moz-border-radius-topright: 1em; + -webkit-border-top-right-radius: 1em; } tr.row-odd {