Add a custom template filter for formatting displaying lists of items in emails.

We do this operation several times in the digest e-mails.

(imported from commit 7b906bad582c628d4461637dc7af374df349e09a)
This commit is contained in:
Jessica McKellar
2013-10-25 12:54:03 -04:00
parent 62136d0c8e
commit d4b60e9304
2 changed files with 38 additions and 6 deletions

View File

@@ -18,12 +18,6 @@ from zerver.models import UserProfile, UserMessage, Recipient, Stream, \
# 4. Interesting stream traffic, as determined by the longest and most
# diversely comment upon topics.
def and_n_others(things, limit):
# A helper for the commonly appended "and N other(s)" string, with
# the appropriate pluralization.
return " and %d other%s" % (len(things) - limit,
"" if len(things) == limit + 1 else "s")
def gather_hot_conversations(user_profile, stream_messages):
# Gather stream conversations of 2 types:
# 1. long conversations