From 45ec74636425195a9862e13dba1f88909c86250e Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Tue, 8 Feb 2022 10:50:39 +0100 Subject: [PATCH] Slowly moving the job board to discuss.afpy.org. --- afpy/routes/jobs.py | 35 +--------------- afpy/templates/pages/edit_job.html | 64 ++++++------------------------ 2 files changed, 15 insertions(+), 84 deletions(-) diff --git a/afpy/routes/jobs.py b/afpy/routes/jobs.py index ef2cd71..85eb730 100644 --- a/afpy/routes/jobs.py +++ b/afpy/routes/jobs.py @@ -45,37 +45,6 @@ def jobs_page(current_page: int = 1): ) -@jobs_bp.route("/emplois/new", methods=["GET", "POST"]) +@jobs_bp.route("/emplois/new", methods=["GET"]) def new_job(): - form = JobPostForm() - if form.validate_on_submit(): - title = form.title.data - content = form.content.data - company = form.company.data - location = form.location.data - contact_info = form.contact_info.data - email = form.email.data - phone = form.phone.data - summary = form.summary.data - - new_job = JobPost.create( - title=title, - content=content, - company=company, - location=location, - contact_info=contact_info, - email=email, - phone=phone, - summary=summary, - ) - flash("Merci ! Votre offre d'emploi apparaîtra après validation par un des administrateurs.", "success") - - if form.image.data: - extension = secure_filename(form.image.data.filename).split(".")[-1].lower() - filename = f"emplois.{new_job.id}.{extension}" - filepath = f"{config.IMAGES_PATH}/{filename}" - request.files[form.image.name].save(filepath) - new_job.image_path = filename - new_job.save() - return redirect(url_for("jobs.jobs_page", current_page=1)) - return render_template("pages/edit_job.html", form=form, post=None, body_id="edit-post") + return render_template("pages/edit_job.html") diff --git a/afpy/templates/pages/edit_job.html b/afpy/templates/pages/edit_job.html index a6e2aa3..47a91a8 100644 --- a/afpy/templates/pages/edit_job.html +++ b/afpy/templates/pages/edit_job.html @@ -1,61 +1,23 @@ {% extends '_parts/base.jinja2' %} {% block header %} -

- {% if post %} - Modification d'un job - {% else %} - Création d'un job - {% endif %} -

+

Création d'un job

{% endblock header %} {% block main %} -
-
- {{ form.hidden_tag() }} - {% for field, errors in form.errors.items() %} -
- {{ form[field].label }}: {{ ', '.join(errors) }} -
- {% endfor %} - - - - - - - - - - -
+

Pour plus de visibilité, la job board de l'AFPy bouge ici : https://discuss.afpy.org/c/emplois !

+

+ Pour créer une offre d'emploi là bas, deux solutions :
+

+

+

C'est quoi https://discuss.afpy.org?

+

+ C'est une instance de Discourse, un forum open source qu'on héberge en france chez Gandi. +

{% endblock main %}