Commit 77fd6a1b authored by Mat's avatar Mat
Browse files

Lettre, finitions icones

parent 29c40459
...@@ -74,13 +74,15 @@ function buildRowLettre(jsonRow) ...@@ -74,13 +74,15 @@ function buildRowLettre(jsonRow)
let offreLink = Routing.generate('potage_offre_legumes_ajax_display', {'id': jsonRow.offre.id }); let offreLink = Routing.generate('potage_offre_legumes_ajax_display', {'id': jsonRow.offre.id });
let abonnes = jsonRow.groupe.utilisateurs.length + ' abonné' + (jsonRow.groupe.utilisateurs.length > 1 ? 's' : ''); let abonnes = jsonRow.groupe.utilisateurs.length + ' abonné' + (jsonRow.groupe.utilisateurs.length > 1 ? 's' : '');
let legumes = jsonRow.offre.offre_legumes.length + ' légume' + (jsonRow.offre.offre_legumes.length > 1 ? 's' : '');
let td3 = document.createElement('td'); let td3 = document.createElement('td');
td3.innerHTML = `<dl> td3.innerHTML = `<dl>
<dt>Pour:</dt> <dt>Pour:</dt>
<dd> <dd>
groupe ${jsonRow.groupe.nom} groupe ${jsonRow.groupe.nom}
<span class="details parenth"><i class="fas fa-user fa-fw"></i> ${abonnes}</span> <span class="details parenth">${abonnes}</span>
</dd> </dd>
<dt>Sujet:</dt> <dt>Sujet:</dt>
<dd> <dd>
...@@ -95,6 +97,7 @@ function buildRowLettre(jsonRow) ...@@ -95,6 +97,7 @@ function buildRowLettre(jsonRow)
<dd> <dd>
<a href="${offreLink}" title="Voir l'offre" class="btn btn-outline-dark btn-sm"> <a href="${offreLink}" title="Voir l'offre" class="btn btn-outline-dark btn-sm">
<i class="fas fa-paperclip fa-fw"></i> ${jsonRow.offre.reference}</a> <i class="fas fa-paperclip fa-fw"></i> ${jsonRow.offre.reference}</a>
<span class="details parenth">${legumes}</span>
</dd> </dd>
</dl>`; </dl>`;
tr.appendChild(td3); tr.appendChild(td3);
...@@ -212,7 +215,7 @@ function displayEditLettreLink(jsonRow) ...@@ -212,7 +215,7 @@ function displayEditLettreLink(jsonRow)
dropBtn.dataset.toggle = 'dropdown'; dropBtn.dataset.toggle = 'dropdown';
dropBtn.setAttribute('aria-haspopup', true); dropBtn.setAttribute('aria-haspopup', true);
dropBtn.setAttribute('aria-expanded', false); dropBtn.setAttribute('aria-expanded', false);
dropBtn.textContent = jsonRow.reference; dropBtn.innerHTML = '<i class="far fa-envelope-open fa-fw"></i> ' + jsonRow.reference;
dropdown.appendChild(dropBtn); dropdown.appendChild(dropBtn);
let dropmenu = document.createElement('div'); let dropmenu = document.createElement('div');
...@@ -234,7 +237,7 @@ function displayEditLettreLink(jsonRow) ...@@ -234,7 +237,7 @@ function displayEditLettreLink(jsonRow)
else { else {
let linkLettreInfos = displayLinkLettreInfos(jsonRow); let linkLettreInfos = displayLinkLettreInfos(jsonRow);
linkLettreInfos.textContent = jsonRow.reference; linkLettreInfos.innerHTML = '<i class="far fa-envelope fa-fw"></i> ' + jsonRow.reference;
linkLettreInfos.classList.add('btn', 'btn-outline-dark', 'btn-sm', 'mb-1', 'mr-1'); linkLettreInfos.classList.add('btn', 'btn-outline-dark', 'btn-sm', 'mb-1', 'mr-1');
return linkLettreInfos; return linkLettreInfos;
......
...@@ -78,7 +78,7 @@ function buildRowOffre(jsonRow) ...@@ -78,7 +78,7 @@ function buildRowOffre(jsonRow)
referenceBtn.setAttribute('href', href); referenceBtn.setAttribute('href', href);
referenceBtn.setAttribute('title', 'Éditer'); referenceBtn.setAttribute('title', 'Éditer');
referenceBtn.classList.add('btn', 'btn-outline-dark', 'btn-sm', 'mb-1', 'mr-1'); referenceBtn.classList.add('btn', 'btn-outline-dark', 'btn-sm', 'mb-1', 'mr-1');
referenceBtn.textContent = jsonRow.reference; referenceBtn.innerHTML = '<i class="fas fa-paperclip fa-fw"></i> ' + jsonRow.reference;
td6.appendChild(referenceBtn); td6.appendChild(referenceBtn);
if (jsonRow.status === 'draft') if (jsonRow.status === 'draft')
......
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