sorting, special case for exactly 11 articles
This commit is contained in:
parent
da246e10dc
commit
d12e511c1b
|
@ -15,13 +15,13 @@ Zusammenfassung der Woche ab ${week_start.strftime("%d.%m.%Y")}
|
|||
:</span></dt>
|
||||
<dd>
|
||||
<% pc=0 %><ul>
|
||||
% for p in u.posts[g][week]:
|
||||
% if pc < 10:
|
||||
% for p in sorted(u.posts[g][week], key = lambda p:p['date']):
|
||||
% if pc < 10 or len(u.posts[g][week]) == 11:
|
||||
<% pc+=1 %><li><a href="${p['url']}">${p['title'] or "[ohne Titel]"}</a></li>
|
||||
%endif
|
||||
% endfor
|
||||
% if len(u.posts[g][week]) > 10:
|
||||
<li>und ${len(u.posts[g][week])-10} weitere Artikel</li>
|
||||
% if len(u.posts[g][week]) > 11:
|
||||
<li>und <a href="${b[2]}">${len(u.posts[g][week])-10} weitere Artikel</a>...</li>
|
||||
% endif
|
||||
</ul>
|
||||
</dd>
|
||||
|
|
Loading…
Reference in a new issue