mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-27 15:58:06 -05:00
Add tab to listing chooser for multi explore subreddit.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user