This commit is contained in:
mepiphana2023
2024-04-25 15:40:41 +02:00
parent 8ebddc6d18
commit 8b252e7038
12 changed files with 202 additions and 144 deletions

View File

@@ -15,7 +15,7 @@
<form th:action="@{/accueil}" method="post" class="mb-3">
<div class="row">
<!-- Colonne pour la zone de recherche et Achats/Ventes -->
<div class="col-md-6">
<div class="col-md-6" th:if="${#authorization.expression('hasRole(''MEMBRE'')')}">
<!-- Zone de recherche -->
<div class="mb-3">
<input type="text" class="form-control" th:attr="placeholder=#{home.search.title}" name="searchTitle">
@@ -27,11 +27,28 @@
</select>
</div>
<!-- Achats et Ventes -->
</div>
<div class="col-md-12" th:if="${#authentication.principal == 'anonymousUser'}">
<!-- Zone de recherche -->
<div class="mb-3">
<input type="text" class="form-control" th:attr="placeholder=#{home.search.title}" name="searchTitle">
</div>
<div class="mb-4">
<select class="form-control" name="searchCategory">
<option value="" th:text="#{home.search.cat}"></option>
<option th:each="category : ${categories}" th:value="${category.id}" th:text="${category.libelle}"></option>
</select>
</div>
<!-- Achats et Ventes -->
</div>
<!-- Colonne pour le bouton de recherche -->
<div class="col-md-6 d-flex justify-content-center align-items-center"th:if="${#authorization.expression('hasRole(''MEMBRE'')')}">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h5 class="card-title">Achats</h5>
<div class="mb-3">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="typeTransaction" id="achats" value="achats" onchange="toggleCheckbox(this.value)">
@@ -55,12 +72,11 @@
</div>
</div>
<div class="col-md-6">
<h5 class="card-title">Ventes</h5>
<!-- Boutons radio pour Ventes -->
<div class="mb-3">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="typeTransaction" id="ventes" value="ventes" onchange="toggleCheckbox(this.value)">
<label class="form-check-label" for="ventes">Ventes</label>
<label class="form-check-label" for="ventes">Mes Ventes</label>
</div>
</div>
<!-- Checkboxes pour Ventes -->
@@ -80,12 +96,19 @@
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Colonne pour le bouton de recherche -->
<div class="col-md-6 d-flex justify-content-center align-items-center">
<button type="submit" style="font-size: 2em;" class="btn btn-primary btn-lg">Recherche</button>
</div>
<div class="row">
<br>
</div>
<div class="row">
<div class="col-md-12 col-12 d-flex justify-content-center align-items-center">
<button type="submit" style="font-size: 1em;" class="btn btn-primary btn-lg w-100">Recherche</button>
</div>
</div>
</form>
@@ -94,18 +117,18 @@
</div>
</div>
<div class="row">
<div th:each="article : ${articles}" class="col-md-6 mb-4">
<a th:href="@{/article/show(id=${article.id})}">
<div class="card shadow-sm h-100">
<div th:each="article : ${articles}" class="col-md-6 mb-4" >
<a th:href="@{/article/show(id=${article.id})}" >
<div class="card shadow-sm h-100 ">
<div class="row g-0">
<div class="col-md-4 d-flex align-items-center justify-content-center p-3">
<img th:src="${'images/articles/' + article.id + '.jpg'}" alt="Image de l'article" class="img-fluid rounded">
</div>
<div class="col-md-8">
<div class="card-body d-flex flex-column">
<h5 class="card-title" th:text="${article.nom}">Nom de l'article</h5>
<p class="card-text mb-auto" th:text="${article.desc}">Description</p>
<div class="d-flex justify-content-between align-items-center">
<div class="card-body d-flex flex-column ">
<h5 class="text-dark card-title text" th:text="${article.nom}">Nom de l'article</h5>
<p class="text-dark card-text mb-auto" th:text="${article.desc}">Description</p>
<div class="text-dark d-flex justify-content-between align-items-center">
<div>
<h6>Prix de vente: <span th:text="${article.prixVente}"></span></h6>
<h6>Vendeur: <span th:text="${article.pseudoUtilisateur}"></span> </h6>