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>
|
:</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>
|
||||||
|
|
Loading…
Reference in New Issue