示例#1
0
文件: blog.py 项目: radjah/point-www
def bookmark(id):
    comment_id = env.request.args('comment_id')
    text = env.request.args('text')
    try:
        posts.bookmark(id, comment_id, text)
    except BookmarkExists:
        pass

    return Response(redirect=env.request.referer)
示例#2
0
def bookmark(id):
    comment_id = env.request.args('comment_id')
    text = env.request.args('text')
    try:
        posts.bookmark(id, comment_id, text)
    except BookmarkExists:
        pass

    return Response(redirect=env.request.referer)
示例#3
0
def bookmark(post_id, comment_id=None, text=None):
    try:
        try:
            posts.bookmark(post_id, comment_id, text)
            return xmpp_template('bookmark_sent',
                                  post_id=post_id, comment_id=comment_id)
        except BookmarkExists:
            posts.unbookmark(post_id, comment_id)
            return xmpp_template('bookmark_cancel_sent',
                                  post_id=post_id, comment_id=comment_id)
    except PostNotFound:
        return xmpp_template('post_not_found', post_id=post_id)
    except CommentNotFound:
        return xmpp_template('comment_not_found', post_id=post_id,
                                                  comment_id=comment_id)
    except RecommendationError:
        return xmpp_template('post_bookmark_denied', post_id=post_id)
    except (PostAuthorError, SubscribeError):
        return xmpp_template('post_denied', post_id=post_id)
示例#4
0
文件: posts.py 项目: skobkin/point
def bookmark(post_id, comment_id=None, text=None):
    try:
        try:
            posts.bookmark(post_id, comment_id, text)
            return xmpp_template('bookmark_sent',
                                 post_id=post_id,
                                 comment_id=comment_id)
        except BookmarkExists:
            posts.unbookmark(post_id, comment_id)
            return xmpp_template('bookmark_cancel_sent',
                                 post_id=post_id,
                                 comment_id=comment_id)
    except PostNotFound:
        return xmpp_template('post_not_found', post_id=post_id)
    except CommentNotFound:
        return xmpp_template('comment_not_found',
                             post_id=post_id,
                             comment_id=comment_id)
    except RecommendationError:
        return xmpp_template('post_bookmark_denied', post_id=post_id)
    except (PostAuthorError, SubscribeError):
        return xmpp_template('post_denied', post_id=post_id)
示例#5
0
def bookmark_comment(id, comment_id):
    text = env.request.args('text')
    posts.bookmark(id, comment_id, text)
示例#6
0
def bookmark_post(id):
    text = env.request.args('text')
    posts.bookmark(id, None, text)
示例#7
0
文件: blog.py 项目: skobkin/point
def bookmark_comment(id, comment_id):
    text = env.request.args('text')
    posts.bookmark(id, comment_id, text)
示例#8
0
文件: blog.py 项目: skobkin/point
def bookmark_post(id):
    text = env.request.args('text')
    posts.bookmark(id, None, text)