# HG changeset patch # User Brian Neal # Date 1303779878 0 # Node ID c8148cf11a79ef0f2d473e3f8156e630e9ff594d # Parent 76ba9478ebbd5c434e8910632926afdcde55e360 Show number of posts in a topic when displaying forum topic search results. Fixing #212. diff -r 76ba9478ebbd -r c8148cf11a79 gpp/forums/models.py --- a/gpp/forums/models.py Tue Apr 26 00:16:35 2011 +0000 +++ b/gpp/forums/models.py Tue Apr 26 01:04:38 2011 +0000 @@ -260,7 +260,12 @@ self.last_post = None def search_title(self): - return u"%s by %s" % (self.name, self.user.username) + if self.post_count == 1: + post_text = "(1 post)" + else: + post_text = "(%d posts)" % self.post_count + + return u"%s by %s; %s" % (self.name, self.user.username, post_text) def search_summary(self): return u''