Beispiel #1
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)
Beispiel #2
0
def unbookmark(id):
    comment_id = env.request.args('comment_id')
    posts.unbookmark(id, comment_id)

    return Response(redirect=env.request.referer)
Beispiel #3
0
def unbookmark_comment(id, comment_id):
    posts.unbookmark(id, comment_id)
Beispiel #4
0
def unbookmark_post(id):
    posts.unbookmark(id, None)
Beispiel #5
0
def unbookmark_comment(id, comment_id):
    posts.unbookmark(id, comment_id)
Beispiel #6
0
def unbookmark_post(id):
    posts.unbookmark(id, None)
Beispiel #7
0
def unbookmark(id):
    comment_id = env.request.args('comment_id')
    posts.unbookmark(id, comment_id)

    return Response(redirect=env.request.referer)