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:
parent
513e106e74
commit
a3414aef2c
2 changed files with 9 additions and 4 deletions
|
@ -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')
|
||||
|
||||
|
|
|
@ -81,10 +81,10 @@ method="post">
|
|||
<h1>Tagcloud</h1>
|
||||
|
||||
<ul>
|
||||
% for tag in c.tagcloud:
|
||||
% for name, count in c.tagcloud.items():
|
||||
|
||||
<li>
|
||||
<a href="" class="tag4">${tag.name}</a>
|
||||
<a href="" class="tag4">${name} ${count}</a>
|
||||
</li>
|
||||
|
||||
% endfor
|
||||
|
|
Loading…
Reference in a new issue