sorting, special case for exactly 11 articles

This commit is contained in:
Thomas Renger 2014-04-25 10:51:42 +02:00
parent da246e10dc
commit d12e511c1b
1 changed files with 4 additions and 4 deletions

View File

@ -15,13 +15,13 @@ Zusammenfassung der Woche ab ${week_start.strftime("%d.%m.%Y")}
:</span></dt> :</span></dt>
<dd> <dd>
<% pc=0 %><ul> <% pc=0 %><ul>
% for p in u.posts[g][week]: % for p in sorted(u.posts[g][week], key = lambda p:p['date']):
% if pc < 10: % if pc < 10 or len(u.posts[g][week]) == 11:
<% pc+=1 %><li><a href="${p['url']}">${p['title'] or "[ohne Titel]"}</a></li> <% pc+=1 %><li><a href="${p['url']}">${p['title'] or "[ohne Titel]"}</a></li>
%endif %endif
% endfor % endfor
% if len(u.posts[g][week]) > 10: % if len(u.posts[g][week]) > 11:
<li>und ${len(u.posts[g][week])-10} weitere Artikel</li> <li>und <a href="${b[2]}">${len(u.posts[g][week])-10} weitere Artikel</a>...</li>
% endif % endif
</ul> </ul>
</dd> </dd>