summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-12-09 09:29:15 -0600
committerDan McGee <dan@archlinux.org>2011-12-09 09:29:15 -0600
commit73cd4adf9ff2b38124501fba1a7d9800e4c1f0d0 (patch)
tree10a0babc56899d5957cb4788a8c2e861ec647910 /public
parent4fa709ea86c8eefac05a848187fc7281edff8fa9 (diff)
Add CSS classes to front page package update objects
This adds the repo name, 'staging', and 'testing' as appropriate to a classes field on the package updates object. This means we don't have to update the CSS stylesheet to include hardcoded names of repositories (e.g., 'kde-unstable'). Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'public')
-rw-r--r--public/utils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/public/utils.py b/public/utils.py
index 30c76ac1..6566b8c4 100644
--- a/public/utils.py
+++ b/public/utils.py
@@ -11,6 +11,13 @@ class RecentUpdate(object):
self.pkgbase = first.pkgbase
self.repo = first.repo
self.version = ''
+ self.classes = set()
+
+ self.classes.add(self.repo.name.lower())
+ if self.repo.testing:
+ self.classes.add('testing')
+ if self.repo.staging:
+ self.classes.add('staging')
packages = sorted(packages, key=attrgetter('arch', 'pkgname'))
# split the packages into two lists. we need to prefer packages