Exemplo n.º 1
0
def post_modify(request, board_url, post_id):
    try:
        board_post = BoardPost.objects.filter(id=post_id)[0]
        if request.user.userprofile != board_post.author:
            return
    except:
        return
    if request.method == 'POST':
        post_id = _write_post(request, 'Post', modify=True)
        if post_id:
            querystring = _get_querystring(request)
            return redirect('../' + querystring)
        return redirect('../')
    post = _get_content(request, post_id)[0]
    post['new'] = False
    current_board = _get_current_board(request, board_url)
    board_list = _get_board_list()
    # official=request.user.userprofile.is_official
    categories = BoardCategory.objects.all()
    return render(
        request, 'board/board_write.html', {
            "post": post,
            "board_list": board_list,
            "current_board": current_board,
            "Categories": categories
        })
Exemplo n.º 2
0
def post_write(request, board_url):
    post = {}
    post['new'] = True
    if request.method == 'POST':
        post_id = _write_post(request, 'Post')
        if post_id:
            #  board_id = BoardPost.objects.filter(id=post_id)[0].board.id
            return redirect('../' + str(post_id))
        else:
            return redirect('../')
    current_board = _get_current_board(request, board_url)
    # official=request.user.userprofile.is_official
    board_list = _get_board_list()
    categories = BoardCategory.objects.all()
    return render(request,
                  'board/board_write.html',
                  {"post": post, "board_list": board_list,
                   "current_board": current_board,
                   "Categories": categories})
Exemplo n.º 3
0
def post_write(request, board_url):
    post = {}
    post['new'] = True
    if request.method == 'POST':
        post_id = _write_post(request, 'Post')
        if post_id:
            #  board_id = BoardPost.objects.filter(id=post_id)[0].board.id
            return redirect('../' + str(post_id))
        else:
            return redirect('../')
    current_board = _get_current_board(request, board_url)
    # official=request.user.userprofile.is_official
    board_list = _get_board_list()
    categories = BoardCategory.objects.all()
    return render(
        request, 'board/board_write.html', {
            "post": post,
            "board_list": board_list,
            "current_board": current_board,
            "Categories": categories
        })
Exemplo n.º 4
0
def post_modify(request, board_url, post_id):
    try:
        board_post = BoardPost.objects.filter(id=post_id)[0]
        if request.user.userprofile != board_post.author:
            return
    except:
        return
    if request.method == 'POST':
        post_id = _write_post(request, 'Post', modify=True)
        if post_id:
            querystring = _get_querystring(request)
            return redirect('../'+querystring)
        return redirect('../')
    post = _get_content(request, post_id)[0]
    post['new'] = False
    current_board = _get_current_board(request, board_url)
    board_list = _get_board_list()
    # official=request.user.userprofile.is_official
    categories = BoardCategory.objects.all()
    return render(request,
                  'board/board_write.html',
                  {"post": post, "board_list": board_list,
                   "current_board": current_board,
                   "Categories": categories})
Exemplo n.º 5
0
def comment_write(request, post_id_check):
    if request.method == 'POST':
        post_id = _write_post(request, 'Comment', post_id_check)
    querystring = _get_querystring(request)
    return redirect('../' + querystring)
Exemplo n.º 6
0
def re_comment_write(request):
    if request.method == 'POST':
        post_id = _write_post(request, 'Re-Comment')
    querystring = _get_querystring(request)
    return redirect('../' + querystring)
Exemplo n.º 7
0
def comment_write(request, post_id_check):
    if request.method == 'POST':
        post_id = _write_post(request, 'Comment', post_id_check)
    querystring = _get_querystring(request)
    return redirect('../'+querystring)
Exemplo n.º 8
0
def re_comment_write(request):
    if request.method == 'POST':
        post_id = _write_post(request, 'Re-Comment')
    querystring = _get_querystring(request)
    return redirect('../'+querystring)