Un peu de tout

This commit is contained in:
mepiphana2023
2024-04-30 13:14:37 +02:00
parent 474dec272c
commit 882d9bede0
20 changed files with 187 additions and 80 deletions

View File

@@ -12,7 +12,7 @@
<div class="card">
<div class="card-body">
<!-- Formulaire de recherche avec sélection de catégorie -->
<form th:action="@{/accueil}" method="post" class="mb-3">
<form th:action="@{/enchere}" method="post" class="mb-3">
<div class="row">
<!-- Colonne pour la zone de recherche et Achats/Ventes -->
<div class="col-md-6" th:if="${#authentication.principal != 'anonymousUser'}">
@@ -128,10 +128,23 @@
<div class="card-body d-flex flex-column ">
<h5 class="text-dark card-title text" th:text="${article.nom}"></h5>
<p class="text-dark card-text mb-auto" th:text="${article.desc}"></p>
<div class="text-dark d-flex justify-content-between align-items-center">
<div>
<h6 th:text="#{home.article.sellprice}"> <span th:text="${article.prixVente}"></span></h6>
<h6 th:text="#{home.article.seller}"> <span th:text="${article.pseudoUtilisateur}"></span> </h6>
<div class="mt-2 d-flex flex-row align-items-center justify-content-between">
<strong><label class="col-form-label mr-2" th:text="#{article.details.label.sale_price}"></label></strong>
<div class="col-form-label">
<span class="text-dark" th:if="${article.prixInitial < article.prixVente}">
<i class="fas fa-coins"></i> <!-- Assurez-vous de remplacer "fa-coins" par la classe de votre icône -->
<span th:text="${article.prixVente}"></span>
</span>
<span class="text-dark" th:if="${article.prixVente < article.prixInitial}">
<i class="fas fa-coins"></i> <!-- Assurez-vous de remplacer "fa-coins" par la classe de votre icône -->
<span th:text="${article.prixInitial}"></span>
</span>
</div>
</div>
<div class="mt-2 d-flex flex-row align-items-center justify-content-between">
<strong><label class="col-form-label mr-2" th:text="#{article.details.label.seller}"></label></strong>
<div class="col-form-label">
<span class="text-dark" th:text="${article.pseudoUtilisateur}"></span>
</div>
</div>
<br>
@@ -150,30 +163,29 @@
<ul class="pagination justify-content-center">
<!-- Bouton pour la première page -->
<li class="page-item">
<a class="page-link" th:href="@{/(page=0)}">
<a class="page-link" th:href="@{/(page=1)}">
<span aria-hidden="true">&laquo;</span>
<span th:text="#{home.button.first}"></span>
</a>
</li>
<!-- Bouton pour la page précédente -->
<li th:if="${currentPage > 0}" class="page-item">
<li th:if="${currentPage > 1}" class="page-item">
<a class="page-link" th:href="@{/(page=${currentPage - 1})}">
<span aria-hidden="true">&lsaquo;</span>
<span th:text="#{home.button.previous}"></span>
</a>
</li>
<!-- Boucle pour afficher les numéros de page -->
<!-- Vous pouvez ajuster la plage de pages affichées comme vous le souhaitez -->
<th:block th:each="page,iter : ${#numbers.sequence(0, totalPages - 1)}">
<li class="page-item" th:if="${iter.index >= (currentPage - 2) && iter.index <= (currentPage + 2)}">
<a class="page-link" th:href="@{/(page=${page})}" th:text="${page} + 1"></a>
<!-- Afficher les deux dernières pages, la page en cours et les deux suivantes -->
<th:block th:each="page,iter : ${#numbers.sequence((currentPage - 2 > 0 ? currentPage - 2 : 1), (currentPage + 2 < totalPages ? currentPage + 2 : totalPages))}">
<li class="page-item" th:classappend="${currentPage == page ? 'active' : ''}">
<a class="page-link" th:href="@{/(page=${page})}" th:text="${page}"></a>
</li>
</th:block>
<!-- Bouton pour la page suivante -->
<li th:if="${currentPage < totalPages - 1}" class="page-item">
<li th:if="${currentPage < totalPages}" class="page-item">
<a class="page-link" th:href="@{/(page=${currentPage + 1})}">
<span aria-hidden="true">&rsaquo;</span>
<span th:text="#{home.button.next}"></span>
@@ -182,7 +194,7 @@
<!-- Bouton pour la dernière page -->
<li class="page-item">
<a class="page-link" th:href="@{/(page=${totalPages - 1})}">
<a class="page-link" th:href="@{/(page=${totalPages})}">
<span aria-hidden="true">&raquo;</span>
<span th:text="#{home.button.end}"></span>
</a>