def applicant_address(request):
    result, hform, cform = handle_address_form(request)
    if result:
        return HttpResponseRedirect(reverse('apply-edu'))

    form_step_info = build_form_step_info(1,request.applicant)
    return render_to_response('application/address.html', 
                              { 'home_address_form': hform,
                                'contact_address_form': cform,
                                'form_step_info': form_step_info })
Exemple #2
0
def applicant_address(request):
    result, hform, cform = handle_address_form(request)
    if result:
        return HttpResponseRedirect(reverse('apply-edu'))

    form_step_info = build_form_step_info(1, request.applicant)
    return render_to_response(
        'application/address.html', {
            'home_address_form': hform,
            'contact_address_form': cform,
            'form_step_info': form_step_info
        })
def address_form(request, applicant_id):
    applicant = get_object_or_404(Applicant,pk=applicant_id)
    if applicant.is_submitted:
        return HttpResponseForbidden()
    result, hform, cform = handle_address_form(request, applicant)
    if result:
        return HttpResponseRedirect(reverse('manual-edu',
                                            args=[applicant.id]))

    return render_to_response('manual/address.html', 
                              { 'applicant': applicant,
                                'home_address_form': hform,
                                'contact_address_form': cform,
                                'show_navigation': True })
Exemple #4
0
def update_address(request):
    applicant = request.applicant
    if not applicant.has_address():
        return HttpResponseForbidden()

    result, hform, cform = handle_address_form(request)
    if result:
        request.session['notice'] = 'การแก้ไขที่อยู่เรียบร้อย'
        return HttpResponseRedirect(reverse('status-index'))
    elif 'cancel' in request.POST:
        request.session['notice'] = 'ข้อมูลที่อยู่ไม่ถูกแก้ไข'
        return HttpResponseRedirect(reverse('status-index'))

    return render_to_response('application/update/address.html', 
                              { 'home_address_form': hform,
                                'contact_address_form': cform,
                                'can_log_out': True,
                                'applicant': applicant })
Exemple #5
0
def update_address(request):
    applicant = request.applicant
    if not applicant.has_address():
        return HttpResponseForbidden()

    result, hform, cform = handle_address_form(request)
    if result:
        request.session['notice'] = 'การแก้ไขที่อยู่เรียบร้อย'
        return HttpResponseRedirect(reverse('status-index'))
    elif 'cancel' in request.POST:
        request.session['notice'] = 'ข้อมูลที่อยู่ไม่ถูกแก้ไข'
        return HttpResponseRedirect(reverse('status-index'))

    return render_to_response(
        'application/update/address.html', {
            'home_address_form': hform,
            'contact_address_form': cform,
            'can_log_out': True,
            'applicant': applicant
        })