Include more monetary information in reports.
[iron-blogger] / templates / email.txt
index 106141c9012d2a968a9fdd8cb991120da8a1b101..e82b15fb59e1add6f3110110f7402be769266d85 100644 (file)
@@ -1,26 +1,29 @@
-Subject: IRON BLOGGER results for the week of ${week_start.strftime("%F")}
+Subject: IRON BLOGGER results for the week beginning ${week_start.strftime("%F")}
 To: iron-blogger@mit.edu
 
+SLACKERS: ${", ".join(sorted([u.username for u in lame]))}
+
 People who posted:
-% for u in sorted(good):
-<% posts = report[u][week] %>\
- ${u}:
- % for p in posts:
+% for u in sorted(good, key=lambda u:u.username):
+ ${u.username}:
+ % for p in u.weeks[week]:
  - ${p['url']}
  % endfor
 % endfor
 
-People who failed to post:
-<% cash = 0 %>\
-% for u in sorted(lame):
- ${u}
-% endfor
-
+% if skip:
 People who have not yet started:
-% for u in sorted(skip):
- ${u}
+% for u in sorted(skip,  key=lambda u:u.username):
+ ${u.username}
 % endfor
+% endif
 
 Beer pool:
 This week: $${5 * len(lame)}.00
-Total:     $.00
+Total:     $${pool}.00
+Paid:      $${paid}.00
+
+Individual debts:
+% for (u, v) in sorted(debts, key=lambda p:p[1], reverse=True):
+${"%20s $%d" % (u, v)}
+% endfor

Benjamin Mako Hill || Want to submit a patch?