patch prod

This commit is contained in:
jleroy
2024-05-03 08:54:58 +02:00
parent 4243b1ebdf
commit 984acbdacc
2 changed files with 10 additions and 3 deletions

View File

@@ -9,7 +9,14 @@ import java.nio.file.Paths;
public class FileService {
public boolean fileExists(String filePath) {
return Files.exists(Paths.get("src/main/resources/static"+filePath));
System.out.println("1-" + filePath);
System.out.println("2-" + Files.exists(Paths.get("src/main/resources/static"+filePath)));
System.out.println("3-" + Files.exists(Paths.get(filePath)));
if (Files.exists(Paths.get("src/main/resources/static"+filePath)) || Files.exists(Paths.get(filePath))){
return true;
}else{
return false;
}
}
}

View File

@@ -119,7 +119,7 @@
<div class="card shadow-sm h-100 card-article">
<div class="row g-0">
<div class="col-md-4 d-flex align-items-center justify-content-center p-3">
<img th:if="${fileService.fileExists('/images/articles/' + article.id + '.jpg')}" th:src="'images/articles/' + ${article.id} + '.jpg'" alt="Image de l'article" class="img-fluid rounded">
<img th:if="${fileService.fileExists('/images/articles/' + article.id + '.jpg')}" th:src="'/images/articles/' + ${article.id} + '.jpg'" alt="Image de l'article" class="img-fluid rounded">
<img th:unless="${fileService.fileExists('/images/articles/' + article.id + '.jpg')}" th:src="@{/images/articles/no-data.jpg}" alt="Image de l'article" class="img-fluid rounded">
</div>
<div class="col-md-8">
@@ -159,7 +159,7 @@
</div>
<div class="row">
<div class="col-md-6">
<h6 class="text-muted"><strong><span th:text="#{article.details.label.end_date}"></span>: </strong></h6>
<h6 class="text-muted"><strong><span th:text="#{article.details.label.end_date}"></span></strong></h6>
</div>
<div class="col-md-6">
<h6 class="text-muted"><span th:text="${#dates.format(article.dateFinEnch, 'dd/MM/yyyy')}"></span></h6>