From 73cd4adf9ff2b38124501fba1a7d9800e4c1f0d0 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 9 Dec 2011 09:29:15 -0600 Subject: 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 --- public/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'public') diff --git a/public/utils.py b/public/utils.py index 30c76ac..6566b8c 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 -- cgit v1.2.3-24-g4f1b