Commit 9cd19da4 authored by Mat's avatar Mat

Lettre, form status, varie la couleur du select

parent 5dea3bda
......@@ -267,10 +267,10 @@
let selectForm = document.createElement('select');
selectForm.setAttribute('name', 'lettre_status[status]');
selectForm.classList.add('form-control', 'form-control-sm', 'lettre_status', 'bg-warning');
divForm.appendChild(selectForm);
selectForm.classList.add('form-control', 'form-control-sm', 'lettre_status');
let optionValue = {'draft': 'En préparation', 'current': 'Pour Relecture', 'sent': 'Envoyer'};
let colorValue = {'draft': 'light', 'current': 'warning', 'sent': 'success'};
for (let value in optionValue)
{
let optionForm = document.createElement('option');
......@@ -279,9 +279,13 @@
optionForm.classList.add(value);
if (status === value) {
optionForm.setAttribute('selected', 'selected');
selectForm.className.replace(/\bbg.*?\b/g, ''); // en jquery
selectForm.classList.add('bg-'+ colorValue[value]);
}
selectForm.appendChild(optionForm);
}
divForm.appendChild(selectForm);
return editForm;
}
......
Markdown is supported
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