From f298a168d41a59159da69fc62a306bdb180b06b9 Mon Sep 17 00:00:00 2001 From: Thomas Renger Date: Sun, 13 Apr 2014 00:18:50 +0200 Subject: [PATCH] limit 10 --- templates/email.txt | 8 +++++++- templates/week.tmpl | 9 +++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/templates/email.txt b/templates/email.txt index 8e555bd..94ed8d8 100644 --- a/templates/email.txt +++ b/templates/email.txt @@ -19,10 +19,16 @@ PUNTED for balance ≥$30: ${", ".join(sorted(punt))} People who posted: % for u in sorted(userlist, key=lambda u:u.name[u.name.rfind(' '):].lower()): % for b in u.goodblogs: + <% pc=0 %> ${u.name} in ${b} (${u.username}): % for p in u.posts[b][week]: - - ${p['url']} + % if pc < 10: + <% pc+=1 %> - ${p['url']} + % endif % endfor + % if len(u.posts[b][week]) > 10: + (and ${len(u.posts[b][week])-10} more) + % endif % endfor % endfor diff --git a/templates/week.tmpl b/templates/week.tmpl index 5f31acc..2b929a0 100644 --- a/templates/week.tmpl +++ b/templates/week.tmpl @@ -14,10 +14,15 @@ Zusammenfassung der Woche ab ${week_start.strftime("%d.%m.%Y")} % endif :
-
% endif