Exemple #1
0
def show(news_id, local_id):
    comment = NewsComment.get(newsitem=parse_news_id(news_id),
                              local_id=local_id)
    if not comment or (comment.deleted and not current_user.is_staff):
        abort(404)

    return common_comment.show('newsitem', comment)
Exemple #2
0
def vote(news_id, local_id):
    comment = NewsComment.get(newsitem=parse_news_id(news_id),
                              local_id=local_id,
                              deleted=False)
    if not comment:
        abort(404)

    return common_comment.vote('newsitem', comment)
def edit(news_id, local_id):
    comment = NewsComment.get(newsitem=parse_news_id(news_id), local_id=local_id, deleted=False)
    if not comment:
        abort(404)

    return common_comment.edit(
        'newsitem',
        comment,
        template='news/comment_work.html',
    )
def restore(news_id, local_id):
    comment = NewsComment.get(newsitem=parse_news_id(news_id), local_id=local_id, deleted=True)
    if not comment:
        abort(404)

    return common_comment.restore(
        'newsitem',
        comment,
        template='news/comment_restore.html',
        template_ajax='news/comment_restore_ajax.html',
        template_ajax_modal=True,
    )
Exemple #5
0
def edit(news_id, local_id):
    comment = NewsComment.get(newsitem=parse_news_id(news_id),
                              local_id=local_id,
                              deleted=False)
    if not comment:
        abort(404)

    return common_comment.edit(
        'newsitem',
        comment,
        template='news/comment_work.html',
    )
Exemple #6
0
def restore(news_id, local_id):
    comment = NewsComment.get(newsitem=parse_news_id(news_id),
                              local_id=local_id,
                              deleted=True)
    if not comment:
        abort(404)

    return common_comment.restore(
        'newsitem',
        comment,
        template='news/comment_restore.html',
        template_ajax='news/comment_restore_ajax.html',
        template_ajax_modal=True,
    )
Exemple #7
0
def abuse_newscomment(news_id, local_id):
    return abuse_common('newscomment', NewsComment.get(newsitem=parse_news_id(news_id), local_id=local_id, deleted=False))
Exemple #8
0
def abuse_newscomment(news_id, local_id):
    return abuse_common(
        'newscomment',
        NewsComment.get(newsitem=parse_news_id(news_id),
                        local_id=local_id,
                        deleted=False))
def vote(news_id, local_id):
    comment = NewsComment.get(newsitem=parse_news_id(news_id), local_id=local_id, deleted=False)
    if not comment:
        abort(404)

    return common_comment.vote('newsitem', comment)
def show(news_id, local_id):
    comment = NewsComment.get(newsitem=parse_news_id(news_id), local_id=local_id)
    if not comment or (comment.deleted and not current_user.is_staff):
        abort(404)

    return common_comment.show('newsitem', comment)