Exemplo n.º 1
0
def create_job():
    form = JobForm()
    if form.validate_on_submit():
        form.create_job(current_user)
        flash('工作创建成功', 'success')
        return redirect(url_for('company.create_job'))
    return render_template('company/create_job.html', form=form)
Exemplo n.º 2
0
def add_job():
    form = JobForm()
    del form.company_name
    if form.validate_on_submit():
        form.create_job(User.query.filter_by(id=current_user.id).first().company.id)
        return redirect(url_for('job.admin'))
    return render_template('job/add_job.html', form=form)
Exemplo n.º 3
0
def add_job():
    form = JobForm()
    if form.validate_on_submit():
        form.create_job(current_user)
        flash('职位发布成功!', 'success')
        return redirect(url_for('admin.jobs'))
    return render_template('admin/job_add.html', form=form)
Exemplo n.º 4
0
def job_edit():
    job_id = request.args.get('job_id')
    try:
        job_id = int(job_id)
    except TypeError:
        pass
    if job_id:
        job = Job.query.get_or_404(job_id)
        form = JobForm(obj=job)
        if form.validate_on_submit():
            form.populate_obj(job)
            form.create_job(job)
            flash('修改成功', 'success')
            return redirect(url_for('company.job'))
    else:
        job = Job()
        form = JobForm()
    if form.validate_on_submit():
        # 增加缺少的数据
        job_id = Company.query.filter_by(user_id=current_user.id).id
        job.id = job.job_id
        job.state = 1
        form.populate_obj(job)
        form.create_job(job)
        flash('创建成功', 'success')
    return render_template('company/admin_job_edit.html', form=form)
Exemplo n.º 5
0
def create_job():
    form = JobForm()
    form.update_companylist()
    if form.validate_on_submit():
        form.create_job()
        flash('Job create success', 'success')
        return redirect(url_for('admin.joblist'))
    return render_template('admin/create_job.html', form=form)
Exemplo n.º 6
0
def admin_publish_job(company_id):
    if current_user.id != company_id:
        abort(404)
    form = JobForm()
    if form.validate_on_submit():
        form.create_job(current_user)
        flash('职位创建成功', 'success')
        return redirect(url_for('company.admin_index', company_id=current_user.id))
    return render_template('company/publish_job.html', form=form, company_id=company_id)
Exemplo n.º 7
0
def job_create(company_id):
    form = JobForm()
    if form.validate_on_submit():
        form.create_job(company_id)
        flash('职位创建成功', 'success')
        return redirect(url_for('company.manage_job', company_id=company_id))
    return render_template('company/job_create.html',
                           form=form,
                           company_id=company_id)
Exemplo n.º 8
0
def admin_publish_job(company_id):
    if current_user.id != company_id:
        abort(404)
    form = JobForm()
    if form.validate_on_submit():
        form.create_job(current_user)
        flash('职位创建成功', 'success')
        return redirect(url_for('company.admin_index', company_id=current_user.id))
    return render_template('company/publish_job.html', form=form, company_id=company_id)
Exemplo n.º 9
0
def job_add():
    if current_user.role != 20:
        abort(404)
    form = JobForm()
    if form.validate_on_submit():
        form.create_job(current_user)
        flash('职位发布成功!', 'success')
        return redirect(url_for('company.company_admin'))
    return render_template('company/job_add.html', form=form)
Exemplo n.º 10
0
def admin_add_job(company_id):
    if current_user.id != company_id:
        abort(404)
    form = JobForm()
    form.name.label=u'职位名称'
    if form.validate_on_submit():
        form.create_job(current_user)
        flash('职位增加成功','success')
        return redirect(url_for('company.admin_index',company_id=current_user.id))
    return render_template('company/add_job.html',form=form,company_id=company_id)
Exemplo n.º 11
0
def admin_addjob(company_id):
    company = Company.query.get_or_404(company_id)
    form = JobForm()
    if form.validate_on_submit():
        form.create_job(company)
        flash('职位发布成功!', 'success')
        return redirect(url_for('.admin_index', company_id=company.id))
    return render_template('company/admin_addjob.html',
                           form=form,
                           company=company)
Exemplo n.º 12
0
def create_job():
    company_id = current_user.company.id
    form = JobForm()
    form.update_companylist()
    form.company_id.data = company_id
    if form.validate_on_submit():
        form.create_job()
        flash('Job create success', 'success')
        return redirect(url_for('company.admin_jobs'))
    return render_template('company/admin/add_job.html', form=form)
Exemplo n.º 13
0
def publish_job():
    """
    发布职位
    """
    company = Company.query.filter(Company.user == current_user).first()
    form = JobForm()
    if form.validate_on_submit():
        form.create_job(company)
        flash("职位创建成功", "success")
        return redirect(url_for("company.manage_job"))
    return render_template("company/publish_job.html",
                           form=form,
                           company_id=company.id)
Exemplo n.º 14
0
def new():
    form = JobForm()
    if form.validate_on_submit():
        form.create_job()
        return redirect(url_for('job.admin'))
    return render_template('job/create_job.html', form=form)