Exemple #1
0
def reject_job(request):
    obj = AdvertisementAdminView(job_id=request.POST['job_id'])
    obj.reject_job()
    notify = Notification(
            title = obj.get_title(),
            type = 2,
            status = 2,
            status_read=0,
            user_id = int(obj.who_created())

        ).save()
    return HttpResponse(json.dumps({'status':True}))
Exemple #2
0
def enable_job(request):
    # query = Advertisement.objects.filter(job_id=request.POST['job_id'])[0]
    # print query
    obj = AdvertisementAdminView(job_id=request.POST['job_id'])
    obj.enable_job()
    notify = Notification(
            title = obj.get_title(),
            type = 2,
            status = 1,
            status_read=0,
            user_id = int(obj.who_created())

        ).save()

    return HttpResponse(json.dumps({'status':True}))
Exemple #3
0
def edit_job_advertisement(request):

    obj = AdvertisementAdminView(job_id=request.POST['job_id'])
    data = obj.get_job_preview()
    form = company_forms.JobAdvertisementForm(initial={
        'job_title': data.job_title,
        'job_position':data.job_position,
        'job_description':data.job_description,
        'employment':data.employment_id,
        'experience':data.experience_id,
        'category':data.category_id,
        'country':data.country_id,
        'cities':data.cities_id,
        'salary_from':data.salary_from,
        'salary_to':data.salary_to,
        'education':data.degree_level_id,
    })
    html = render_to_string('advertisement_dynamic_edit.html', {'job': form, 'job_value': request.POST['job_id']},
                            context_instance=RequestContext(request))
    return HttpResponse(html)
Exemple #4
0
def edit_job_details(request):
    parameters = parse_qs(request.POST['form_val'])
    resp = {}
    obj = AdvertisementAdminView()
    data = obj.update_job_details(parameters, request.POST['description'], request.POST['job_id'])
    return HttpResponse(json.dumps({'status':True}))
Exemple #5
0
def list_all_advertisement(request):
    obj = AdvertisementAdminView()
    data = obj.get_all_jobs()
    return render(request, 'advertisement_admin.html', {'jobs': data})