From a15714c7987cc0ecb9df81a9fd5053bdec2ff08c Mon Sep 17 00:00:00 2001 From: Brian Simpson Date: Mon, 8 Aug 2011 13:52:32 -0700 Subject: [PATCH] Show gold recurring subscriptions on user page. --- r2/r2/lib/pages/pages.py | 2 ++ r2/r2/templates/profilebar.html | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py index 9becd8238..5306899d3 100644 --- a/r2/r2/lib/pages/pages.py +++ b/r2/r2/lib/pages/pages.py @@ -1189,6 +1189,8 @@ class ProfileBar(Templated): else: self.gold_remaining = timeuntil(self.gold_expiration, precision=60 * 60 * 24 * 30) # months + if hasattr(user, "gold_subscr_id"): + self.gold_subscr_id = user.gold_subscr_id if user._id != c.user._id: self.goldlink = "/gold?goldtype=gift&recipient=" + user.name self.giftmsg = _("buy %(user)s a month of reddit gold" % diff --git a/r2/r2/templates/profilebar.html b/r2/r2/templates/profilebar.html index e842f6768..ae751ebb3 100644 --- a/r2/r2/templates/profilebar.html +++ b/r2/r2/templates/profilebar.html @@ -109,6 +109,18 @@ ${_("of reddit gold remaining")} + %if getattr(thing, "gold_subscr_id", None): + <% + paypal_link = ("https://www.paypal.com/cgi-bin/webscr?cmd=_subscr-find&alias=%s" % g.goldthanks_email) + %> +
+ + ${_("Recurring Paypal subscription")} + + + ${thing.gold_subscr_id} +
+ %endif %endif