Ajout des icônes pour les recettes non approuvées.

This commit is contained in:
FyloZ 2020-10-08 23:55:07 -04:00
parent 6cd4763d62
commit 6a56aa9fde
7 changed files with 32 additions and 14 deletions

View File

@ -32,12 +32,10 @@ h1 {
max-width: 400px;
}
.descriptionCell {
/*border-right-color: #e6e6e6;*/
/*border-right-style: solid;*/
/*border-right-width: 2px;*/
}
.researchEnabled .companyTab:not(.researchResult), .researchEnabled .recipeRow:not(.researchResult) {
display: none;
}
.iconsColumn img {
margin-top: 5px;
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24">
<path fill="#fdd835" d="M19,11.5C19,11.5 17,13.67 17,15A2,2 0 0,0 19,17A2,2 0 0,0 21,15C21,13.67 19,11.5 19,11.5M5.21,10L10,5.21L14.79,10M16.56,8.94L7.62,0L6.21,1.41L8.59,3.79L3.44,8.94C2.85,9.5 2.85,10.47 3.44,11.06L8.94,16.56C9.23,16.85 9.62,17 10,17C10.38,17 10.77,16.85 11.06,16.56L16.56,11.06C17.15,10.47 17.15,9.5 16.56,8.94Z" />
</svg>

After

Width:  |  Height:  |  Size: 627 B

View File

@ -1,9 +1,13 @@
$(() => {
$(".recipeRow").each(function () {
const iconsColumn = $(this).find(".iconsColumn")
if (!$(this).data("approbationdate")) {
const icon = $(this).find(".icon");
icon.removeAttr("hidden");
icon.attr({title: recipeNotApproved})
const icon = $("<img />")
.attr({
src: recipeNotApprovedIconPath,
title: recipeNotApproved
})
iconsColumn.append(icon)
}
});
});

View File

@ -219,5 +219,9 @@
const printingMessage = formatMessage("[[#{recipe.print.printing}]]");
</script>
<script th:fragment="iconsPath">
const recipeNotApprovedIconPath = "[[@{|${baseUrl}/icons/warning.svg|}]]"
</script>
</body>
</html>

View File

@ -28,8 +28,8 @@
<th th:text="#{recipe.color}"></th>
<th th:text="#{recipe.description}"></th>
<th th:text="#{recipe.sample}"></th>
<th></th>
<th></th>
<th><!-- Bouton --></th>
<th><!-- Icônes --></th>
</tr>
<tr class="recipeRow" th:each="recipe : ${recipeMap.get(company)}"
th:data-approbationDate="${recipe.approbationDate}" th:data-recipeId="${recipe.id}">
@ -40,9 +40,7 @@
<button class="gotoRecipe" th:data-recipeid="${recipe.id}" type="button"
th:text="#{keyword.see}"></button>
</td>
<td>
<img class="icon" th:src="@{|${baseUrl}/icons/warning.svg|}" alt="warning icon"
style="padding-top: 3px" hidden/>
<td class="iconsColumn">
</td>
</tr>
</table>
@ -54,6 +52,7 @@
<!-- Fragment du pied de page -->
<footer th:include="fragments.html :: footer(null, true)"></footer>
<script th:include="fragments.html :: iconsPath"></script>
<script th:src="@{|${baseUrl}/js/recipeResearch.js|}"></script>
<script th:src="@{|${baseUrl}/js/recipeList.js|}"></script>
<script>

View File

@ -29,6 +29,7 @@
<th th:text="#{recipe.description}"></th>
<th th:text="#{recipe.sample}"></th>
<th></th>
<th></th>
</tr>
<tr class="recipeRow" th:each="recipe : ${recipeMap.get(company)}"
th:data-approbationDate="${recipe.approbationDate}" th:data-recipeId="${recipe.id}">
@ -39,6 +40,8 @@
<button class="editRecipe" th:data-code="${recipe.name}"
th:data-recipeId="${recipe.id}" type="button" th:text="#{menu.edit}"></button>
</td>
<td class="iconsColumn">
</td>
</tr>
</table>
</div>
@ -49,6 +52,7 @@
<!-- Fragment du pied de page -->
<footer th:include="fragments.html :: footer(null, true)"></footer>
<script th:include="fragments.html :: iconsPath"></script>
<script th:src="@{|${baseUrl}/js/recipeResearch.js|}"></script>
<script th:src="@{|${baseUrl}/js/recipeList.js|}"></script>
<script>

View File

@ -30,6 +30,7 @@
<th th:text="#{recipe.description}"></th>
<th th:text="#{recipe.sample}"></th>
<th></th>
<th></th>
</tr>
<tr class="recipeRow" th:each="recipe : ${recipeMap.get(company)}"
th:data-approbationDate="${recipe.approbationDate}" th:data-recipeId="${recipe.id}">
@ -41,6 +42,8 @@
th:data-entityid="${recipe.id}" type="button"
th:text="#{keyword.delete}"></button>
</td>
<td class="iconsColumn">
</td>
</tr>
</table>
</div>
@ -52,6 +55,7 @@
<!-- Fragment du pied de page -->
<footer th:include="fragments.html :: footer(null, true)"></footer>
<script th:include="fragments.html :: iconsPath"></script>
<script th:src="@{|${baseUrl}/js/recipeResearch.js|}"></script>
<script th:src="@{|${baseUrl}/js/recipeList.js|}"></script>
</body>