Add tab to listing chooser for multi explore subreddit.

This commit is contained in:
Max Goodman
2013-09-03 15:54:58 -07:00
parent a71bc6626c
commit 2566f25a26
3 changed files with 13 additions and 1 deletions

View File

@@ -612,3 +612,5 @@ goldvertisement_has_gold_blurbs = "**“Exquisite!”** \nGrab a drink
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
# subreddit showcasing new multireddits
listing_chooser_explore_sr = multis

View File

@@ -231,6 +231,7 @@ class Globals(object):
],
ConfigValue.str: [
'listing_chooser_gold_multi',
'listing_chooser_explore_sr',
],
ConfigValue.dict(ConfigValue.int, ConfigValue.float): [
'comment_tree_version_weights',

View File

@@ -239,7 +239,10 @@ class Reddit(Templated):
show_chooser and
c.render_style == "html" and
c.user_is_loggedin and
isinstance(c.site, (DefaultSR, AllSR, ModSR, LabeledMulti))
(
isinstance(c.site, (DefaultSR, AllSR, ModSR, LabeledMulti)) or
c.site.name == g.live_config["listing_chooser_explore_sr"]
)
)
self.toolbars = self.build_toolbars()
@@ -4138,6 +4141,12 @@ class ListingChooser(Templated):
multis.sort(key=lambda multi: multi.name.lower())
for multi in multis:
self.add_item("multi", multi.name, site=multi)
explore_sr = g.live_config["listing_chooser_explore_sr"]
if explore_sr:
self.add_item("multi", name=_("explore multis"),
site=Subreddit._by_name(explore_sr))
self.show_samples = not multis
if self.show_samples: