Commit 31a3a3ca authored by Mat's avatar Mat

pagination, wip.. navigation par page

parent 4218d390
......@@ -84,6 +84,31 @@
</tbody>
</table>
<nav id="pagenav" aria-label="page navigation membre">
<ul class="pagination justify-content-center">
{#
<li class="page-item disabled">
<span class="page-link">Précédent</span>
</li>
<li class="page-item">
<a class="page-link" href="#">1</a>
</li>
<li class="page-item active">
<span class="page-link">2
<span class="sr-only">(current)</span>
</span>
</li>
<li class="page-item">
<a class="page-link" href="#">3</a>
</li>
<li class="page-item">
<a class="page-link" href="#">Suivant</a>
</li>
#}
</ul>
</nav>
{% endblock %}
{% block customJS %}
......@@ -189,6 +214,27 @@
tbody.appendChild(tr);
}
/*
* Pagenav
*/
let pageNav = document.querySelector('nav#pagenav ul.pagination');
//let pageItem = document.createElement('li');
//pageItem.classList.add('page-item');
//pageNav.appendChild(pageItem);
AJAX('GET', Routing.generate('api_membre_read_paginate'), function(request)
{
let json = JSON.parse(request.responseText);
let total = json.length;
let perPage = paginate.step;
console.log('parPage:' + perPage + ' total:' + total);
});
});
}
reloadTableMembre(paginate);
......@@ -285,5 +331,6 @@
});
</script>
{% endblock %}
@import url('https://fonts.googleapis.com/css?family=Open+Sans');
@import url('https://fonts.googleapis.com/css?family=Averia+Sans+Libre:300i,400i');
a.page-link,
a {
text-decoration: none;
color: #434265;
}
a.page-link:hover,
a:hover {
color: #72719c;
}
......@@ -307,3 +310,8 @@ form#pagination {
margin-top: 1em;
width: 160px;
}
.pagination li.page-item.active span.page-link {
background: #343a40;
border-color: #343a40;
}
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