hackish tagcloud item count fix

git-svn-id: http://yolanda.mister-muffin.de/svn@417 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
josch 2008-12-14 10:13:58 +00:00
parent 513e106e74
commit a3414aef2c
2 changed files with 9 additions and 4 deletions

View file

@ -8,8 +8,13 @@ class IndexController(BaseController):
def index(self): def index(self):
raise(RuntimeError) tags = {}
c.tagcloud = model.DC_Subject.query.all() 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') return render('/xhtml/index.mako')

View file

@ -81,10 +81,10 @@ method="post">
<h1>Tagcloud</h1> <h1>Tagcloud</h1>
<ul> <ul>
% for tag in c.tagcloud: % for name, count in c.tagcloud.items():
<li> <li>
<a href="" class="tag4">${tag.name}</a> <a href="" class="tag4">${name} ${count}</a>
</li> </li>
% endfor % endfor