2021-12-29 14:41:33 +01:00
|
|
|
{# -*- mode: jinja-html -*- #}
|
2021-12-23 19:28:25 +01:00
|
|
|
{% extends 'base.html' %}
|
|
|
|
{% import 'bootstrap/wtf.html' as wtf %}
|
|
|
|
|
|
|
|
{% block styles %}
|
|
|
|
{{super()}}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block app_content %}
|
|
|
|
<h1>{{ title }}</h1>
|
|
|
|
<br>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-4">
|
2022-02-28 18:57:05 +01:00
|
|
|
<p>
|
|
|
|
(*) champs requis
|
|
|
|
</p>
|
2021-12-23 19:28:25 +01:00
|
|
|
{{ wtf.quick_form(form, novalidate=True) }}
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-02-04 17:12:56 +01:00
|
|
|
|
|
|
|
<script>
|
2022-04-13 20:59:26 +02:00
|
|
|
{# pour les formulaires contact #}
|
|
|
|
var champ_date = document.getElementById("date")
|
|
|
|
if (champ_date !== null && champ_date.value === "") {
|
|
|
|
var maintenant = new Date()
|
|
|
|
champ_date.value = `${maintenant.getFullYear()}-${formatDate(maintenant.getMonth() + 1)}-${formatDate(maintenant.getDate())}T${formatDate(maintenant.getHours())}:${formatDate(maintenant.getMinutes())}`
|
|
|
|
}
|
|
|
|
|
|
|
|
function formatDate(value) {
|
|
|
|
if(value < 10)
|
|
|
|
return `0${value}`
|
|
|
|
else
|
|
|
|
return value
|
|
|
|
}
|
|
|
|
|
2022-02-11 19:18:01 +01:00
|
|
|
{# pour les formulaires offre #}
|
|
|
|
var champ_depts = document.getElementById("depts")
|
|
|
|
if (champ_depts !== null) {
|
|
|
|
var closest_form_control = champ_depts.closest(".form-control")
|
|
|
|
closest_form_control.classList.remove("form-control")
|
|
|
|
}
|
2022-04-12 19:44:09 +02:00
|
|
|
|
2022-04-13 20:59:26 +02:00
|
|
|
if(document.getElementById("expiration_date") !== null && document.getElementById("expiration_date").value === "")
|
2022-04-12 19:44:09 +02:00
|
|
|
expiration()
|
|
|
|
|
2022-04-13 20:59:26 +02:00
|
|
|
if(document.getElementById("type_offre") !== null)
|
|
|
|
document.getElementById("type_offre").addEventListener("change", expiration);
|
2022-04-12 00:21:25 +02:00
|
|
|
|
|
|
|
function expiration() {
|
|
|
|
var date = new Date()
|
|
|
|
var expiration = document.getElementById("expiration_date")
|
|
|
|
var type_offre = document.getElementById("type_offre").value
|
2022-04-12 19:44:09 +02:00
|
|
|
if (type_offre === "Alternance") {
|
2022-04-12 00:21:25 +02:00
|
|
|
expiration.value = `${date.getFullYear() + 1}-01-01`
|
|
|
|
} else {
|
2022-04-13 20:59:26 +02:00
|
|
|
if(date.getMonth() + 1 < 8)
|
|
|
|
expiration.value = `${date.getFullYear()}-08-01`
|
2022-04-12 00:21:25 +02:00
|
|
|
else
|
2022-04-13 20:59:26 +02:00
|
|
|
expiration.value = `${date.getFullYear() + 1}-08-01`
|
2022-04-12 00:21:25 +02:00
|
|
|
}
|
|
|
|
}
|
2022-02-04 17:12:56 +01:00
|
|
|
</script>
|
2021-12-23 19:28:25 +01:00
|
|
|
{% endblock %}
|