Added option to hide user profile from robots.

This commit is contained in:
Chris Johnson
2011-06-15 02:16:10 -04:00
committed by Neil Williams
parent 49637884b8
commit 1b030c310d
6 changed files with 22 additions and 0 deletions

View File

@@ -106,6 +106,7 @@ class ListingController(RedditController):
show_sidebar = self.show_sidebar,
nav_menus = self.menus,
title = self.title(),
robots = getattr(self, "robots", None),
**self.render_params).render()
return res
@@ -581,6 +582,9 @@ class UserController(ListingController):
self.render_params = {'user' : vuser}
c.profilepage = True
if vuser.pref_hide_from_robots:
self.robots = 'noindex,nofollow'
return ListingController.GET_listing(self, **env)
@validate(vuser = VExistingUname('username'))

View File

@@ -75,6 +75,7 @@ class PostController(ApiController):
pref_organic = VBoolean('organic'),
pref_newwindow = VBoolean('newwindow'),
pref_public_votes = VBoolean('public_votes'),
pref_hide_from_robots = VBoolean('hide_from_robots'),
pref_hide_ups = VBoolean('hide_ups'),
pref_hide_downs = VBoolean('hide_downs'),
pref_over_18 = VBoolean('over_18'),

View File

@@ -1608,6 +1608,10 @@ msgstr "privacy options"
msgid "make my votes public"
msgstr "make my votes public"
#: r2/templates/prefoptions.html:269
msgid "don't allow search engines to index my user profile"
msgstr "don't allow search engines to index my user profile"
#: r2/templates/prefoptions.html:115
msgid ""
"i am over eighteen years old and willing to view adult content"

View File

@@ -2527,6 +2527,10 @@ msgstr ""
msgid "make my votes public"
msgstr ""
#: r2/templates/prefoptions.html:269
msgid "don't allow search engines to index my user profile"
msgstr ""
#: r2/templates/prefupdate.html:28
msgid "update your email or password"
msgstr ""

View File

@@ -48,6 +48,7 @@ class Account(Thing):
pref_newwindow = False,
pref_clickgadget = 5,
pref_public_votes = False,
pref_hide_from_robots = False,
pref_research = False,
pref_hide_ups = False,
pref_hide_downs = False,

View File

@@ -265,6 +265,14 @@
</a>
)
</span>
<br />
${checkbox(_("don't allow search engines to index my user profile"), "hide_from_robots")}
&#32;
<span class="little gray">
(
<a href="http://www.reddit.com/help/noindex">${_("details")}</a>
)
</span>
</td>
</tr>
%endif