Permalink
Browse files

Add gold perks listing chooser tab.

  • Loading branch information...
1 parent 3d0e197 commit a71bc6626c335fd63f44b8e894b15c8384d63898 @chromakode chromakode committed Sep 3, 2013
View
@@ -610,3 +610,5 @@ goldvertisement_blurbs = "Make reddit better. Try %(reddit_gold)." "This year, g
goldvertisement_has_gold_blurbs = "**“Exquisite!”** \nGrab a drink and join us in [the lounge](/r/lounge)."
# sample multireddits (displayed when a user has no multis)
listing_chooser_sample_multis = /user/reddit/m/hello, /user/reddit/m/world
+# multi of subreddits to share with gold users
+listing_chooser_gold_multi = /user/reddit/m/gold
View
@@ -229,6 +229,9 @@ class Globals(object):
'fastlane_links',
'listing_chooser_sample_multis',
],
+ ConfigValue.str: [
+ 'listing_chooser_gold_multi',
+ ],
ConfigValue.dict(ConfigValue.int, ConfigValue.float): [
'comment_tree_version_weights',
],
View
@@ -4127,6 +4127,11 @@ def __init__(self):
self.add_item("other", _("saved"), path='/user/%s/saved' % c.user.name)
+ gold_multi = g.live_config["listing_chooser_gold_multi"]
+ if c.user_is_loggedin and c.user.gold and gold_multi:
+ self.add_item("other", name=_("gold perks"), path=gold_multi,
+ extra_class="gold-perks")
+
self.show_samples = False
if c.user_is_loggedin:
multis = LabeledMulti.by_owner(c.user)
@@ -4142,13 +4147,15 @@ def __init__(self):
if self.selected_item:
self.selected_item["selected"] = True
- def add_item(self, section, name, path=None, site=None, description=None):
+ def add_item(self, section, name, path=None, site=None, description=None,
+ extra_class=None):
self.sections[section].append({
"name": name,
"description": description,
"path": path or site.user_path,
"site": site,
"selected": False,
+ "extra_class": extra_class,
})
def add_samples(self):
@@ -7438,6 +7438,21 @@ body.with-listing-chooser {
border-left-color: lighten(#369, 25%);
}
}
+
+ &.gold-perks {
+ background: #fdfbf2;
+ a {
+ color: #9a7d2e;
+ }
+
+ &.selected {
+ border-color: lighten(#c4b487, 6%);
+
+ &:before {
+ border-left-color: lighten(#9a7d2e, 15%);
+ }
+ }
+ }
}
@@ -20,13 +20,11 @@
## reddit Inc. All Rights Reserved.
###############################################################################
+<%namespace file="utils.html" import="classes"/>
+
<%def name="section_items(itemlist)">
%for item in itemlist:
- <li
- %if item['selected']:
- class="selected"
- %endif
- >
+ <li ${classes(item['extra_class'], 'selected' if item['selected'] else None)}>
<a href="${item['path']}">
${item['name']}
%if 'description' in item:

0 comments on commit a71bc66

Please sign in to comment.