User Controls

When you edit threads why can't we edit the title aswell?

  1. #1
    Instigator Space Nigga
    IM A DUMBASS AND DONT HAVE TIME TO PROOFREAD
  2. #2
    This is one of life's mysteries.
  3. #3
    Submit a pull
  4. #4
    Lanny Bird of Courage
    You probably should be able to, it just complicates the post editing logic to have to treat OPs as a special case (and I do think that’s how you’d have to do it, separate UI for editing threads and posts seems dumb). As a wise man once said, submit a pull
  5. #5
    from django.http import JsonResponse
    from django.shortcuts import render, get_object_or_404
    from .models import Thread
    from googletrans import Translator

    def serious_thing(request, thread_id):
    if request.method == 'POST' and request.is_ajax():
    thread = get_object_or_404(Thread, pk=thread_id)
    translator = Translator()
    spanish_title = translator.translate(thread.title, src='en', dest='es').text
    english_title = translator.translate(spanish_title, src='es', dest='en').text
    thread.title = english_title
    thread.save()
    response_data = {
    'success': True,
    'message': 'i hatchu',
    'english_title': english_title,
    }
    return JsonResponse(response_data)
    response_data = {
    'success': False,
    'message': 'AJAX request failed.',
    }
    return JsonResponse(response_data)

    def edit_thread_title(request, thread_id):
    thread = get_object_or_404(Thread, pk=thread_id)
    return render(request, 'edit_thread_title.html', {'thread': thread})


  6. #6
    Meikai Heck This Schlong
    summit a pool
  7. #7
    Originally posted by Meikai summit a pool

    k


    .-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-.
    (###############################################################)
    ) .-. (
    ( //()\ N I G G E R S )
    ) OOOOOOOOOOOOOOOOO P O O L C L O S E D (
    ( \()// )
    ) '-' (
    (###############################################################)
    ) (()) ___ - ' ^ ((()))^ - ~ ' : (
    ( (()) /` _\ ` ~_ - ((()))~ ' ^ ` )
    )(()) | / 0|--. ^ ^ ((())) ~ ^ - ~ (
    (),' - / \_|0`/ /.`'._/) ` ,' '- _ ^ _ . )
    )) ^_| /-_~ ^- ~_` - -~ _ ((())) ` - ^(
    () -| | - ~ - ~ - ((())) ^ ~ ~ ` )
    ) ' \ \, ~ - ~ ((())) - _ ` ^ ^ (
    ( ` \_| _ _ - ,' ` ~` - ' - )
    )' ^ - ((())) _ ^ _ ~ ' ~ ` (
    ( ~ ` ((.--'''''--._ - ` _ ^ )
    ) ' _ ^ ~ ' .' '. ` ^ ` . _ (
    ( ~ ' ` / \ : _ -^ )
    ) ~ ` (/ \ ~ . ` (
    ( ` - ^ (; ; . ~ ` ' )
    ) - ^ ((| __..-----..__ | ' - ~ ' (
    ( ` _ ~ ,'|_.:' ':._.:' ':._|- ' _ ^ )
    )' ((())|-`:.___.:'-':.___.:'-| ~ _ `- (
    ( ^ ~ ((()))/` | | `\ ^ _ ` )
    ) _ ^ ((())) |( | | )| ^ ' (
    ( ~ ' ,' \_ (_ _) _/ ` - (()
    )` ~ -((())) ^ : _ _ :^ ^ ~ (((
    ( ' ((())) - ~ \ .'-.-'. / ^ ` - ` ((())
    ) `((())) ' ^ \ `.-.-.' / ~ ~ _ ^ ,'(
    ( ^ ,' ~ ` - '._ ``` _.' ^. ' _ - ((())))
    ) - ((())) .-'''''-.___) `-----' (___.-'''''-. ^ ~ ((()))(
    ( ((())) .` | | | | `. ((())) )
    ) ` ((())).' | \ : : / | `. ,' (
    ( - ,' / ; '-._ _.-' ; \(())) ^_ )
    )((()))_;_ ___ ___ __/ ___ ___```_ ___ __\____ ___ ___;))_ __ (
    ( / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ )
    ) jgs__ / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / (
    ( / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / _ / )
    '-'^'-'^'-'^'-'^'-'^'-'^'-'^'-'^'-'^'-'^'-'^'-'^'-'^'-'^'-'^'-'
  8. #8
    Speedy Parker Black Hole [my absentmindedly lachrymatory gazania]
    Pull a submit it's what the admin does best.
  9. #9
    Lanny Bird of Courage
    Originally posted by WALUIGI TACO STAND IS A REAL GAME
    from django.http import JsonResponse
    from django.shortcuts import render, get_object_or_404
    from .models import Thread
    from googletrans import Translator

    def serious_thing(request, thread_id):
    if request.method == 'POST' and request.is_ajax():
    thread = get_object_or_404(Thread, pk=thread_id)
    translator = Translator()
    spanish_title = translator.translate(thread.title, src='en', dest='es').text
    english_title = translator.translate(spanish_title, src='es', dest='en').text
    thread.title = english_title
    thread.save()
    response_data = {
    'success': True,
    'message': 'i hatchu',
    'english_title': english_title,
    }
    return JsonResponse(response_data)
    response_data = {
    'success': False,
    'message': 'AJAX request failed.',
    }
    return JsonResponse(response_data)

    def edit_thread_title(request, thread_id):
    thread = get_object_or_404(Thread, pk=thread_id)
    return render(request, 'edit_thread_title.html', {'thread': thread})



    Hah, that might be a fun gag. Like a subforum where all the post bodies are translated out of English and back and you never really know what the poster was originally trying to say.
Jump to Top