예제 #1
0
파일: comm_ajax.py 프로젝트: afei263/argon
    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)
예제 #2
0
    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)
예제 #3
0
파일: comm_ajax.py 프로젝트: sysu/argon
    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)
예제 #4
0
 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)
예제 #5
0
파일: post.py 프로젝트: Acidburn0zzz/argon
 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)
예제 #6
0
파일: mail.py 프로젝트: pengzhr/argon
 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)
예제 #7
0
 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)