Commit c1d9c5f7 authored by Mat's avatar Mat

corrige les conditions twig sur updatedAt

parent e1b429ba
......@@ -40,6 +40,8 @@
{% if lettre.updatedAt %}
<dt>Dernière modification:</dt>
<dd class="field-lettre field1">{{ lettre.updatedAt.format('d/m/Y H:i') }}</dd>
{% else %}
<dd class="field-lettre field1"></dd>
{% endif %}
</dl>
</li>
......
......@@ -117,7 +117,7 @@ function reloadBlocLettre()
let listStatus = { 'draft': 'En préparation', 'current': 'Pour relecture', 'sent': 'Envoyé', 'trash': 'Poubelle' };
let couleurs = {'draft': 'secondary', 'current': 'warning', 'sent': 'success', 'trash': 'danger'};
fieldsLettre[0].textContent = formatStringDateTime(json.created_at, true, true, false, false);
fieldsLettre[1].textContent = formatStringDateTime(json.updated_at, true, true, false, false);
fieldsLettre[1].textContent = json.updated_at ? formatStringDateTime(json.updated_at, true, true, false, false) : null;
fieldsLettre[2].textContent = 'Groupe ' + json.groupe.nom;
fieldsLettre[3].textContent = json.subject;
fieldsLettre[4].textContent = formatStringDate(json.started_at, true, true, false, false);
......
......@@ -79,8 +79,10 @@
{% if offre.updatedAt %}
<dt>Dernière modification:</dt>
<dd class="field-offre field1">{{ offre.updatedAt.format('d/m/Y H:i') }}</dd>
</dl>
{% else %}
<dd class="field-lettre field1"></dd>
{% endif %}
</dl>
</li>
<li class="list-group-item">
<dl>
......
......@@ -158,7 +158,7 @@ function reloadBlocOffre()
let listStatus = { 'draft': 'Brouillon', 'posted': 'Publié', 'trash': 'Poubelle' };
let couleurs = {'draft': 'warning', 'posted': 'success', 'trash': 'danger'};
fieldsOffre[0].textContent = formatStringDateTime(json.createdAt, true, true, false, false);
fieldsOffre[1].textContent = formatStringDateTime(json.updatedAt, true, true, false, false);
fieldsOffre[1].textContent = json.updatedAt ? formatStringDateTime(json.updatedAt, true, true, false, false) : null;
fieldsOffre[2].innerHTML = buildColorSquare(json.status, couleurs) + listStatus[json.status];
fieldsOffre[3].textContent = formatStringDateTime(json.endedAt, true, true, false, false);
}
......
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