share when not logged in/fix info redirect

This commit is contained in:
Jeremy Edberg
2008-07-22 16:28:52 -07:00
parent 353ad2afd0
commit 440f778bdd
3 changed files with 9 additions and 7 deletions

View File

@@ -68,8 +68,8 @@ class FrontController(RedditController):
new_url = new_url + query_string(request.get)
# redirect should be smarter and handle extentions, etc.
return self.redirect(new_url)
# redirect should be smarter and handle extensions, etc.
return self.redirect(new_url, code=301)
def GET_random(self):
"""The Serendipity button"""

View File

@@ -620,6 +620,10 @@ class VReason(Validator):
fullname = reason[5:]
t = Thing._by_fullname(fullname)
return ('redirect', t.permalink)
elif reason.startswith('share_'):
fullname = reason[6:]
t = Thing._by_fullname(fullname)
return ('redirect', t.permalink)
elif reason.startswith('reply_'):
fullname = reason[6:]
t = Thing._by_fullname(fullname)

View File

@@ -151,6 +151,9 @@
title = "comments on " + thing.title,
newwindow = c.user.pref_newwindow)}
</li>
<li id="share_li_${fullname}">
${parent.simple_button("share", fullname, _("share"), "share")}
</li>
%if c.user_is_loggedin:
<li>
%if thing.saved:
@@ -173,11 +176,6 @@
${parent.delete_or_report_buttons()}
${parent.buttons()}
${self.media_embed()}
%if c.user_is_loggedin:
<li id="share_li_${fullname}">
${parent.simple_button("share", fullname, _("share"), "share")}
</li>
%endif
</%def>