Commit 470c49e2 authored by Mat's avatar Mat

La grille d'image, avec boutons edit/delete, et avec auteur

parent 26172c7f
......@@ -58,7 +58,6 @@
</p>
<div id="grid-images">
</div>
{% endblock %}
......@@ -83,21 +82,41 @@
img.setAttribute('alt', json[i].name);
div.appendChild(img);
console.log(
json[i].id
+ ' | ' +
json[i].name
+ ' | ' +
json[i].path
+ ' | ' +
json[i].legend
+ ' | ' +
json[i].owner.firstname
+ ' ' +
json[i].owner.lastname
);
let modify = document.createElement('div');
modify.classList.add('modify');
let owner = document.createElement('div');
owner.classList.add('owner');
owner.innerHTML = json[i].owner.firstname + ' ' + json[i].owner.lastname;
div.appendChild(owner);
/*
*
*/
let editBtn = document.createElement('button');
editBtn.classList.add('btn', 'btn-primary');
editBtn.dataset.imageId = json[i].id;
editBtn.innerHTML = '<i class="fas fa-edit fa-fw"></i> Editer';
editBtn.addEventListener('click', function(e)
{
});
modify.appendChild(editBtn);
/*
*
*/
let deleteBtn = document.createElement('button');
deleteBtn.classList.add('btn', 'btn-danger');
deleteBtn.dataset.imageId = json[i].id;
deleteBtn.innerHTML = '<i class="fas fa-trash fa-fw"></i> Supprimer';
deleteBtn.addEventListener('click', function(e)
{
});
modify.appendChild(deleteBtn);
div.appendChild(modify);
grid.appendChild(div);
}
});
......
......@@ -245,6 +245,15 @@ ul.vignettes li img {
top: 1em;
right: 1em;
}
#grid-images div.image div.owner {
position: absolute;
z-index: 10;
bottom: 0;
left: 0; right: 0;
color: white;
background-color: #000000a8;
padding: 1em;
}
form {
border: 1px solid #d2d2d2;
......
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