def proofing_requests(request, proofing_task_id=None, typeset_task_id=None, decision=None): if proofing_task_id or typeset_task_id: if proofing_task_id: logic.handle_proof_decision(request, proofing_task_id, decision) if typeset_task_id: logic.handle_typeset_decision(request, typeset_task_id, decision) return redirect(reverse('proofing_requests')) new, active, completed, new_typesetting, active_typesetting, completed_typesetting = logic.get_tasks( request) template = 'proofing/proofing_requests.html' context = { 'new_requests': new, 'active_requests': active, 'completed_requests': completed, 'new_typesetting_requests': new_typesetting, 'active_typesetting_requests': active_typesetting, 'completed_typesetting_requests': completed_typesetting, } return render(request, template, context)
def correction_requests(request): if request.POST: typeset_task_id = request.POST.get('typeset_task_id', None) decision = request.POST.get('decision', None) if typeset_task_id and decision: logic.handle_typeset_decision(request, typeset_task_id, decision) else: messages.add_message( request, messages.WARNING, 'Task ID or Decision missing.' ) return redirect(reverse('proofing_correction_requests')) new, active, completed = logic.get_typesetting_tasks(request) template = 'proofing/correction_requests.html' context = { 'new_typesetting_requests': new, 'active_typesetting_requests': active, 'completed_typesetting_requests': completed, } return render(request, template, context)
def proofing_requests(request, proofing_task_id=None, typeset_task_id=None, decision=None): """ Displays proofing request to proofreaders :param request: HttpRequest object :param proofing_task_id: ProofingTask PK :param typeset_task_id: TypesetTask PK :param decision: string, :return: HttpResponse or HttpRedirect """ if proofing_task_id or typeset_task_id: if proofing_task_id: logic.handle_proof_decision(request, proofing_task_id, decision) if typeset_task_id: logic.handle_typeset_decision(request, typeset_task_id, decision) return redirect(reverse('proofing_requests')) new, active, completed, new_typesetting, active_typesetting, completed_typesetting = logic.get_tasks( request) template = 'proofing/proofing_requests.html' context = { 'new_requests': new, 'active_requests': active, 'completed_requests': completed, 'new_typesetting_requests': new_typesetting, 'active_typesetting_requests': active_typesetting, 'completed_typesetting_requests': completed_typesetting, } return render(request, template, context)