Commit 1449088a authored by Roland Denis's avatar Roland Denis
Browse files

Job offer: adding employer field and filtering by job type.

The filtering is done using tags. Also adding default template for tag
page.
parent 8f36b3a2
Pipeline #3386 passed with stage
in 4 seconds
......@@ -30,6 +30,9 @@ FOR DEVELOPERS:
6) include this property in the id calculation (_calc_id method of JobOffer).
7) update job offer template and add corresponding line when launching
the rendering (_render method of JobOffer).
8) add corresponding line in the interface processors
(process_cmdline and process_cgi so far).
9) add a corresponding line in the job offer template job_offer.md.template
# How has SimpleMDE editor been customized ?
1) Firstly, please consider using another editor since it seems to be
......@@ -112,6 +115,7 @@ class FormData(object):
title='',
description='',
author='',
employer='',
email='',
job_type='',
location='',
......@@ -123,6 +127,7 @@ class FormData(object):
self.title = title.strip()
self.description = description.strip()
self.author = author.strip()
self.employer = employer.strip()
self.email = email.strip()
self.job_type = job_type
self.location = location.strip()
......@@ -152,6 +157,10 @@ class FormData(object):
if not self.author:
errors.author = 'Nom manquant'
# Employer must be set
if not self.employer:
errors.employer = 'Employeur manquant'
# Description must be set
if not self.description:
errors.description = 'Description manquante'
......@@ -191,6 +200,7 @@ class FormError(object):
title='',
description='',
author='',
employer='',
email='',
job_type='',
attachment=''):
......@@ -198,6 +208,7 @@ class FormError(object):
self.title = title
self.description = description
self.author = author
self.employer = employer
self.email = email
self.job_type = job_type
self.attachment = attachment
......@@ -208,6 +219,7 @@ class FormError(object):
self.title
or self.description
or self.author
or self.employer
or self.email
or self.job_type
or self.attachment
......@@ -253,6 +265,7 @@ class JobOffer(object):
self.title = form_data.title
self.description = form_data.description
self.author = form_data.author
self.employer = form_data.employer
self.email = form_data.email
self.job_type = form_data.job_type
self.attachment_user_name = form_data.attachment_name
......@@ -342,7 +355,7 @@ class JobOffer(object):
# Feeding the hash algo with the job_offer fields
m.update(b'|'.join(str(getattr(self, field)).encode() for field in
('title', 'job_type', 'author', 'date', 'description', 'email', 'attachment_user_name', 'location', 'duration', 'website')
('title', 'job_type', 'author', 'employer', 'date', 'description', 'email', 'attachment_user_name', 'location', 'duration', 'website')
))
# Feeding the hash algo with the job_offer attachment
......@@ -381,7 +394,9 @@ class JobOffer(object):
attachment_name=self.attachment_name,
description=self.description,
job_type=JOBOFFER_TYPE[self.job_type],
tag=self.job_type,
author=self.author,
employer=self.employer,
email=self.email,
location=self.location,
duration=self.duration,
......@@ -642,6 +657,11 @@ def process_cmdline():
default='',
help='Offer author name'
)
form_parser.add_argument(
'--employer',
default='',
help='Employer'
)
form_parser.add_argument(
'--email',
default='',
......@@ -696,6 +716,7 @@ def process_cmdline():
job_type=args.type,
title=args.title,
author=args.author,
employer=args.employer,
email=args.email,
location=args.location,
duration=args.duration,
......@@ -728,6 +749,9 @@ def process_cgi():
if 'author' in cgi_form:
form_data.author = cgi_form['author'].value
if 'employer' in cgi_form:
form_data.employer = cgi_form['employer'].value
if 'email' in cgi_form:
form_data.email = cgi_form['email'].value
......
......@@ -5,6 +5,7 @@ Category: Offres d'emploi
Authors: Nextflow Software
Email: emploi@nextflow-software.com
Job_Type: CDD
Tags: cdd
Template: job_offer
Job_Location: Nantes
Job_Duration: 6 mois
......
......@@ -5,6 +5,7 @@ Category: Offres d'emploi
Authors: John Doe [test](http://calcul.math.cnrs.fr)
Email: toto@toto.fr
Job_Type: CDI
Tags: cdi
Template: job_offer
Job_Location: Lyon
Job_Duration: 2 ans
......@@ -464,4 +465,4 @@ Referencing a bug by #bugID in your git commit links it to the slip. For example
---
License: [CC-BY](https://creativecommons.org/licenses/by/3.0/)
\ No newline at end of file
License: [CC-BY](https://creativecommons.org/licenses/by/3.0/)
......@@ -5,6 +5,7 @@ Category: Offres d'emploi
Authors: Christophe DENIS
Email: Christophe.Denis@cmla.ens-cachan.fr
Job_Type: Stage
Tags: stage
Template: job_offer
Job_Location: Antony
Job_Duration: 6 mois
......@@ -34,4 +35,4 @@ Etudiant(e) en master 2 ou troisième année d’école d’ingénieur. Compéte
# Modalités pratiques
Le stage rémunéré se déroulera au sein de la société Altair Engineering. La durée du stage est de 6 mois et débutera en mars 2017. L’encadrement académique du stage sera assuré par Christophe Denis (CMLA-ENS Cachan) et Piotr Breitkopf (UTC-Roberval).
Les candidatures (CV et lettre de motivation) à cette offre de stage sont à envoyer par courriel à Christophe Denis ([Christophe.Denis@cmla.ens-cachan.fr](mailto:Christophe.Denis@cmla.ens-cachan.fr)) et à Piotr Breitkopf ([Piotr.Breitkopf@utc.fr](mailto:Piotr.Breitkopf@utc.fr)).
\ No newline at end of file
Les candidatures (CV et lettre de motivation) à cette offre de stage sont à envoyer par courriel à Christophe Denis ([Christophe.Denis@cmla.ens-cachan.fr](mailto:Christophe.Denis@cmla.ens-cachan.fr)) et à Piotr Breitkopf ([Piotr.Breitkopf@utc.fr](mailto:Piotr.Breitkopf@utc.fr)).
......@@ -5,6 +5,7 @@ Category: Offres d'emploi
Authors: Yves Le Guennec
Email:
Job_Type: Thèse
Tags: these
Template: job_offer
Job_Location: École Centrale Nantes / IRT Jules Verne
Job_Duration: 3 ans
......
......@@ -5,6 +5,7 @@ Category: Offres d'emploi
Authors: John Doe
Email:
Job_Type: Post-doctorat
Tags: postdoc
Template: job_offer
Job_Location: Lyon
Job_Duration:
......
......@@ -5,6 +5,7 @@ Category: Offres d'emploi
Authors: Roland
Email: denis@math.univ-lyon1.fr
Job_Type: Thèse
Tags: these
Template: job_offer
Job_Location: Lyon
Job_Duration: 3 ans
......@@ -17,4 +18,4 @@ Petit test de présentation
c'est une thèse quoi...
# Compétences requises
bosser
\ No newline at end of file
bosser
......@@ -5,6 +5,7 @@ Category: Offres d'emploi
Authors: Mat
Email: mat@plop.fr
Job_Type: CDD
Tags: cdd
Template: job_offer
Job_Location: Trifouillis les oies
Job_Duration: 2 jours
......
......@@ -5,10 +5,12 @@ Category: Offres d'emploi
Authors: {{author|e|linebreaks(', ')}}
Email: {{email|e|linebreaks(', ')}}
Job_Type: {{job_type|e}}
Tags: {{tag|e}}
Template: job_offer
Job_Location: {{location|e|linebreaks(', ')}}
Job_Duration: {{duration|e|linebreaks(', ')}}
Job_Website: {{website|e|linebreaks(', ')}}
Job_Employer: {{employer|e|linebreaks(', ')}}
Attachment: {{attachment_name|e|linebreaks(', ')}}
{{description|e|pelican}}
......@@ -118,3 +118,13 @@ HIGHLIGHT_SETTINGS = {
'article': 'next', # 'next' (next event), 'date' (last added), or its slug.
}
SUMMARY_MAX_LENGTH = 50
# Job offer tags (tag to name)
# If you add a tag here, you should also update the content/job_offers/add_job_offer.py script.
JOB_OFFER_TAGS = {
'cdi': 'CDI',
'cdd': 'CDD',
'postdoc': 'Post-doc',
'these': 'Thèse',
'stage': 'Stage',
}
......@@ -11,10 +11,10 @@
{% endif %}
{% block header_content %}
{{ category_template.header_content() }}
{{ category_template.header_content(category) }}
{% endblock header_content %}
{% block content %}
{{ category_template.content() }}
{{ category_template.content(articles) }}
{% endblock content %}
{% macro header_content() %}
{% macro header_content(category) %}
<div class="col mt-5">
<div class="container">
<a href="{{SITEURL}}/{{category.save_as}}" class="btn btn-dark mb-2 p-2" id="header-btn">
<div class="row m-0 d-flex align-items-center">
<div id="circle-{{category.slug}}"></div>
<span class="category text-uppercase pl-2">{{CIRCLES[category.slug]}}</span>
</div>
</a>
</div>
<h1 class="my-3">{{ category }}</h1>
<div class="container text-center py-1">
<div class="row d-flex justify-content-center">
<div class="col-md-2 px-0">
<span>CDI</span>
</div>
<div class="col-md-2 px-0">
<span>CDD</span>
</div>
<div class="col-md-3 px-0">
<span>Thèse</span>
</div>
<div class="col-md-3 px-0">
<span>Post-doc</span>
</div>
<div class="col-md-3 px-0">
<span>Stage</span>
</div>
<a href="{{SITEURL}}/{{category.save_as}}" class="btn btn-dark mb-2 p-2" id="header-btn">
<div class="row m-0 d-flex align-items-center">
<div id="circle-{{category.slug}}"></div>
<span class="category text-uppercase pl-2">{{CIRCLES[category.slug]}}</span>
</div>
</a>
</div>
<h1 class="my-3">{{ category }}</h1>
<div class="container text-center py-1">
<div class="row d-flex justify-content-center">
{% for tag, articles in tags | sort %}
{% if tag in JOB_OFFER_TAGS %}
<div class="col-md-3 px-0">
<a href="{{SITEURL}}/tag/{{tag}}.html">{{JOB_OFFER_TAGS[tag]}}</a>
</div>
{% endif %}
{% endfor %}
</div>
<div class="container text-center link">
<div class="row d-flex justify-content-center">
<a href="{{ SITEURL }}/job_offers/add_job_offer" style="display: block;" class="col-md-8">
<img style="width:22px" src="{{ SITEURL }}/theme/img/ancre.png"/>
<span>AJOUTER UNE OFFRE</span>
</a>
</div>
</div>
<div class="container text-center link">
<div class="row d-flex justify-content-center">
<a href="{{ SITEURL }}/job_offers/add_job_offer" style="display: block;" class="col-md-8">
<img style="width:22px" src="{{ SITEURL }}/theme/img/ancre.png"/>
<span>AJOUTER UNE OFFRE</span>
</a>
</div>
</div>
</div>
{% endmacro %}
{% macro content() %}
{% macro content(articles) %}
<div class="container-fluid event">
<div class="row d-flex justify-content-center mx-xl-5 mx-lg-3" id="event" style="margin-top: 22px;">
{% import 'cards.html' as cards with context %}
......
{% macro header_content() %}
{% macro header_content(category) %}
<div class="col mt-5">
<h1 class="mt-3 mb-2">Nos formations</h1>
<p class="font-weight-light text-center pt-4">Le groupe Calcul propose des formations sur différentes thématiques tout au long de l'année.</p>
</div>
{% endmacro %}
{% macro content() %}
{% macro content(articles) %}
<div class="container-fluid event">
<div class="row d-flex justify-content-center mx-xl-5 mx-lg-3" id="event" style="margin-top: 22px;">
{% import 'cards.html' as cards with context %}
......
{% macro header_content() %}
{% macro header_content(category) %}
<div class="col mt-5">
<h1 class="mt-3 mb-2">Nos journées</h1>
<p class="font-weight-light text-center pt-4">Le groupe Calcul propose des journées scientifiques ou techniques sur différentes thématiques tout au long de l'année.</p>
</div>
{% endmacro %}
{% macro content() %}
{% macro content(articles) %}
<div class="container-fluid event">
<div class="row d-flex justify-content-center mx-xl-5 mx-lg-3" id="event" style="margin-top: 22px;">
{% import 'cards.html' as cards with context %}
......
......@@ -11,7 +11,7 @@
</div>
<div class="container">
<h1 class="my-3">{{ article.title }}</h1>
<h4 class="my-3">Proposée par {{ article.author }}</h4>
<h4 class="my-3">Proposée par {{ article.author }}{{", " + article.job_employer if article.job_employer}}</h4>
<div class="container text-center">
<div class="row d-flex justify-content-center">
<div class="col-md-4">
......
......@@ -63,6 +63,11 @@
<input type="text" name="author" value="{{ '{{form.author}}' }}" required>
<span class="error">{{ '{{errors.author}}' }}</span>
</p>
<p>
Employeur* <br>
<input type="text" name="employer" value="{{ '{{form.employer}}' }}" required>
<span class="error">{{ '{{errors.employer}}' }}</span>
</p>
<p>
E-mail <br>
<input type="email" name="email" value="{{ '{{form.email}}' }}">
......
{% extends "base.html" %}
{% if tag in JOB_OFFER_TAGS.keys() %}
{% import 'tags/emploi.html' as tag_template with context %}
{% else %}
{% import 'tags/default.html' as tag_template with context %}
{% endif %}
{% block header_content %}
{{ tag_template.header_content(tag) }}
{% endblock header_content %}
{% block content %}
{{ tag_template.content(articles) }}
{% endblock content %}
{% macro header_content(tag) %}
<div class="col mt-5">
<h1 class="mt-3 mb-2">Tag {{ tag }}</h1>
</div>
{% endmacro %}
{% macro content(articles) %}
<div class="container-fluid event">
<div class="row d-flex justify-content-center mx-xl-5 mx-lg-3" id="event" style="margin-top: 22px;">
{% import 'cards.html' as cards with context %}
{% for article in articles %}
{{ cards.dispatch(article) }}
{% endfor %}
</div>
</div>
{% endmacro %}
{% import 'category/emploi.html' as category_template with context %}
{% macro header_content(tag) %}
{{ category_template.header_content(articles[0].category) }}
{% endmacro %}
{% macro content(articles) %}
{{ category_template.content(articles) }}
{% endmacro %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment