Show number of gildings in private info

This number is only available when viewing self or as an admin.
This commit is contained in:
MelissaCole
2015-05-05 17:42:39 -07:00
parent f05603ad98
commit 33a4173a21
2 changed files with 14 additions and 0 deletions

View File

@@ -2206,6 +2206,14 @@ class ProfileBar(Templated):
msg = msg % dict(creddits=user.gold_creddits)
self.gold_creddit_message = msg
if user.num_gildings > 0 and self.show_private_info:
gildings_msg = ungettext(
"%(gildings)s gilding given out",
"%(gildings)s gildings given out",
user.num_gildings)
gildings_msg = gildings_msg % dict(gildings=user.num_gildings)
self.num_gildings_message = gildings_msg
if not self.viewing_self:
self.goldlink = "/gold?goldtype=gift&recipient=" + user.name
self.giftmsg = _("give reddit gold to %(user)s to show "

View File

@@ -140,6 +140,12 @@
${plain_link(thing.gold_creddit_message, "/gold?goldtype=gift")}
</div>
%endif
%if hasattr(thing, "num_gildings_message"):
<div>
<br>
${thing.num_gildings_message}
</div>
%endif
</div>
%endif