Ejemplo n.º 1
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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 4
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)
Ejemplo n.º 5
0
def bookmark_comment(id, comment_id):
    text = env.request.args('text')
    posts.bookmark(id, comment_id, text)
Ejemplo n.º 6
0
def bookmark_post(id):
    text = env.request.args('text')
    posts.bookmark(id, None, text)
Ejemplo n.º 7
0
def bookmark_comment(id, comment_id):
    text = env.request.args('text')
    posts.bookmark(id, comment_id, text)
Ejemplo n.º 8
0
def bookmark_post(id):
    text = env.request.args('text')
    posts.bookmark(id, None, text)