From a3414aef2cbcd4399101834d98e6fdfc1218c73a Mon Sep 17 00:00:00 2001 From: josch Date: Sun, 14 Dec 2008 10:13:58 +0000 Subject: [PATCH] hackish tagcloud item count fix git-svn-id: http://yolanda.mister-muffin.de/svn@417 7eef14d0-6ed0-489d-bf55-20463b2d70db --- trunk/yolanda/controllers/index.py | 9 +++++++-- trunk/yolanda/templates/xhtml/base.mako | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/trunk/yolanda/controllers/index.py b/trunk/yolanda/controllers/index.py index 7c8d14a..7c7b216 100644 --- a/trunk/yolanda/controllers/index.py +++ b/trunk/yolanda/controllers/index.py @@ -8,8 +8,13 @@ class IndexController(BaseController): def index(self): - raise(RuntimeError) - c.tagcloud = model.DC_Subject.query.all() + tags = {} + for tag in model.DC_Subject.query.all(): + if tag.name in tags.keys(): + tags[tag.name]+=1 + else: + tags[tag.name] = 1 + c.tagcloud = tags return render('/xhtml/index.mako') diff --git a/trunk/yolanda/templates/xhtml/base.mako b/trunk/yolanda/templates/xhtml/base.mako index ce49969..20e9ff1 100644 --- a/trunk/yolanda/templates/xhtml/base.mako +++ b/trunk/yolanda/templates/xhtml/base.mako @@ -81,10 +81,10 @@ method="post">

Tagcloud