Exemplo n.º 1
0
def restore_all_notes(request):
    notes = TrashNote.objects.for_user(request.user)

    if request.method == 'POST':
        Note.untrash_all(notes)
        return redirect('trash:trash')

    # Render
    context = trash_context(request.user)
    context['notes'] = notes
    context['current_note_ids'] = ','.join([str(note.id) for note in notes])
    return render(request, 'restore_all_notes.html', context)
Exemplo n.º 2
0
def restore_all_notes(request):
    notes = TrashNote.objects.for_user(request.user)

    if request.method == 'POST':
        Note.untrash_all(notes)
        return redirect('trash:trash')

    # Render
    context = trash_context(request.user)
    context['notes'] = notes
    context['current_note_ids'] = ','.join([str(note.id) for note in notes])
    return render(request, 'restore_all_notes.html', context)
Exemplo n.º 3
0
def restore_notes(request, note_ids):
    # Validate notes
    note_id_array = note_ids.split(',')
    notes = validate_ownership_notes(request.user, note_id_array)

    if request.method == 'POST':
        Note.untrash_all(notes)
        return redirect('trash:trash')

    # Render
    context = trash_context(request.user)
    context['notes'] = notes
    context['current_note_ids'] = note_ids
    return render(request, 'restore_notes.html', context)
Exemplo n.º 4
0
def restore_notes(request, note_ids):
    # Validate notes
    note_id_array = note_ids.split(',')
    notes = validate_ownership_notes(request.user, note_id_array)

    if request.method == 'POST':
        Note.untrash_all(notes)
        return redirect('trash:trash')

    # Render
    context = trash_context(request.user)
    context['notes'] = notes
    context['current_note_ids'] = note_ids
    return render(request, 'restore_notes.html', context)