Bug : Affichage des demandes de conges
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
from django.contrib import admin
|
||||
from .models import Departement, Employe
|
||||
|
||||
@admin.register(Departement)
|
||||
class DepartementAdmin(admin.ModelAdmin):
|
||||
list_display = ("nom", )
|
||||
|
||||
@admin.register(Employe)
|
||||
class EmployeAdmin(admin.ModelAdmin):
|
||||
list_display = (
|
||||
"user",
|
||||
"matricule",
|
||||
"fonction",
|
||||
)
|
||||
@@ -1,84 +0,0 @@
|
||||
from django import forms
|
||||
from .models import Contrat, Departement, Employe,Affectation,Formation
|
||||
|
||||
class EmployeForm(forms.ModelForm):
|
||||
"""Formulaire pour modifier les informations de profil d'un employé"""
|
||||
class Meta:
|
||||
model = Employe
|
||||
fields = (
|
||||
'adresse',
|
||||
'telephone',
|
||||
'CV',
|
||||
'diplome',
|
||||
'rib',
|
||||
'photo',
|
||||
'casier_judiciaire'
|
||||
)
|
||||
|
||||
class AffectationForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Affectation
|
||||
fields = (
|
||||
'projet',
|
||||
'date_affectation',
|
||||
'date_fin_daffectation',
|
||||
'role',
|
||||
'pourcentage_temps_affectation'
|
||||
)
|
||||
|
||||
widgets = {
|
||||
'projet': forms.Select(attrs={'class': 'form-select'}),
|
||||
'date_affectation': forms.DateInput(attrs={'class': 'form-control', 'type': 'date'}),
|
||||
'date_fin_daffectation': forms.DateInput(attrs={'class': 'form-control', 'type': 'date'}),
|
||||
'role': forms.Select(attrs={'class': 'form-select'}),
|
||||
'pourcentage_temps_affectation': forms.NumberInput(attrs={'class': 'form-control'}),
|
||||
}
|
||||
|
||||
class ContratForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Contrat
|
||||
fields = [
|
||||
"numero_contrat",
|
||||
"type_contrat",
|
||||
"date_debut",
|
||||
"date_fin",
|
||||
"salaire_mensuel",
|
||||
"statut",
|
||||
"fichier_contrat"
|
||||
]
|
||||
|
||||
widgets = {
|
||||
'numero_contrat': forms.TextInput(attrs={'class': 'form-control'}),
|
||||
'type_contrat': forms.Select(attrs={'class': 'form-select'}),
|
||||
'date_debut': forms.DateInput(attrs={'class': 'form-control', 'type': 'date'}),
|
||||
'date_fin': forms.DateInput(attrs={'class': 'form-control', 'type': 'date'}),
|
||||
'salaire_mensuel': forms.TextInput(attrs={'class': 'form-control'}),
|
||||
'statut': forms.Select(attrs={'class': 'form-select'}),
|
||||
'fichier_contrat': forms.FileInput(attrs={'class': 'form-control'}),
|
||||
}
|
||||
|
||||
class DepartementForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Departement
|
||||
fields = ['nom']
|
||||
|
||||
class FormationForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Formation
|
||||
fields = [
|
||||
'titre',
|
||||
'organisme',
|
||||
'date_obtention',
|
||||
'date_fin',
|
||||
'description',
|
||||
'certificat'
|
||||
]
|
||||
|
||||
widgets = {
|
||||
'titre': forms.TextInput(attrs={"class": "form-control"}),
|
||||
'organisme': forms.TextInput(attrs={"class": "form-control"}),
|
||||
'date_obtention': forms.DateInput(attrs={"class": "form-control", "type": "date"}),
|
||||
'date_fin': forms.DateInput(attrs={"class": "form-control", "type": "date"}),
|
||||
'description': forms.Textarea(attrs={"class": "form-control"}),
|
||||
'certificat': forms.FileInput(attrs={"class": "form-control"}),
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
# Generated by Django 5.2.13 on 2026-04-17 12:03
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('gestion_projet', '0001_initial'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Departement',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('nom', models.CharField(max_length=100)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Employe',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('matricule', models.CharField(blank=True, max_length=10, null=True, unique=True)),
|
||||
('fonction', models.CharField(blank=True, choices=[('directeur', 'Directeur'), ('assistant_direction', 'Assistante de direction'), ('comptable', 'Comptable'), ('raf', 'RAF'), ('data_manager', 'Data Manager'), ('logisticien', 'Logisticien'), ('post_doctorant', 'Post-Doctorant'), ('qualiticien', 'Qualiticien'), ('technicien_surface', 'Technicien de surface'), ('chauffeur', 'Chauffeur')], max_length=50, null=True)),
|
||||
('date_embauche', models.DateField(blank=True, null=True)),
|
||||
('adresse', models.CharField(blank=True, max_length=100, null=True)),
|
||||
('telephone', models.CharField(blank=True, max_length=15, null=True)),
|
||||
('sexe', models.CharField(blank=True, choices=[('m', 'Masculin'), ('f', 'Féminin')], max_length=1, null=True)),
|
||||
('date_naissance', models.DateField(blank=True, null=True)),
|
||||
('CV', models.FileField(blank=True, null=True, upload_to='cv/')),
|
||||
('diplome', models.FileField(blank=True, null=True, upload_to='diplomes/')),
|
||||
('rib', models.FileField(blank=True, null=True, upload_to='rib/')),
|
||||
('photo', models.ImageField(blank=True, null=True, upload_to='photos/')),
|
||||
('casier_judiciaire', models.FileField(blank=True, null=True, upload_to='casier/')),
|
||||
('chef', models.BooleanField(default=False, verbose_name='Cet utilisateur est-il chef de ce département ?')),
|
||||
('departement', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='gestion_employe.departement')),
|
||||
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Contrat',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('numero_contrat', models.CharField(max_length=100, unique=True)),
|
||||
('type_contrat', models.CharField(choices=[('contrat_duree_determinee', 'Contrat à Durée Déterminée'), ('contrat_duree_indeterminee', 'Contrat à Durée Indéterminée'), ('contrat_prestation', 'Contrat de Prestation de Service'), ('contrat_stage', 'Contrat de Stage')], max_length=50)),
|
||||
('date_debut', models.DateField()),
|
||||
('date_fin', models.DateField(blank=True, null=True)),
|
||||
('salaire_mensuel', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
|
||||
('statut', models.CharField(choices=[('actif', 'Actif'), ('termine', 'Terminé'), ('suspendu', 'Suspendu'), ('rupture_contrat', 'Rupture de Contrat')], max_length=50)),
|
||||
('fichier_contrat', models.FileField(blank=True, null=True, upload_to='contrats/')),
|
||||
('employe', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='gestion_employe.employe')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Formation',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('titre', models.CharField(max_length=255, verbose_name='Nom du certificat')),
|
||||
('organisme', models.CharField(max_length=255, verbose_name="Nom de l'organisme")),
|
||||
('description', models.TextField(blank=True, null=True, verbose_name='Description de la formation')),
|
||||
('date_obtention', models.DateField(blank=True, null=True, verbose_name="Date d'obtention")),
|
||||
('date_fin', models.DateField(blank=True, null=True, verbose_name='Date de fin de validité')),
|
||||
('certificat', models.FileField(blank=True, null=True, upload_to='documents/formations/', verbose_name='Certificat (PDF/Image)')),
|
||||
('employe', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='employe_formation', to='gestion_employe.employe')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Affectation',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('date_affectation', models.DateField()),
|
||||
('date_fin_daffectation', models.DateField(blank=True, null=True)),
|
||||
('role', models.CharField(choices=[('chef_projet', 'Chef de projet'), ('doctorant', 'Doctorant'), ('mastorant', 'Mastorant'), ('consultant', 'Consultant'), ('stagiaire', 'Stagiaire'), ('laborantin', 'Laborantin'), ('medecin', 'Médecin'), ('autre', 'Autre')], default='Membre', max_length=20)),
|
||||
('pourcentage_temps_affectation', models.DecimalField(decimal_places=2, max_digits=5)),
|
||||
('projet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='gestion_projet.projet')),
|
||||
('employe', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='gestion_employe.employe')),
|
||||
],
|
||||
options={
|
||||
'unique_together': {('projet', 'employe')},
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -1,18 +0,0 @@
|
||||
# Generated by Django 6.0.4 on 2026-04-29 10:42
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('gestion_employe', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='contrat',
|
||||
name='type_contrat',
|
||||
field=models.CharField(choices=[('contrat_duree_determinee', 'Contrat à Durée Déterminée'), ('contrat_duree_indeterminee', 'Contrat à Durée Indéterminée'), ('contrat_prestation', 'Contrat de Prestation de Service'), ('contrat_stage', 'Contrat de Stage'), ('convention_bourse_entretien', "Convention de bourse d'entretien")], max_length=50),
|
||||
),
|
||||
]
|
||||
@@ -1,263 +0,0 @@
|
||||
const $ = (element) => document.getElementById(element);
|
||||
|
||||
const url_liste_employe = $("tableau_liste_employe").dataset.url;
|
||||
const tableau_liste_employe = new Tabulator("#tableau_liste_employe", {
|
||||
columns: [
|
||||
{"title": "Matricule", "field": "matricule"},
|
||||
{"title": "Nom & Prénom", "field": "employe"},
|
||||
{"title": "Fonction", "field": "fonction"},
|
||||
{"title": "Projet", "field": "projet"},
|
||||
{"title": "Téléphone", "field": "telephone"},
|
||||
],
|
||||
// ajaxURL: url_liste_employe,
|
||||
pagination: true,
|
||||
paginationSize: 10,
|
||||
})
|
||||
|
||||
fetch(url_liste_employe)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.success){
|
||||
console.log(data.data)
|
||||
tableau_liste_employe.setData(data.data);
|
||||
}else{
|
||||
alert(data.message);
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
tableau_liste_employe.on("rowClick", function (row, rowData) {
|
||||
const data = rowData.getData();
|
||||
document.getElementById('detail-id').value = data.id;
|
||||
document.getElementById('detail-matricule').value = data.matricule;
|
||||
document.getElementById('detail-employe').value = data.employe;
|
||||
document.getElementById('detail-fonction').value = data.fonction;
|
||||
document.getElementById('detail-departement').value = data.departement;
|
||||
document.getElementById('detail-sexe').value = "";
|
||||
document.getElementById('detail-dateNaissance').value = "";
|
||||
document.getElementById('detail-email').value = data.email;
|
||||
document.getElementById('detail-telephone').value = data.telephone;
|
||||
document.getElementById('detail-adresse').value = data.adresse;
|
||||
document.getElementById('detail-dateEmbauche').value = data.date_embauche;
|
||||
document.getElementById('detail-dateNaissance').value = data.date_naissance;
|
||||
document.getElementById('detail-sexe').value = data.sexe;
|
||||
|
||||
document.getElementById('document-diplome').href = data.diplome;
|
||||
document.getElementById('document-diplome').textContent = data.diplome || "Aucun diplôme";
|
||||
document.getElementById('document-cv').href = data.CV;
|
||||
document.getElementById('document-cv').textContent = data.CV || "Aucun CV";
|
||||
document.getElementById('document-rib').href = data.rib;
|
||||
document.getElementById('document-rib').textContent = data.rib || "Aucun RIB";
|
||||
document.getElementById('document-casier-judiciaire').href = data.casier_judiciaire;
|
||||
document.getElementById('document-casier-judiciaire').textContent = data.casier_judiciaire || "Aucun casier judiciaire";
|
||||
|
||||
document.getElementById("document-employe").innerHTML = data.employe || "Employé inconnu";
|
||||
|
||||
document.getElementById("formations-list").innerHTML = "";
|
||||
for (const formation of data.formations) {
|
||||
document.getElementById("formations-list").innerHTML += `
|
||||
<div class="col-6">
|
||||
<div class="form-group mb-2">
|
||||
<label>Titre :</label>
|
||||
<input type="text" class="form-control" value="${formation.titre}">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Organisme :</label>
|
||||
<input type="text" class="form-control" value="${formation.organisme}">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Date d'Optention :</label>
|
||||
<input type="text" class="form-control" value="${formation.date_obtention}">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Date de validitée :</label>
|
||||
<input type="text" class="form-control" value="${formation.date_fin}">
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
document.getElementById("contrat-employe").innerHTML = data.employe || "Employé inconnu";
|
||||
document.getElementById("employeIdInput").value = data.id;
|
||||
|
||||
document.getElementById("contrats-list").innerHTML = "";
|
||||
for (const contrat of data.contrats) {
|
||||
document.getElementById("contrats-list").innerHTML += `
|
||||
<div class="col-6">
|
||||
<div class="form-group mb-2">
|
||||
<label>Numéro de contrat :</label>
|
||||
<input type="text" class="form-control" value="${contrat.numero_contrat}">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Type de contrat :</label>
|
||||
<select class="form-select">
|
||||
<option value="">Sélectionnez un projet</option>
|
||||
<option value="contrat_duree_determinee" ${contrat.type_contrat == 'contrat_duree_determinee' ? 'selected' : ''}>Contrat à Durée Déterminée</option>
|
||||
<option value="contrat_duree_indeterminee" ${contrat.type_contrat == 'contrat_duree_indeterminee' ? 'selected' : ''}>Contrat à Durée Indéterminée</option>
|
||||
<option value="contrat_prestation" ${contrat.type_contrat == 'contrat_prestation' ? 'selected' : ''}>Contrat de Prestation de Service</option>
|
||||
<option value="contrat_stage" ${contrat.type_contrat == 'contrat_stage' ? 'selected' : ''}>Contrat de Stage</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Date de début :</label>
|
||||
<input type="text" class="form-control" value="${contrat.date_debut}">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Date de fin :</label>
|
||||
<input type="text" class="form-control" value="${contrat.date_fin}">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Salaire mensuel :</label>
|
||||
<input type="text" class="form-control" value="${contrat.salaire_mensuel}">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Statut :</label>
|
||||
<input type="text" class="form-control" value="${contrat.statut}">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Fichier de contrat :</label>
|
||||
<a href="${contrat.fichier_contrat}" target="_blank">Voir le document</a>
|
||||
</div>
|
||||
<button class='d-block m-auto btn btn-danger btn-supprimer-contrat' data-contratid="${contrat.numero_contrat}">
|
||||
<i class='bi bi-trash'></i> Supprimer le contrat
|
||||
</button>
|
||||
</div>
|
||||
`
|
||||
};
|
||||
|
||||
const supprimerButtons = document.getElementsByClassName("btn-supprimer-contrat");
|
||||
Array.from(supprimerButtons).forEach(button => {
|
||||
button.addEventListener("click", function() {
|
||||
const contratId = this.dataset.contratid;
|
||||
fetch(`contrat/supprimer/`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-CSRFToken": document.querySelector('[name=csrfmiddlewaretoken]').value
|
||||
},
|
||||
body: JSON.stringify({
|
||||
"id": contratId
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
alert(data.message);
|
||||
location.reload();
|
||||
})
|
||||
});
|
||||
})
|
||||
|
||||
document.getElementById("affectation-nom-employe").textContent = data.employe || "Employé inconnu";
|
||||
document.getElementById("affecter_employe_id").value = data.id;
|
||||
|
||||
document.getElementById("affectations-list").innerHTML = "";
|
||||
for (const affectation of data.affectations) {
|
||||
document.getElementById("affectations-list").innerHTML += `
|
||||
<div class="col-6">
|
||||
<div class="form-group mb-2">
|
||||
<label>Nom du projet :</label>
|
||||
<input type="text" class="form-control" value="${affectation.projet}">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Rôle :</label>
|
||||
<input type="text" class="form-control" value="${affectation.role}">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Pourcentation d'affectation :</label>
|
||||
<input type="text" class="form-control" value="${affectation.pourcentage_temps_affectation}">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Date d'affectation :</label>
|
||||
<input type="date" class="form-control" value="${affectation.date_affectation}">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Date de fin d'affectation :</label>
|
||||
<input type="date" class="form-control" value="${affectation.date_fin_daffectation}">
|
||||
</div>
|
||||
<button class='d-block m-auto btn btn-danger btn-supprimer-affectation' data-contratid="${affectation.id}">
|
||||
<i class='bi bi-trash'></i> Supprimer l'affectation
|
||||
</button>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
|
||||
Array.from(document.getElementsByClassName("btn-supprimer-affectation")).forEach(button => {
|
||||
button.addEventListener("click", function() {
|
||||
const affectationId = this.dataset.contratid;
|
||||
fetch(`affectation/supprimer/`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-CSRFToken": document.querySelector('[name=csrfmiddlewaretoken]').value
|
||||
},
|
||||
body: JSON.stringify({
|
||||
"id": affectationId
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
alert(data.message);
|
||||
location.reload();
|
||||
})
|
||||
});
|
||||
})
|
||||
|
||||
const modal = new bootstrap.Modal($("modalDetailEmploye"));
|
||||
modal.show();
|
||||
})
|
||||
|
||||
$("enregistrerDetail").addEventListener("click", function() {
|
||||
const id_ = document.getElementById('detail-id').value;
|
||||
const fonction = document.getElementById('detail-fonction').value;
|
||||
const dateEmbauche = document.getElementById('detail-dateEmbauche').value;
|
||||
const matricule = document.getElementById('detail-matricule').value;
|
||||
|
||||
const url_enregistrer_detail = $("modalDetailEmployeBody").dataset.url;
|
||||
fetch(url_enregistrer_detail, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-CSRFToken": document.querySelector('[name=csrfmiddlewaretoken]').value
|
||||
},
|
||||
body: JSON.stringify({
|
||||
"id": id_,
|
||||
"fonction": fonction,
|
||||
"date_embauche": dateEmbauche,
|
||||
"matricule": matricule
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
alert(data.message);
|
||||
location.reload();
|
||||
})
|
||||
});
|
||||
|
||||
$("input-recherche").addEventListener("input", function() {
|
||||
const recherche = this.value;
|
||||
if (recherche){
|
||||
tableau_liste_employe.setFilter("employe", "like", recherche);
|
||||
}else{
|
||||
tableau_liste_employe.clearFilter();
|
||||
}
|
||||
})
|
||||
|
||||
const listeContratExpirant = new Tabulator("#listeContratExpirant", {
|
||||
columns: [
|
||||
{"title": "Employé", "field": "employe"},
|
||||
{"title": "Type de contrat", "field": "type_contrat"},
|
||||
{"title": "Date de début", "field": "date_debut", formatter: 'datetime', formatterParams:{
|
||||
inputFormat:"yyyy-MM-dd",
|
||||
outputFormat:"dd/MM/yy",
|
||||
}},
|
||||
{"title": "Date de fin", "field": "date_fin", formatter: 'datetime', formatterParams:{
|
||||
inputFormat:"yyyy-MM-dd",
|
||||
outputFormat:"dd/MM/yy",
|
||||
}},
|
||||
{"title": "Statut", "field": "statut"},
|
||||
{"title": "Lien du fichier", "field": "fichier_contrat", formatter:"link", formatterParams:{
|
||||
target:"_blank",
|
||||
}
|
||||
},
|
||||
],
|
||||
ajaxURL: $("boutonContratExpirants").dataset.urlexpirants,
|
||||
})
|
||||
@@ -1,46 +0,0 @@
|
||||
const $ = (element) => document.getElementById(element);
|
||||
|
||||
url_certificat = $("tableau-certificat").dataset.url;
|
||||
const tableau_certificat = new Tabulator("#tableau-certificat", {
|
||||
columns: [
|
||||
{"title": "Nom du certificat", "field": "titre"},
|
||||
{"title": "Nom de l'organisme", "field": "organisme"},
|
||||
{"title": "Date d'obtention", "field": "date_obtention", formatter:"datetime", formatterParams:{
|
||||
inputFormat:"yyyy-MM-dd",
|
||||
outputFormat:"dd/MM/yy",
|
||||
}},
|
||||
{"title": "Date de fin de validité", "field": "date_fin", formatter:"datetime", formatterParams:{
|
||||
inputFormat:"yyyy-MM-dd",
|
||||
outputFormat:"dd/MM/yy",
|
||||
}},
|
||||
],
|
||||
ajaxURL: url_certificat,
|
||||
})
|
||||
const enregistrerProfil = $("enregistrerProfil");
|
||||
|
||||
enregistrerProfil.addEventListener("click", (e) => {
|
||||
|
||||
const url = $("information-personnelles").dataset.url;
|
||||
const csrftoken = document.querySelector("[name='csrfmiddlewaretoken']").value;
|
||||
|
||||
const formData = new FormData();
|
||||
|
||||
formData.append("nom", $("nom").value);
|
||||
formData.append("prenom", $("prenom").value);
|
||||
formData.append("email", $("email").value);
|
||||
formData.append("telephone", $("telephone").value);
|
||||
formData.append("adresse", $("adresse").value);
|
||||
formData.append("sexe", $("sexe").value);
|
||||
formData.append("date_naissance", $("date_naissance").value);
|
||||
|
||||
fetch(url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"X-CSRFToken": csrftoken
|
||||
},
|
||||
body: formData
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => alert(data.message))
|
||||
.catch(error => console.error("Erreur:", error));
|
||||
});
|
||||
@@ -1,67 +0,0 @@
|
||||
{% extends "BASE.html" %}
|
||||
{% load static %}
|
||||
{% block 'titre_page' %} Gestion des projets {% endblock %}
|
||||
{% block 'css' %}
|
||||
{% endblock %}
|
||||
{% block 'contenu' %}
|
||||
<div class="col px-2">
|
||||
<h3>Gestion des employés</h3>
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-{% if message.tags == 'error' %}danger{% else %}success{% endif %} alert-dismissible fade show" role="alert">
|
||||
{{ message }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col text-white bg-success d-flex flex-column justify-content-center align-items-center border rounded p-4">
|
||||
<span class="fs-5">Nombre d'employés</span>
|
||||
<h3>{{ nombre_employes }}</h3>
|
||||
</div>
|
||||
<div class="col text-white bg-info d-flex flex-column justify-content-center align-items-center border rounded p-4 mx-3">
|
||||
<span class="fs-5">Nombre de prestataires</span>
|
||||
<h3>{{ nombre_cps }}</h3>
|
||||
</div>
|
||||
<div class="col text-white bg-warning d-flex flex-column justify-content-center align-items-center border rounded p-4">
|
||||
<span class="fs-5">Nombre de stagiaires</span>
|
||||
<h3>{{ nombre_stage }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4">
|
||||
<div class="col d-flex justify-content-between mb-3">
|
||||
<h3>
|
||||
<i class="bi bi-people"></i>
|
||||
La liste des employés
|
||||
</h3>
|
||||
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#modalListeDesContratExpirants" id="boutonContratExpirants" data-urlexpirants="{% url 'gestion_employe:liste-contrat-expirants' %}">
|
||||
Contrats proches de la fin <span class="badge badge-light">{{ nombre_expirants }}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="row mb-2 d-flex justify-content-end">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col d-flex justify-content-center">
|
||||
<input class="form-control d-block" type="search" placeholder="Recherche par nom et prénom..." id="input-recherche">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<div id="tableau_liste_employe" data-url={% url 'gestion_employe:liste-employes' %}></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block 'modal' %}
|
||||
{% include "gestion_employe/parts/modalDetailEmploye.html" %}
|
||||
{% include "gestion_employe/parts/modalCreationContrat.html" %}
|
||||
{% include "gestion_employe/parts/modalAffectationProjet.html" %}
|
||||
{% include "gestion_employe/parts/modalDocument.html" %}
|
||||
{% include "gestion_employe/parts/modalListeContratExpirants.html" %}
|
||||
{% endblock %}
|
||||
{% block 'js' %}
|
||||
<script type="text/javascript" src="{% static 'gestion_employe/js/index.js' %}"></script>
|
||||
{% endblock %}
|
||||
@@ -1,105 +0,0 @@
|
||||
{% extends "BASE.html" %}
|
||||
{% load static %}
|
||||
{% block 'titre_page' %} Gestion des employés - Mon profil {% endblock %}
|
||||
{% block 'contenu' %}
|
||||
<div class="card shadow-sm border-0 w-100" style="max-width: 850px;">
|
||||
<div class="card-header bg-orange-dark">
|
||||
<h5 class="mb-0 fw-bold">
|
||||
<i class="bi bi-pencil-square me-2"></i> Modifier mon profil
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
<div class="accordion" id="accordionProfil">
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingInfo">
|
||||
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseInfo" aria-expanded="false" aria-controls="collapseInfo">
|
||||
<i class="bi bi-person-lines-fill me-2"></i> Informations personnelles
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseInfo" class="accordion-collapse collapse" aria-labelledby="headingInfo" data-bs-parent="#accordionProfil">
|
||||
<div class="accordion-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-group mb-2">
|
||||
<label>Photo de profil :</label>
|
||||
<input type="file" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Prénom :</label>
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Nom :</label>
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group mb-2">
|
||||
<label>Email :</label>
|
||||
<input type="email" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Téléphone :</label>
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Adresse :</label>
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingDocs">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseDocs" aria-expanded="false" aria-controls="collapseDocs">
|
||||
<i class="bi bi-file-earmark-text me-2"></i> Documents
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseDocs" class="accordion-collapse collapse" aria-labelledby="headingDocs" data-bs-parent="#accordionProfil">
|
||||
<div class="accordion-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-group mb-2">
|
||||
<label>CV :</label>
|
||||
<input type="file" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Diplome :</label>
|
||||
<input type="file" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group mb-2">
|
||||
<label>RIB :</label>
|
||||
<input type="file" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Casier judiciaire :</label>
|
||||
<input type="file" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end mt-4 gap-2 flex-wrap">
|
||||
<a href="{% url 'gestion_employe:mon-profil' %}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-x-circle me-1"></i> Annuler
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-circle me-1"></i> Enregistrer
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block 'modal' %}
|
||||
{% endblock %}
|
||||
{% block 'js' %}
|
||||
{% endblock %}
|
||||
@@ -1,28 +0,0 @@
|
||||
<div class="modal fade" id="modalAffectation" tabindex="-1" aria-labelledby="modalAffectationLabel" aria-hidden="true">
|
||||
<div class="modal-dialog ">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-orange-dark">
|
||||
<h5 class="modal-title" id="modalAffectationLabel" >
|
||||
Affectation de projet (<span id="affectation-nom-employe"></span>)
|
||||
</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal">
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{% url 'gestion_employe:affecter_employe_projet' %}" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="affecter_employe_id" id="affecter_employe_id">
|
||||
{{ affectation_form.as_p }}
|
||||
<div class="modal-footer bg-light">
|
||||
<button type="submit" class="btn btn-success">
|
||||
<i class="bi bi-check-circle"></i> affecter
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
|
||||
<i class="bi bi-x-circle me-1"></i> Annuler
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,21 +0,0 @@
|
||||
<div class="modal fade" id="modalAjouterFormation" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-orange-dark">
|
||||
<h5 class="modal-title">Ajouter un certificat</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form method="post" action="{% url 'gestion_employe:ajouter_formation' %}" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{ formation_form.as_p }}
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success">Enregistrer</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Annuler</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,57 +0,0 @@
|
||||
<div class="modal fade" id="modalContrat" tabindex="-1" aria-labelledby="modalContratLabel" aria-hidden="true">
|
||||
<div class="modal-dialog ">
|
||||
<div class="modal-content bg-white">
|
||||
<div class="modal-header ">
|
||||
<h5 class="modal-title" id="modalContratLabel">
|
||||
<i class="bi bi-file-earmark-text me-2"></i>
|
||||
Contrat de <span id="contrat-employe"></span>
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{% url 'gestion_employe:creation-contrat' %}" method="POST" id="contrat_form" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="employe_id" value="" id="employeIdInput">
|
||||
{{ contrat_form.as_p }}
|
||||
<div class="modal-footer bg-light">
|
||||
<button type="submit" class="btn btn-success">
|
||||
<i class="bi bi-check-circle me-1"></i> Enregistrer
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
|
||||
<i class="bi bi-x-circle me-1"></i> Annuler
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{% comment %} <fieldset class="border p-3 mb-4">
|
||||
<legend class="fw-bold mb-3 text-muted">Informations du contrat</legend>
|
||||
|
||||
<div class="form-group mb-2">
|
||||
<label>Numero de contrat :</label>
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Type contrat :</label>
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>date de début :</label>
|
||||
<input type="date" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>date de fin :</label>
|
||||
<input type="date" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Salaire mensuel :</label>
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Fichier du contrat :</label>
|
||||
<input type="file" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</fieldset> {% endcomment %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,136 +0,0 @@
|
||||
{% load tags_personnaliser %}
|
||||
<div class="modal fade" id="modalDetailEmploye" tabindex="-1" aria-labelledby="modalDetailEmployeLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-xl modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h5 class="modal-title bi-pencil-square" id="modalDetailEmployeLabel">
|
||||
Détails de l'employé <span id="detail-employe"></span>
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body" id="modalDetailEmployeBody" data-url="{% url 'gestion_employe:enregistrer-detail-employe' %}">
|
||||
<div class="row g-3">
|
||||
<input type="hidden" id="detail-id">
|
||||
<div class="col-md-6">
|
||||
{% csrf_token %}
|
||||
<div class="form-group mb-2">
|
||||
<label>Matricule :</label>
|
||||
<input type="text" class="form-control" id="detail-matricule">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Date d'embauche :</label>
|
||||
<input type="date" class="form-control" id="detail-dateEmbauche">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Département :</label>
|
||||
<input type="text" class="form-control" id="detail-departement">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Sexe :</label>
|
||||
<select id="detail-sexe" class="form-select">
|
||||
<option value="">-- Sélectionner --</option>
|
||||
<option value="h">Masculin</option>
|
||||
<option value="f">Féminin</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Date de naissance :</label>
|
||||
<input type="date" class="form-control" id="detail-dateNaissance">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group mb-2">
|
||||
<label>Fonction :</label>
|
||||
<select class="form-select" id='detail-fonction'>
|
||||
<option value='chauffeur'>Chauffeur</option>
|
||||
<option value='technicien_surface'>Technicien de surface</option>
|
||||
<option value='qualiticien'>Qualiticien</option>
|
||||
<option value='post_doctorant'>Post-Doctorant</option>
|
||||
<option value='logisticien'>Logisticien</option>
|
||||
<option value='data_manager'>Data Manager</option>
|
||||
<option value='raf'>RAF</option>
|
||||
<option value='comptable'>Comptable</option>
|
||||
<option value='assistant_direction'>Assistante de direction</option>
|
||||
<option value='directeur'>Directeur</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Email :</label>
|
||||
<input type="email" class="form-control" id="detail-email">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Téléphone :</label>
|
||||
<input type="text" class="form-control" id="detail-telephone">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Adresse :</label>
|
||||
<input type="text" class="form-control" id="detail-adresse">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
{% if user|has_group:"ressource_humaine" %}
|
||||
<div class="col">
|
||||
<button type="button" class="btn btn-success d-block m-auto" id="enregistrerDetail">
|
||||
<i class="bi bi-save"></i> Enregistrer
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-end">
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modalDocuments">
|
||||
<i class="bi bi-folder2-open"></i> Voir les documents RH
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="my-4">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="d-flex justify-content-between">
|
||||
<h5>
|
||||
<i class="bi bi-file-earmark-text me-2"></i> Liste des Contrats
|
||||
</h5>
|
||||
{% if user|has_group:"ressource_humaine" %}
|
||||
<div>
|
||||
<button class="btn btn-secondary" disabled>
|
||||
<i class="bi bi-file-earmark-lock"></i> Contrat actif
|
||||
</button>
|
||||
<button type="button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#modalContrat{{ item.employe.id }}">
|
||||
<i class="bi bi-file-earmark-text"></i> Créer contrat
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% csrf_token %}
|
||||
<div class="row" id="contrats-list"></div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="my-4">
|
||||
<div class="row d-flex g-3">
|
||||
<div class="d-flex justify-content-between">
|
||||
<h5><i class="bi bi-pin-angle me-2"></i> Affectations</h5>
|
||||
{% if user|has_group:"ressource_humaine" %}
|
||||
<button type="button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#modalAffectation" onclick="setEmployeId()">
|
||||
<i class="bi bi-file-earmark-text"></i>Affecter
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div id="affectations-list"></div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="my-4">
|
||||
<div class="row g-3">
|
||||
<h5 class="mb-3"><i class="bi bi-award-fill me-2"></i> Formations</h5>
|
||||
<div class="row" id="formations-list"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-light">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
|
||||
<i class="bi bi-x-circle"></i> Fermer
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,41 +0,0 @@
|
||||
<div class="modal fade" id="modalDocuments" tabindex="-1" aria-labelledby="modalDocumentsLabel" aria-hidden="true">
|
||||
<div class="modal-dialog ">
|
||||
<div class="modal-content border-0 shadow-lg">
|
||||
<div class="modal-header ">
|
||||
<h5 class="modal-title" id="modalDocumentsLabel">
|
||||
<i class="bi bi-folder2-open me-2"></i> Documents RH de <span id="document-employe"></span>
|
||||
</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row g-3">
|
||||
<div class="col">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<strong>Diplôme :</strong>
|
||||
<a id="document-diplome" target="_blank"></a>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<strong>CV :</strong>
|
||||
<a id="document-cv" target="_blank"></a>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<strong>RIB :</strong>
|
||||
<a id="document-rib" target="_blank"></a>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<strong>Casier judiciaire :</strong>
|
||||
<a id="document-casier-judiciaire" target="_blank"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-light">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
|
||||
<i class="bi bi-x-circle"></i> Fermer
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,17 +0,0 @@
|
||||
<div class="modal fade" id="modalListeDesContratExpirants" tabindex="-1">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Contrats expirants dans un maximum de 60 jours</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id='listeContratExpirant'></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fermer</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,36 +0,0 @@
|
||||
<div class="modal fade" id="modalModifierProfil" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="bi bi-person-lines-fill me-2"></i> Modifier le mot de passe</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form method="POST" action="{% url 'gestion_employe:modifier-mot-passe' %}">
|
||||
{% csrf_token %}
|
||||
<div class="form-group mb-2">
|
||||
<label>Votre mot de passe actuel :</label>
|
||||
<input class="form-control" type="password" name="ancien-mdp">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Votre nouveau mot de passe :</label>
|
||||
<input class="form-control" type="password" name="nouveau-mdp">
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label>Confirmez votre nouveau mot de passe :</label>
|
||||
<input class="form-control" type="password" name="confirmation-mdp">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
||||
Fermer
|
||||
</button>
|
||||
<button type="submit" class="btn btn-success">
|
||||
<i class="bi bi-check-circle me-1"></i> Enregistrer
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
"""Tags personnalisés pour les templates d'authentification.
|
||||
|
||||
Ce fichier contient des tags personnalisés pour les templates du projet lié à
|
||||
la gestion de l'accès des utilisateurs aux différentes pages.
|
||||
"""
|
||||
|
||||
from django import template
|
||||
from django.utils import timezone
|
||||
from gestion_employe.models import Affectation
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@register.filter
|
||||
def has_group(user, group_name):
|
||||
"""Vérifiez si un utilisateur appartient à un groupe spécifique."""
|
||||
return user.groups.filter(name=group_name).exists()
|
||||
|
||||
@register.filter
|
||||
def is_chef_projet(user):
|
||||
try:
|
||||
affectation = Affectation.objects.get(employe__user__username = user, date_fin_daffectation__gte = timezone.now().date())
|
||||
except Affectation.DoesNotExist:
|
||||
return False
|
||||
return affectation.role == "chef_projet"
|
||||
@@ -1,3 +0,0 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
Reference in New Issue
Block a user