This commit is contained in:
FyloZ 2019-08-23 11:15:49 -04:00
parent 7903c97ff5
commit ed9053e4f7
12 changed files with 220 additions and 277 deletions

View File

@ -26,7 +26,7 @@ public class LocaleConfiguration implements WebMvcConfigurer {
@Bean
public LocaleResolver localeResolver() {
SessionLocaleResolver localeResolver = new SessionLocaleResolver();
localeResolver.setDefaultLocale(Locale.ENGLISH);
localeResolver.setDefaultLocale(Locale.FRENCH);
return localeResolver;
}

View File

@ -6,7 +6,7 @@ menu.delete=Delete
menu.inventory=Inventory
menu.others=Others
recipe.color=Color
recipe.description=Short description
recipe.description=Description
recipe.sample=Sample
recipe.approbationDate=Approbation date
recipe.remark=Remark
@ -71,4 +71,13 @@ error.serverError=An error occurred while sending data to the server.
recipe.add.title=Add a recipe
recipe.sucess.saved=The recipe {0} has been saved. You can now add ingredients.
keyword.continue=Continue
recipe.edit.title=Editing {0}
recipe.editing.title=Editing {0}
recipe.edit.addMix=Add a mix
recipe.edit.addImage=Add an image
recipe.success.edit=The recipe {0} has been saved.
recipe.edit.title=Edit a recipe
recipe.explore.title={0} color
recipe.warning.notApproved.short=Not approved
recipe.image.corrupted=Image deleted or corrupted
recipe.remove.title=Delete recipes
recipe.success.deleted=The recipe {0} has been deleted.

View File

@ -5,7 +5,7 @@ menu.delete=Supprimer
menu.inventory=Inventaire
menu.others=Autres
recipe.color=Couleur
recipe.description=Courte description
recipe.description=Description
recipe.sample=Échantillon
recipe.approbationDate=Date d'approbation
recipe.remark=Remarque
@ -71,4 +71,13 @@ error.serverError=Une erreur est survenue lors de l'envoie des informations vers
recipe.add.title=Ajout d'une recette
recipe.sucess.saved=La recette {0} à été enregistrée. Vous pouvez maintenant ajouter les ingrédients.
keyword.continue=Continuer
recipe.edit.title=Modification de {0}
recipe.editing.title=Modification de {0}
recipe.edit.addMix=Ajouter un mélange
recipe.edit.addImage=Ajouter une image
recipe.success.edit=La recette {0} a bien été sauvegardée.
recipe.edit.title=Modifier une recette
recipe.explore.title=Couleur {0}
recipe.warning.notApproved.short=Non approuvée
recipe.image.corrupted=Image supprimée ou corrompue
recipe.remove.title=Supprimer des recettes
recipe.success.deleted=La recette {0} a bien été supprimée.

View File

@ -50,6 +50,12 @@
</nav>
</div>
<div th:fragment="separator">
<td colspan="2">
<hr/>
</td>
</div>
<div th:fragment="footer(link)">
<th:block th:if="${link == null}">
<a th:href="@{''(lang=__${#locale.toString() == 'en' ? 'fr' : 'en'}__)}" th:text="#{footer.lang}"></a>

View File

@ -38,7 +38,7 @@
</td>
</tr>
<tr>
<td><label th:for="${#ids.next('materialType')}">Type de produit: </label></td>
<td><b><label th:for="${#ids.next('materialType')}">Type de produit: </label></b></td>
<td><select th:field="*{materialType}">
<option th:each="materialType : ${materialTypes}"
th:attrappend="selected=${materialType.materialTypeID == material.materialType.materialTypeID}"

View File

@ -18,18 +18,20 @@
<form th:action="@{/materialType/creator}" th:object="${materialType}" class="requireAuth" method="POST">
<table>
<tr>
<td><label th:for="${#ids.next('materialTypeName')}" th:text="#{materialType.name} + ':'"></label>
<td><b><label th:for="${#ids.next('materialTypeName')}"
th:text="#{materialType.name} + ':'"></label></b>
</td>
<td><input type="text" th:field="*{materialTypeName}" required></td>
</tr>
<tr>
<td><label th:for="${#ids.next('prefix')}"
th:text="#{materialType.prefix} + ' (3 ' + #{keyword.characters} + '):'"></label></td>
<td><b><label th:for="${#ids.next('prefix')}"
th:text="#{materialType.prefix} + ' (3 ' + #{keyword.characters} + '):'"></label></b>
</td>
<td><input maxlength="3" minlength="3" type="text" th:field="*{prefix}" required></td>
</tr>
<tr>
<td><label th:for="${#ids.next('usePercentages')}"
th:text="#{materialType.usePercents} + ':'"></label></td>
<td><b><label th:for="${#ids.next('usePercentages')}"
th:text="#{materialType.usePercents} + ':'"></label></b></td>
<td><input type="checkbox" th:field="*{usePercentages}"></td>
</tr>
<tr>

View File

@ -18,30 +18,32 @@
<form th:action="@{/recipe/creator}" th:object="${recipe}" class="requireAuth" id="recipe-form" method="POST">
<table>
<tr>
<td><label th:for="${#ids.next('recipeCode')}" th:text="#{recipe.color} + ':'"></label></td>
<td><b><label th:for="${#ids.next('recipeCode')}" th:text="#{recipe.color} + ':'"></label></b></td>
<td><input type="text" th:field="*{recipeCode}" required/></td>
</tr>
<tr>
<td><label th:for="${#ids.next('company')}" th:text="#{keyword.company} + ':'"></label></td>
<td><b><label th:for="${#ids.next('company')}" th:text="#{keyword.company} + ':'"></label></b></td>
<td><select th:field="*{company}">
<option th:each="company : ${companies}" th:text="${company.companyName}"
th:value="${company.companyID}"></option>
</select></td>
</tr>
<tr>
<td><label th:for="${#ids.next('recipeDescription')}" th:text="#{recipe.description} + ':'"></label></td>
<td><b><label th:for="${#ids.next('recipeDescription')}"
th:text="#{recipe.description} + ':'"></label></b></td>
<td><input type="text" th:field="*{recipeDescription}" required /></td>
</tr>
<tr>
<td><label th:for="${#ids.next('sample')}" th:text="#{recipe.sample} + ':'"></label></td>
<td><b><label th:for="${#ids.next('sample')}" th:text="#{recipe.sample} + ':'"></label></b></td>
<td><input type="number" th:field="*{sample}" required /></td>
</tr>
<tr>
<td><label th:for="${#ids.next('approbationDate')}" th:text="#{recipe.approbationDate} + ':'"></label></td>
<td><b><label th:for="${#ids.next('approbationDate')}"
th:text="#{recipe.approbationDate} + ':'"></label></b></td>
<td><input type="date" th:field="*{approbationDate}" /></td>
</tr>
<tr>
<td><label th:for="${#ids.next('remark')}" th:text="#{recipe.remark}"></label></td>
<td><b><label th:for="${#ids.next('remark')}" th:text="#{recipe.remark}"></label></b></td>
<td><textarea cols="30" form="recipe-form" rows="10" th:field="*{remark}"></textarea></td>
</tr>
<tr>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="fr" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="fragments.html :: head(#{recipe.edit.title(${recipe.recipeCode})})"></th:block>
<th:block th:include="fragments.html :: head(#{recipe.editing.title(${recipe.recipeCode})})"></th:block>
<link href="/css/forms.css" rel="stylesheet"/>
@ -30,7 +30,7 @@
<section>
<p class="error" th:text="${error}"></p>
<h1 th:text="#{recipe.edit.title(${recipe.recipeCode})}"></h1>
<h1 th:text="#{recipe.editing.title(${recipe.recipeCode})}"></h1>
<button id="gotoRecipe" type="button" th:text="#{keyword.see}"></button>
<br/>
<br/>
@ -56,46 +56,29 @@
</select>
</td>
</tr>
<tr th:include="fragments.html :: separator"></tr>
<tr>
<td colspan="2">
<hr/>
<td><label th:for="${#ids.next('recipeDescription')}"
th:text="#{recipe.description} + ':'"></label></td>
<td><input type="text" th:field="*{recipeDescription}"/></td>
</tr>
<tr th:include="fragments.html :: separator"></tr>
<tr>
<td><label th:for="${#ids.next('sample')}" th:text="#{recipe.sample} + ':'"></label>
</td>
<td><input type="number" th:field="*{sample}"/></td>
</tr>
<tr th:include="fragments.html :: separator"></tr>
<tr>
<td><label for="recipeDescription">Description: </label></td>
<td><input id="recipeDescription" name="recipeDescription"
th:value="${recipe.recipeDescription}"
type="text"/></td>
<td><label th:for="${#ids.next('approbationDate')}"
th:text="#{recipe.approbationDate} + ':'"></label></td>
<td><input type="date" th:field="*{approbationDate}"/></td>
</tr>
<tr th:include="fragments.html :: separator"></tr>
<tr>
<td colspan="2">
<hr/>
<td><label th:for="${#ids.next('remark')}" th:text="#{recipe.remark} + ':'"></label>
</td>
</tr>
<tr>
<td><label for="sample">Échantillon: </label></td>
<td><input id="sample" name="sample" th:value="${recipe.sample}" type="number"/></td>
</tr>
<tr>
<td colspan="2">
<hr/>
</td>
</tr>
<tr>
<td><label for="approbationDate">Date d'approbation: </label></td>
<td><input id="approbationDate" name="approbationDate"
th:value="${recipe.approbationDate}"
type="date"/></td>
</tr>
<tr>
<td colspan="2">
<hr/>
</td>
</tr>
<tr>
<td><label for="remark">Remarque: </label></td>
<td><textarea cols="30" id="remark" name="remark" rows="10"
th:text="${recipe.remark}"></textarea>
<td><textarea cols="30" rows="10" th:field="*{remark}"></textarea>
</td>
</tr>
</table>
@ -117,47 +100,35 @@
<table style="margin-left: 50px">
<!-- Produits -->
<tr>
<th>Produit</th>
<th>Type</th>
<th>Quantité</th>
<th th:text="#{keyword.material}"></th>
<th th:text="#{keyword.type}"></th>
<th th:text="#{keyword.quantity}"></th>
</tr>
<tr th:each="mixQuantity : ${mix.mixQuantities}"
th:with="material = ${mixQuantity.material}">
<td th:classappend="${material.isMixType()} ? '' : materialCode"
th:data-materialID="${material.materialID}"
th:text="${material.materialCode}"></td>
<td>
<p th:text="${material.materialType.materialTypeName}"></p>
</td>
<td th:text="${mixQuantity.quantity}"></td>
</tr>
<th:block th:each="mixQuantity : ${mix.mixQuantities}"
th:with="material = ${mixQuantity.material}">
<tr>
<td th:classappend="${material.isMixType()} ? '' : materialCode"
th:data-materialID="${material.materialID}"
th:text="${material.materialCode}"></td>
<td>
<p th:text="${material.materialType.materialTypeName}"></p>
</td>
<td th:text="${mixQuantity.quantity}"></td>
</tr>
</th:block>
</table>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<hr/>
</td>
</tr>
<tr th:include="fragments.html :: separator"></tr>
</th:block>
<tr>
<td></td>
<td>
<button id="newMix" type="button">Ajouter un mélange</button>
<button id="newMix" type="button" th:text="#{recipe.edit.addMix}"></button>
</td>
</tr>
<tr th:include="fragments.html :: separator"></tr>
<tr>
<td colspan="2">
<hr/>
</td>
</tr>
<tr>
<td>
Étapes
</td>
<td th:text="#{recipe.steps} + ':'"></td>
<td>
<table id="steps">
<tr>
@ -178,22 +149,23 @@
<img alt="Image supprimée ou corrompue" th:src="'/images/' + ${image}" width="400px"/>
</td>
<td>
<button class="deleteImg" th:data-image="${image}" type="button">Supprimer</button>
<button class="deleteImg" th:data-image="${image}" type="button"
th:text="#{keyword.delete}"></button>
</td>
</tr>
</th:block>
<tr>
<td>
<button id="addImg" th:data-recipeID="${recipe.recipeID}" type="button">Ajouter une image
</button>
<button id="addImg" th:data-recipeID="${recipe.recipeID}" type="button"
th:text="#{recipe.edit.addImage}"></button>
</td>
</tr>
<tr class="mainTableEndButtons">
<td class="centerTd">
<button class="returnIndex" type="button">Retour</button>
<button class="returnIndex" type="button" th:text="#{keyword.back}"></button>
</td>
<td class="centerTd">
<button type="submit">Enregistrer</button>
<button type="submit" th:text="#{keyword.save}"></button>
</td>
</tr>
</table>
@ -206,7 +178,7 @@
<script src="/js/main.js"></script>
<script>
/*[CDATA[*/
/*<![CDATA[*/
(() => {
const errorP = document.querySelector(".error");
@ -233,7 +205,7 @@
let data = {};
data['image'] = e.getAttribute("data-image");
data['password'] = prompt("Quel est votre mot de passe?");
data['password'] = prompt("[[#{password.ask}]]");
errorP.innerHTML = "";
@ -249,7 +221,7 @@
})
.catch(e => {
console.log(e);
errorP.innerHTML = "Une erreur est survenue lors de l'envoie des informations vers le serveur.";
errorP.innerHTML = "[[#{error.serverError}]]";
});
});
});

View File

@ -1,11 +1,8 @@
<!DOCTYPE html>
<html lang="fr" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="fragments.html :: head(#{app.title})"></th:block>
<title>Modifier une recette</title>
<link href="/css/main.css" rel="stylesheet"/>
<link href="/css/index.css" rel="stylesheet"/>
<th:block th:include="fragments.html :: head(#{recipe.edit.title})"></th:block>
<title th:text="#{recipe.edit.title}"></title>
<style>
table {
@ -19,10 +16,6 @@
td {
text-align: left;
}
.companyTabTitle {
}
</style>
</head>
<body>
@ -33,41 +26,32 @@
<section>
<p class="error" th:text="${error}"></p>
<p class="success" th:if="${recipeCode != null}"
th:text="'La recette pour la couleur ' + ${recipeCode} + ' a bien été sauvegardée.'"></p>
th:text="#{recipe.success.edit(${recipeCode})}"></p>
<h1>Modifier une recette</h1>
<th:block th:if="${!recipes.empty}">
<th:block th:each="company : ${recipes.keySet()}">
<h2 class="companyTabTitle" th:data-companyName="${company.companyName}"
th:text="${company.companyName}"></h2>
<h1 th:text="#{recipe.edit.title}"></h1>
<th:block th:if="${!recipes.empty}" th:each="company : ${recipes.keySet()}">
<h2 class="companyTabTitle" th:data-companyName="${company.companyName}"
th:text="${company.companyName}"></h2>
<th:block th:if="${!recipes.get(company).empty}">
<table style="display:none" th:id="'recipes_' + ${company.companyName}">
<tr>
<th>Couleur</th>
<th>Description</th>
<th>Échantillon</th>
</tr>
<th:block th:each="recipe : ${recipes.get(company)}">
<tr class="recipeRow" th:data-approbationDate="${recipe.approbationDate}">
<td th:text="${recipe.recipeCode}"></td>
<td class="centerCell recipeDescription" th:text="${recipe.recipeDescription}"></td>
<td class="centerCell" th:text="${recipe.sample}"></td>
<td>
<button class="editRecipe" th:data-code="${recipe.recipeCode}"
th:data-recipeID="${recipe.recipeID}" type="button">
Modifier
</button>
</td>
</tr>
</th:block>
</table>
</th:block>
</th:block>
</th:block>
<th:block th:if="${recipes.empty}">
<b class="error">Aucune bannière n'a été trouvée.</b>
<table style="display:none" th:id="'recipes_' + ${company.companyName}" th:if="${!recipes.get(company).empty}">
<tr>
<th th:text="#{recipe.color}"></th>
<th th:text="#{recipe.description}"></th>
<th th:text="#{recipe.sample}"></th>
</tr>
<tr class="recipeRow" th:each="recipe : ${recipes.get(company)}"
th:data-approbationDate="${recipe.approbationDate}">
<td th:text="${recipe.recipeCode}"></td>
<td class="centerCell recipeDescription" th:text="${recipe.recipeDescription}"></td>
<td class="centerCell" th:text="${recipe.sample}"></td>
<td>
<button class="editRecipe" th:data-code="${recipe.recipeCode}"
th:data-recipeID="${recipe.recipeID}" type="button" th:text="#{menu.edit}"></button>
</td>
</tr>
</table>
</th:block>
<b th:if="${recipes.empty}" class="error" th:text="#{company.error.anyFound}"></b>
</section>
<!-- Fragment du pied de page -->
<footer th:include="fragments.html :: footer(null)"></footer>

View File

@ -1,8 +1,7 @@
<!DOCTYPE html>
<html lang="fr" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="fragments.html :: head(#{app.title})"></th:block>
<title th:text="'Couleur ' + ${recipe.recipeCode}"></title>
<th:block th:include="fragments.html :: head(#{recipe.explore.title(${recipe.recipeCode})})"></th:block>
<link href="/css/main.css" rel="stylesheet"/>
<link href="/css/index.css" rel="stylesheet"/>
@ -54,15 +53,15 @@
<p class="error" th:text="${error}"></p>
<p class="success" th:text="${success}"></p>
<h1 th:text="'Couleur ' + ${recipe.recipeCode}"></h1>
<button id="modifyRecipe" type="button">Modifier</button>
<button id="useSubmit" type="button">Utiliser</button>
<h1 th:text="#{recipe.explore.title(${recipe.recipeCode})}"></h1>
<button id="modifyRecipe" type="button" th:text="#{menu.edit}"></button>
<button id="useSubmit" type="button" th:text="#{keyword.use}"></button>
<br/>
<select id="unitsSelect"
onchange="changeUnits(this, '.inventoryQuantity', '.inventoryQuantityUnits'); changeCustomizersUnits(this)">
<option selected value="mL">Millilitres</option>
<option value="L">Litres</option>
<option value="gal">Gallons</option>
<option selected value="mL" th:text="#{units.milliliters}"></option>
<option value="L" th:text="#{units.milliliters}"></option>
<option value="gal" th:text="#{units.gallons}"></option>
</select>
<input id="recipeID" name="recipeID" th:value="${recipe.recipeID}" type="hidden"/>
@ -72,67 +71,40 @@
<td>
<table>
<tr>
<td><b>Couleur: </b></td>
<td><b th:text="#{recipe.color} + ':'"></b></td>
<td th:text="${recipe.recipeCode}"></td>
</tr>
<tr th:include="fragments.html :: separator"></tr>
<tr>
<td colspan="2">
<hr/>
</td>
</tr>
<tr>
<td><b>Bannière: </b></td>
<td><b th:text="#{keyword.company} + ':'"></b></td>
<td th:text="${recipe.company.companyName}"></td>
</tr>
<tr th:include="fragments.html :: separator"></tr>
<tr>
<td colspan="2">
<hr/>
</td>
</tr>
<tr>
<td><b>Description: </b></td>
<td><b th:text="#{recipe.description} + ':'"></b></td>
<td th:text="${recipe.recipeDescription}"></td>
</tr>
<tr th:include="fragments.html :: separator"></tr>
<tr>
<td colspan="2">
<hr/>
</td>
</tr>
<tr>
<td><b>Échantillon: </b></td>
<td><b th:text="#{recipe.sample} + ':'"></b></td>
<td th:text="${recipe.sample}"></td>
</tr>
<tr th:include="fragments.html :: separator"></tr>
<tr>
<td colspan="2">
<hr/>
</td>
<td><b th:text="#{recipe.approbationDate} + ':'"></b></td>
<td th:if="${recipe.approbationDate != ''}" th:text="${recipe.approbationDate}"></td>
<td th:if="${recipe.approbationDate == ''}" th:text="#{recipe.warning.notApproved}"
th:text="#{recipe.warning.notApproved.short}"></td>
</tr>
<tr th:include="fragments.html :: separator"></tr>
<tr>
<td><b>Date d'approbation: </b></td>
<th:block th:if="${recipe.approbationDate != ''}">
<td th:text="${recipe.approbationDate}"></td>
</th:block>
<th:block th:if="${recipe.approbationDate == ''}">
<td>Non approuvée</td>
</th:block>
</tr>
<tr>
<td colspan="2">
<hr/>
</td>
</tr>
<tr>
<td><b>Remarque: </b></td>
<td><b th:text="#{recipe.remark} + ':'"></b></td>
<td th:text="${recipe.remark}">
</td>
</tr>
<tr th:include="fragments.html :: separator"></tr>
<tr>
<td colspan="2">
<hr/>
</td>
</tr>
<tr>
<td><b>Note: </b></td>
<td><b th:text="#{recipe.notice} + ':'"></b></td>
<td>
<textarea cols="30" id="note" name="note" rows="10" th:text="${recipe.note}"></textarea>
</td>
@ -144,88 +116,82 @@
<th:block th:each="mix : ${mixes}">
<tr>
<td><b th:text="${mix.mixType.typeName} + ':'"></b><br><br>
<label for="location"> Position: </label><input class="recipeLocation" id="location"
name="location"
th:data-mixID="${mix.mixID}"
th:value="${mix.location}"
type="text"/></td>
<label for="location" th:text="' ' + #{mix.location} + ': '"></label><input
class="recipeLocation" id="location"
name="location"
th:data-mixID="${mix.mixID}"
th:value="${mix.location}"
type="text"/></td>
<td>
<table class="mixes" th:id="'recipe-' + ${mix.mixID}">
<tr>
<th>Produit</th>
<th>Type</th>
<th>Quantité</th>
<th th:text="#{keyword.material}"></th>
<th th:text="#{keyword.type}"></th>
<th th:text="#{keyword.quantity}"></th>
<!-- Changement des quantités -->
<td></td>
<td>Unités</td>
<td th:text="#{keyword.units}"></td>
</tr>
<!-- Produits -->
<th:block th:each="mixQuantity : ${mix.mixQuantities}"
th:with="material = ${mixQuantity.material}">
<tr th:id="'material-' + ${material.materialID}">
<td th:classappend="${material.isMixType()} ? '' : materialCode"
th:data-materialID="${material.materialID}"
th:text="${material.materialCode}"></td>
<td>
<p th:text="${material.materialType.materialTypeName}"></p>
</td>
<td>
<p class="inventoryQuantity"
th:data-quantityML="${mixQuantity.quantity}"
th:text="${mixQuantity.quantity}"></p>
</td>
<th:block th:if="${!material.isMixType()}">
<td><input class="quantityCustomizer" min="0" step="0.01"
th:data-quantityML="${mixQuantity.quantity}"
th:data-materialID="${material.materialID}"
th:data-mixID="${mix.mixID}"
th:value="${mixQuantity.quantity}" type="number"/></td>
</th:block>
<td>
<p class="inventoryQuantityUnits">mL</p>
</td>
</tr>
</th:block>
<tr th:each="mixQuantity : ${mix.mixQuantities}"
th:with="material = ${mixQuantity.material}"
th:id="'material-' + ${material.materialID}">
<td th:classappend="${material.isMixType()} ? '' : materialCode"
th:data-materialID="${material.materialID}"
th:text="${material.materialCode}"></td>
<td>
<p th:text="${material.materialType.materialTypeName}"></p>
</td>
<td>
<p class="inventoryQuantity"
th:data-quantityML="${mixQuantity.quantity}"
th:text="${mixQuantity.quantity}"></p>
</td>
<th:block th:if="${!material.isMixType()}">
<td><input class="quantityCustomizer" min="0" step="0.01"
th:data-quantityML="${mixQuantity.quantity}"
th:data-materialID="${material.materialID}"
th:data-mixID="${mix.mixID}"
th:value="${mixQuantity.quantity}" type="number"/></td>
</th:block>
<td>
<p class="inventoryQuantityUnits">mL</p>
</td>
</tr>
</table>
</td>
<td>
<button class="useMixSubmit" type="button">Utiliser</button>
</td>
</tr>
<tr>
<td colspan="2">
<hr/>
<button class="useMixSubmit" type="button" th:text="#{keyword.use}"></button>
</td>
</tr>
<tr th:include="fragments.html :: separator"></tr>
</th:block>
<!-- Étapes -->
<th:block th:if="${!recipe.recipeSteps.isEmpty()}">
<tr>
<td>
<b>Étapes: </b>
</td>
<td>
<ol>
<th:block th:each="step : ${recipe.recipeSteps}">
<li th:text="${step.stepMessage}"></li>
</th:block>
</ol>
</td>
</tr>
</th:block>
<tr th:if="${!recipe.recipeSteps.isEmpty()}">
<td>
<b th:text="#{recipe.steps} + ':'"></b>
</td>
<td>
<ol>
<th:block th:each="step : ${recipe.recipeSteps}">
<li th:text="${step.stepMessage}"></li>
</th:block>
</ol>
</td>
</tr>
</table>
</td>
</tr>
<tr class="mainTableEndButtons">
<td>
<button id="formSubmit" type="button">Sauvegarder</button>
<button id="formSubmit" type="button" th:text="#{keyword.save}"></button>
</td>
</tr>
<!-- Images -->
<th:block th:each="image : ${images}">
<tr>
<td colspan="2" style="text-align: center;">
<img alt="Image supprimée ou corrompue" th:src="'/images/' + ${image}" width="400px"/>
<img th:alt="#{recipe.image.corrupted}" th:src="@{'/images/' + ${image}}" width="400px"/>
</td>
</tr>
</th:block>
@ -237,6 +203,8 @@
<script src="/js/main.js"></script>
<script>
/*<![CDATA[*/
(() => {
document.querySelector("#modifyRecipe").addEventListener("click", () => {
const recipeID = document.querySelector("#recipeID").value;
@ -384,9 +352,11 @@
})
.catch(e => {
console.log(e);
errorP.innerHTML = "Une erreur est survenue lors de l'envoie des informations vers le serveur.";
errorP.innerHTML = "[[#{error.serverError}]]";
});
}
/*]]>*/
</script>
</body>
</html>

View File

@ -1,11 +1,7 @@
<!DOCTYPE html>
<html lang="fr" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="fragments.html :: head(#{app.title})"></th:block>
<title>Supprimer des recettes</title>
<link href="/css/main.css" rel="stylesheet"/>
<link href="/css/index.css" rel="stylesheet"/>
<th:block th:include="fragments.html :: head(#{recipe.remove.title})"></th:block>
<style>
table {
@ -29,42 +25,35 @@
<section>
<p class="error" th:text="${error}"></p>
<p class="success" th:if="${recipeCode != null}"
th:text="'La recette pour la couleur ' + ${recipeCode} + ' a bien été supprimée.'"></p>
th:text="#{recipe.success.deleted(${recipeCode})}"></p>
<h1>Supprimer une recette</h1>
<form action="/recipe/remover/" class="requireAuth-remover" method="POST">
<th:block th:if="${!recipes.empty}">
<th:block th:each="company : ${recipes.keySet()}">
<h2 class="companyTabTitle" th:data-companyName="${company.companyName}"
th:text="${company.companyName}"></h2>
<h1 th:text="#{recipe.remove.title}"></h1>
<form th:action="@{/recipe/remover/}" class="requireAuth-remover" method="POST">
<th:block th:if="${!recipes.empty}" th:each="company : ${recipes.keySet()}">
<h2 class="companyTabTitle" th:data-companyName="${company.companyName}"
th:text="${company.companyName}"></h2>
<th:block th:if="${!recipes.get(company).empty}">
<table style="display:none" th:id="'recipes_' + ${company.companyName}">
<tr>
<th>Couleur</th>
<th>Description</th>
<th>Échantillon</th>
</tr>
<th:block th:each="recipe : ${recipes.get(company)}">
<tr class="recipeRow" th:data-approbationDate="${recipe.approbationDate}">
<td th:text="${recipe.recipeCode}"></td>
<td class="centerCell recipeDescription" th:text="${recipe.recipeDescription}"></td>
<td class="centerCell" th:text="${recipe.sample}"></td>
<td>
<button class="remover" th:data-code="${recipe.recipeCode}"
th:data-recipeID="${recipe.recipeID}" type="button">
Supprimer
</button>
</td>
</tr>
</th:block>
</table>
</th:block>
</th:block>
</th:block>
<th:block th:if="${recipes.empty}">
<b class="error">Aucune bannière n'a été trouvée.</b>
<table style="display:none" th:if="${!recipes.get(company).empty}"
th:id="'recipes_' + ${company.companyName}">
<tr>
<th th:text="#{recipe.color}"></th>
<th th:text="#{recipe.description}"></th>
<th th:text="#{recipe.sample}"></th>
</tr>
<tr th:each="recipe : ${recipes.get(company)}" class="recipeRow"
th:data-approbationDate="${recipe.approbationDate}">
<td th:text="${recipe.recipeCode}"></td>
<td class="centerCell recipeDescription" th:text="${recipe.recipeDescription}"></td>
<td class="centerCell" th:text="${recipe.sample}"></td>
<td>
<button class="remover" th:data-code="${recipe.recipeCode}"
th:data-recipeID="${recipe.recipeID}" type="button"
th:text="#{keyword.delete}"></button>
</td>
</tr>
</table>
</th:block>
<b class="error" th:if="${recipes.empty}" th:text="#{company.error.anyFound}"></b>
</form>
</section>
<!-- Fragment du pied de page -->

Binary file not shown.