Add /explore variant to next/prev suggestions.

This commit is contained in:
Max Goodman
2014-04-24 18:37:34 -07:00
parent 379fc9f556
commit f7d0587cf8
2 changed files with 10 additions and 3 deletions

View File

@@ -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."""

View File

@@ -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>