Unverified Commit 9d3d9a0d authored by Roland Denis's avatar Roland Denis
Browse files

Customizing job offer category page

parent a1a268a2
Pipeline #2428 passed with stage
in 9 seconds
......@@ -114,6 +114,9 @@ class FormData(object):
author='',
email='',
job_type='',
location='',
duration='',
website='',
attachment_content=None,
attachment_name=None):
......@@ -122,6 +125,9 @@ class FormData(object):
self.author = author.strip()
self.email = email.strip()
self.job_type = job_type
self.location = location.strip()
self.duration = duration.strip()
self.website = website.strip()
self.attachment_content = attachment_content
self.attachment_name = attachment_name
......@@ -254,6 +260,9 @@ class JobOffer(object):
self.email = form_data.email
self.job_type = form_data.job_type
self.attachment_user_name = form_data.attachment_name
self.location = form_data.location
self.duration = form_data.duration
self.website = form_data.website
# Attachment special care
if form_data.has_attachment():
......@@ -337,7 +346,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')
('title', 'job_type', 'author', 'date', 'description', 'email', 'attachment_user_name', 'location', 'duration', 'website')
))
# Feeding the hash algo with the job_offer attachment
......@@ -376,6 +385,11 @@ class JobOffer(object):
attachment_name=self.attachment_name,
description=self.description,
job_type=JOBOFFER_TYPE[self.job_type],
author=self.author,
email=self.email,
location=self.location,
duration=self.duration,
website=self.website,
)
......@@ -622,6 +636,21 @@ def process_cmdline():
default='',
help='Offer author email'
)
form_parser.add_argument(
'--location',
default='',
help='Job working location'
)
form_parser.add_argument(
'--duration',
default='',
help='Job duration'
)
form_parser.add_argument(
'--website',
default='',
help='Web page'
)
form_parser.add_argument(
'--description',
default='',
......@@ -657,6 +686,9 @@ def process_cmdline():
title=args.title,
author=args.author,
email=args.email,
location=args.location,
duration=args.duration,
website=args.website,
description=args.description,
attachment_name=attachment_name,
attachment_content=attachment_content
......@@ -693,6 +725,15 @@ def process_cgi():
if 'job_type' in cgi_form:
form_data.job_type = cgi_form['job_type'].value
if 'location' in cgi_form:
form_data.location = cgi_form['location'].value
if 'duration' in cgi_form:
form_data.duration = cgi_form['duration'].value
if 'website' in cgi_form:
form_data.website = cgi_form['website'].value
# Checking attachment
# TODO: checking 'done' attribute for transfer error
......
......@@ -2,8 +2,13 @@ Title: {{title|e|markdown|linebreaks(', ')}}
Date: {{date|datetime}}
{% if slug %}Slug: {{slug}}{% endif %}
Category: Offres d'emploi
Offre de {{job_type|e}}
Authors: {{author|e|markdown|linebreaks(', ')}}
Email: {{email|e}}
Job_Type: {{job_type|e}}
Template: job_offer
Job_Location: {{location|e|markdown|linebreaks(', ')}}
Job_Duration: {{duration|e|markdown|linebreaks(', ')}}
Job_Website: {{website|e|markdown|linebreaks(', ')}}
{{description|e|pelican}}
......
......@@ -53,7 +53,7 @@ MENUITEMS = [('Le groupe', '/category/groupe.html'),
('Paysage du calcul', '/category/paysage.html'),
('Nos journées', '/category/evt_tech.html'),
('Nos formations', '/category/evt_sci.html'),
("Offres d'emploi", '/job_offer_form.php'),
("Offres d'emploi", '/category/offres-demploi.html'),
]
CIRCLES = {'journees': 'Nos journées'}
......
{% extends "base.html" %}
{% block pastille %}
<div class="container-fluid d-flex justify-content-end p-0" style="margin-top:-75px">
<div class="d-flex flex-column align-items-center px-lg-3 px-sm-0">
<a href="#">
<img src="{{ SITEURL }}/theme/img/follow.png"/>
</a>
</div>
</div>
{% endblock pastille %}
{% block header_content %}
{% if category == "Offres d'emploi" %}
<a href="{{ SITEURL }}/category/offres-demploi.html" class="btn btn-dark my-1" id="header-btn">
<div class="row m-0 d-flex align-items-center">
<div id="circle-offresdemploi"></div>
<span class="category text-uppercase pl-2">Offres d'emploi</span>
</div>
</a>
<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>
</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>
{% else %}
<button type="button" class="btn btn-dark my-1" id="header-btn">
<div class="row m-0 d-flex align-items-center">
<div id="circle-journees"></div>
<span class="category text-uppercase pl-2">NOS JOURNEES</span>
</div>
</button>
<h1 class="mt-3 mb-2">Atelier intégration continue</h1>
<div class="container text-center py-1">
<div class="row d-flex justify-content-center">
<div class="col-md-3 header-border px-0">
<span>Du 29 au 31 mai 2017</span>
</div>
<div class="col-md-1 px-0">
<span>Paris</span>
</div>
<div class="col-md-3 header-border px-0">
<span>Institut Henri Poincaré</span>
</div>
</div>
</div>
<p class="font-weight-light text-center pt-4">Le groupe Calcul propose un atelier de trois jours pour vous sensibiliser aux outils utilisés pour faire de l'intégration continue.</p>
<button type="button" class="btn btn-outline-dark detail" id="header-btn">L'événement en détail</button>
{% endif %}
{% endblock header_content %}
{% block content %}
<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;">
{% if category == "Offres d'emploi" %}
{% for article in articles_page.object_list %}
<div class="card col-md-4 pb-4 pt-3 px-xl-5 px-md-3 align-self-end">
<a href="{{ SITEURL }}/{{ article.url }}">
<div class="card-header">
{{ article.title }}
</div>
<div class="card-body p-0 d-flex align-items-center">
<span class="pr-2 border-right">
{{ article.job_type }}
{% if article.job_duration %}
, {{ article.job_duration }}
{% endif %}
</span>
</div>
<div class="card-footer p-0 d-flex align-items-center">
{{ article.job_location }}
</div>
</a>
</div>
{% endfor %}
{% else %}
{% for article in articles_page.object_list %}
<div class="card col-md-4 pb-4 pt-3 px-xl-5 px-md-3 align-self-end">
<a href="{{ SITEURL }}/{{ article.url }}">
<div class="card-header">
{{ article.title }}
</div>
<div class="card-body p-0 d-flex align-items-center">
<span class="pr-2 border-right">{{ article.date_event }}</span>
<div class="mx-2" id="circle-{{article.category}}"></div>
<span class="category text-uppercase"> {{CIRCLES[article.category]}} </span>
</div>
<div class="card-footer p-0 d-flex align-items-center">
{{ article.lieu }}
</div>
</a>
</div>
{% endfor %}
<div class="card col-md-4 pt-3 pb-4 px-xl-5 px-md-3 align-self-end">
<div class="card-header"></div>
<div class="card-footer p-0 d-flex align-items-center" id="special">
<div class="container-fluid p-0">
<p class="m-0" style="font-family: 'Playfair Display', serif; font-size:34px; font-weight:500;">Tout l'agenda</p>
<p class="m-0" style="font-family: 'Roboto', serif; font-size:14px; font-weight:700;">et événements passés</p>
</div>
</div>
</div>
{% endif %}
</div>
</div>
{% endblock content %}
{% extends "base.html" %}
{% block header_content %}
<a href="{{ SITEURL }}/category/offres-demploi.html" class="btn btn-dark my-1" id="header-btn">
<div class="row m-0 d-flex align-items-center">
<div id="circle-offresdemploi"></div>
<span class="category text-uppercase pl-2">Offres d'emploi</span>
</div>
</a>
<h1 class="my-3">{{ article.title }}</h1>
<div class="container text-center">
<div class="row d-flex justify-content-center">
<div class="col-md-4">
<h1>{{ article.job_type }}</h1>
</div>
{% if article.job_location %}
<div class="col-md-4">
<img style="width:22px" src="{{ SITEURL }}/theme/img/position_full.png"/><br/>
<span>{{ article.job_location }}</span>
</div>
{% endif %}
{% if article.job_duration %}
<div class="col-md-4">
<img style="width:22px" src="{{ SITEURL }}/theme/img/calendrier_full.png"/><br/>
<span>{{ article.job_duration }}</span>
</div>
{% endif %}
{% if article.email %}
<div class="col-md-4">
<h1><a href="mailto:{{ article.email }}">@</a></h1>
</div>
{% endif %}
{% if article.job_website %}
<div class="col-md-4">
<h1><a href="{{ article.job_website }}">www</a></h1>
</div>
{% endif %}
</div>
</div>
{% endblock header_content %}
{% block content %}
<div class="container-fluid job_offers">
<div class="container contact">
<h1>/Contact</h1>
<p>
{% if article.email %}
<a href="mailto:{{article.email}}">{{article.author}}</a>
{% else %}
{{article.author}}
{% endif %}
</p>
</div>
<div class="container description">
<h1>/Description de l'offre</h1>
{{article.content}}
</div>
</div>
{% endblock content %}
......@@ -52,7 +52,15 @@
<p>
Site web <br>
<input type="url" name="website" value="">
<span class="error" name="error-url"></span>
<span class="error" name="error-website"></span>
</p>
<p>
Lieu <br>
<input type="text" name="location" value="">
</p>
<p>
Durée <br>
<input type="text" name="duration" value="">
</p>
<p>
Description* <br>
......
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