mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Add /explore variant to next/prev suggestions.
This commit is contained in:
@@ -4337,8 +4337,14 @@ class SubredditSelector(Templated):
|
||||
|
||||
class ListingSuggestions(Templated):
|
||||
def __init__(self):
|
||||
Templated.__init__(self)
|
||||
|
||||
self.suggestion_type = None
|
||||
if c.default_sr:
|
||||
if c.user_is_loggedin and random.randint(0, 1) == 1:
|
||||
self.suggestion_type = "explore"
|
||||
return
|
||||
|
||||
multis = c.user_is_loggedin and LabeledMulti.by_owner(c.user)
|
||||
|
||||
if multis and c.site in multis:
|
||||
@@ -4353,8 +4359,6 @@ class ListingSuggestions(Templated):
|
||||
else:
|
||||
self.suggestion_type = "random"
|
||||
|
||||
Templated.__init__(self)
|
||||
|
||||
|
||||
class ExploreItem(Templated):
|
||||
"""For managing recommended content."""
|
||||
|
||||
@@ -25,7 +25,10 @@
|
||||
%if thing.suggestion_type:
|
||||
|
||||
<span class="next-suggestions">
|
||||
%if thing.suggestion_type == 'multis':
|
||||
%if thing.suggestion_type == 'explore':
|
||||
${_('or')}
|
||||
<a href="/explore">${_('explore some new subreddits')}</a>
|
||||
%elif thing.suggestion_type == 'multis':
|
||||
${_('or try a multi:')}
|
||||
%for multi in thing.suggestions:
|
||||
<a href="${multi.path}">/m/${multi.name}</a>
|
||||
|
||||
Reference in New Issue
Block a user