Esempio n. 1
0
def edit(story_id, local_id):
    comment = StoryComment.get(story=story_id, local_id=local_id, deleted=False)
    if not comment:
        abort(404)

    return common_comment.edit(
        'story',
        comment,
        template='story_comment_work.html',
    )
Esempio n. 2
0
def restore(story_id, local_id):
    comment = StoryComment.get(story=story_id, local_id=local_id, deleted=True)
    if not comment:
        abort(404)

    return common_comment.restore(
        'story',
        comment,
        template='story_comment_restore.html',
        template_ajax='includes/ajax/story_comment_restore.html',
        template_ajax_modal=True,
    )
Esempio n. 3
0
def show(story_id, local_id):
    story = Story.get(id=story_id)
    if not story:
        abort(404)

    if not story.bl.has_comments_access(current_user._get_current_object()):
        abort(403)

    comment = StoryComment.get(story=story_id, local_id=local_id)
    if not comment or (comment.deleted and not current_user.is_staff):
        abort(404)

    return common_comment.show('story', comment)
Esempio n. 4
0
def abuse_storycomment(story_id, local_id):
    story = get_story(story_id)  # Здесь проверка доступа
    return abuse_common('storycomment', StoryComment.get(story=story.id, local_id=local_id, deleted=False))
Esempio n. 5
0
def abuse_storycomment(story_id, local_id):
    story = get_story(story_id)  # Здесь проверка доступа
    return abuse_common(
        'storycomment',
        StoryComment.get(story=story.id, local_id=local_id, deleted=False))
Esempio n. 6
0
def vote(story_id, local_id):
    comment = StoryComment.get(story=story_id, local_id=local_id, deleted=False)
    if not comment:
        abort(404)

    return common_comment.vote('story', comment)