JSON fixes to restore the iPhone app to normal working order

This commit is contained in:
Christopher Slowe
2009-07-06 19:24:29 -07:00
parent 1851c84010
commit 145bd31bfc
2 changed files with 11 additions and 5 deletions

View File

@@ -26,6 +26,7 @@ from r2 import config
from r2.models import *
from r2.lib.pages import *
from r2.lib.pages.things import wrap_links
from r2.lib.jsontemplates import is_api
from r2.lib.menus import *
from r2.lib.utils import to36, sanitize_url, check_cheating, title_to_url
from r2.lib.utils import query_string, UrlParser, link_from_url, link_duplicates
@@ -179,7 +180,8 @@ class FrontController(RedditController):
displayPane.append(PermalinkMessage(article.make_permalink_slow()))
# insert reply box only for logged in user
if c.user_is_loggedin and article.subreddit_slow.can_comment(c.user):
if c.user_is_loggedin and article.subreddit_slow.can_comment(c.user)\
and not is_api():
#no comment box for permalinks
displayPane.append(UserText(item = article, creating = True,
post_form = 'comment',

View File

@@ -116,7 +116,7 @@ class Reddit(Templated):
if not c.cname:
self.srtopbar = SubredditTopBar()
if c.user_is_loggedin and self.show_sidebar:
if c.user_is_loggedin and self.show_sidebar and not is_api():
self._content = PaneStack([ShareLink(), content])
else:
self._content = content
@@ -450,9 +450,13 @@ class MessagePage(Reddit):
if not kw.has_key('show_sidebar'):
kw['show_sidebar'] = False
Reddit.__init__(self, *a, **kw)
self.replybox = UserText(item = None, creating = True,
post_form = 'comment', display = False,
cloneable = True)
if is_api():
self.replybox = None
else:
self.replybox = UserText(item = None, creating = True,
post_form = 'comment', display = False,
cloneable = True)
def content(self):
return self.content_stack((self.replybox,