def get(self, boardname, pid): board = None if not boardname.isalpha() \ else mgr.board.get_board(boardname) result = {} if board is None: result['success'] = False result['content'] = u'版面不存在'; return self.write(result) # todo: if userid has read perm post = mgr.post.get_post(pid) if not post: result['success'] = False result['content'] = u'本帖子不存在或者已被删除' return self.write(result) quote = fun_gen_quote(post['owner'], post['content']) content = post['content'] result['success'] = True result['_xsrf'] = self.xsrf_token result['content'] = self.escape.xhtml_escape(quote) self.write(result)
def get(self, boardname, pid): board = None if not boardname.isalpha() \ else mgr.board.get_board(boardname) result = {} if board is None: result['success'] = False result['content'] = u'版面不存在' return self.write(result) # todo: if userid has read perm post = mgr.post.get_post(pid) if not post: result['success'] = False result['content'] = u'本帖子不存在或者已被删除' return self.write(result) quote = fun_gen_quote(post['owner'], post['content']) content = post['content'] result['success'] = True result['_xsrf'] = self.xsrf_token result['content'] = self.escape.xhtml_escape(quote) self.write(result)
def get(self, boardname, pid): board = None if not boardname.isalpha() else mgr.board.get_board(boardname) result = {} if board is None: result["success"] = False result["content"] = u"版面不存在" return self.write(result) # todo: if userid has read perm post = mgr.post.get_post(pid) if not post: result["success"] = False result["content"] = u"本帖子不存在或者已被删除" return self.write(result) quote = fun_gen_quote(post["owner"], post["content"]) content = post["content"] result["success"] = True result["_xsrf"] = self.xsrf_token result["content"] = self.xhtml_escape(quote) self.write(result)
def get(self, replyid): reply = manager.post.get_post(replyid) if reply is None: raise tornado.web.HTTPError(404) if not self.get_current_user(): raise tornado.web.HTTPError(404) content = fun_gen_quote(reply.owner, reply.content) title = reply.title if reply.title.startswith('Re:') \ else 'Re: %s' % reply.title self.srender("reply.html", reply=reply, title=title, content=content)
def get(self, replyid): post = manager.post.get_post(replyid) if post is None: raise tornado.web.HTTPError(404) if not self.get_current_user(): raise tornado.web.HTTPError(404) default = fun_gen_quote(post.owner, post.content) title = post.title if post.title.startswith('Re:') \ else 'Re: %s' % post.title self.srender("replypost.html", post=post, title=title, default=default)
def get(self, mid): userid = self.get_current_user() if not userid: self.login_page() return mail = manager.mail.one_mail(mid) if not mail or mail.touserid != userid: self.write({"success": False, "content": "没有该邮件!"}) return title = mail.title if mail.title.startswith("Re: ") else "Re: %s" % mail.title content = fun_gen_quote(mail.fromuserid, mail.content) self.render("replymail.html", title=title, content=content, mid=mid)
def get(self, mid): userid = self.get_current_user() if not userid: self.login_page() return mail = manager.mail.one_mail(mid) if not mail or mail.touserid != userid: self.write({ "success": False, "content": "没有该邮件!", }) return title = mail.title if mail.title.startswith('Re: ') \ else 'Re: %s' % mail.title content = fun_gen_quote(mail.fromuserid, mail.content) self.render('replymail.html', title=title, content=content, mid=mid)