|
|
@ -4,24 +4,25 @@
|
|
|
|
[pinId]="pin.id"
|
|
|
|
[pinId]="pin.id"
|
|
|
|
[pinOpened]="pinOpened"
|
|
|
|
[pinOpened]="pinOpened"
|
|
|
|
></app-confirm-modal>
|
|
|
|
></app-confirm-modal>
|
|
|
|
|
|
|
|
|
|
|
|
<app-share-modal [pinOpened]="pinOpened" [pinId]="pin.id"></app-share-modal>
|
|
|
|
<app-share-modal [pinOpened]="pinOpened" [pinId]="pin.id"></app-share-modal>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex mb-2 justify-end items-center">
|
|
|
|
<!-- Boutons d'action -->
|
|
|
|
|
|
|
|
<div class="flex mb-4 justify-end items-center gap-2 rounded-xl">
|
|
|
|
<app-edit-pin-popup
|
|
|
|
<app-edit-pin-popup
|
|
|
|
[pin]="pin"
|
|
|
|
[pin]="pin"
|
|
|
|
[pinId]="pin.id"
|
|
|
|
[pinId]="pin.id"
|
|
|
|
[pinOpened]="pinOpened"
|
|
|
|
[pinOpened]="pinOpened"
|
|
|
|
></app-edit-pin-popup>
|
|
|
|
></app-edit-pin-popup>
|
|
|
|
|
|
|
|
|
|
|
|
<button
|
|
|
|
<button
|
|
|
|
class="p-1 text-gray-500 rounded hover:bg-gray-200 focus:outline-none ml-2 flex items-center"
|
|
|
|
class="p-2 text-gray-600 rounded-full hover:bg-gray-100 transition duration-200 shadow-sm"
|
|
|
|
(click)="sharePin()"
|
|
|
|
(click)="sharePin()"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
<svg
|
|
|
|
class="w-[1.125rem] h-[1.125rem] text-gray-800"
|
|
|
|
class="w-5 h-5 text-gray-800"
|
|
|
|
aria-hidden="true"
|
|
|
|
aria-hidden="true"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
width="24"
|
|
|
|
|
|
|
|
height="24"
|
|
|
|
|
|
|
|
fill="none"
|
|
|
|
fill="none"
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
>
|
|
|
|
>
|
|
|
@ -33,18 +34,16 @@
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</svg>
|
|
|
|
</svg>
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
|
|
<button
|
|
|
|
<button
|
|
|
|
class="p-1 text-red-500 rounded hover:bg-red-100 focus:outline-none ml-2 flex items-center"
|
|
|
|
class="p-2 text-red-600 rounded-full hover:bg-red-100 transition duration-200 shadow-sm"
|
|
|
|
aria-label="Delete"
|
|
|
|
aria-label="Delete"
|
|
|
|
(click)="onDelete()"
|
|
|
|
(click)="onDelete()"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<!-- Modale si demandée -->
|
|
|
|
|
|
|
|
<svg
|
|
|
|
<svg
|
|
|
|
class="w-[1.125rem] h-[1.125rem] text-gray-800"
|
|
|
|
class="w-5 h-5 text-gray-800"
|
|
|
|
aria-hidden="true"
|
|
|
|
aria-hidden="true"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
width="24"
|
|
|
|
|
|
|
|
height="24"
|
|
|
|
|
|
|
|
fill="none"
|
|
|
|
fill="none"
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
>
|
|
|
|
>
|
|
|
@ -57,17 +56,16 @@
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</svg>
|
|
|
|
</svg>
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
|
|
<button
|
|
|
|
<button
|
|
|
|
class="p-1 text-gray-500 rounded hover:bg-gray-200 focus:outline-none ml-2 flex items-center"
|
|
|
|
class="p-2 text-gray-600 rounded-full hover:bg-gray-100 transition duration-200 shadow-sm"
|
|
|
|
aria-label="Close"
|
|
|
|
aria-label="Close"
|
|
|
|
(click)="onClosePopup()"
|
|
|
|
(click)="onClosePopup()"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
<svg
|
|
|
|
class="w-[1.125rem] h-[1.125rem] text-gray-800"
|
|
|
|
class="w-5 h-5 text-gray-800"
|
|
|
|
aria-hidden="true"
|
|
|
|
aria-hidden="true"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
width="24"
|
|
|
|
|
|
|
|
height="24"
|
|
|
|
|
|
|
|
fill="none"
|
|
|
|
fill="none"
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
>
|
|
|
|
>
|
|
|
@ -81,38 +79,34 @@
|
|
|
|
</svg>
|
|
|
|
</svg>
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="text-center">
|
|
|
|
|
|
|
|
<strong>{{ pin.title }}</strong>
|
|
|
|
<!-- Titre -->
|
|
|
|
<ng-container
|
|
|
|
<div class="text-center mb-4">
|
|
|
|
*ngIf="pin.files.length > 0; else noImagesPlaceholder"
|
|
|
|
<h2 class="text-xl font-semibold text-gray-800">{{ pin.title }}</h2>
|
|
|
|
class="relative carousel overflow-hidden"
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Carousel -->
|
|
|
|
|
|
|
|
<ng-container *ngIf="pin.files.length > 0; else noImagesPlaceholder">
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="relative h-56 mt-2 overflow-hidden rounded-xl flex items-center justify-center"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<!-- Carousel wrapper -->
|
|
|
|
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
class="relative h-40 mt-2 overflow-hidden rounded-lg flex items-center justify-center"
|
|
|
|
*ngFor="let imageId of pin.files; let index = index"
|
|
|
|
|
|
|
|
[class]="
|
|
|
|
|
|
|
|
'absolute inset-0 transition-opacity duration-700 ease-in-out' +
|
|
|
|
|
|
|
|
(index === currentIndex ? ' opacity-100' : ' opacity-0')
|
|
|
|
|
|
|
|
"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
<img
|
|
|
|
|
|
|
|
[src]="imageUrls[index]"
|
|
|
|
|
|
|
|
[hidden]="!imagesLoaded"
|
|
|
|
|
|
|
|
class="object-contain h-56 w-auto mx-auto transition-opacity duration-300"
|
|
|
|
|
|
|
|
/>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
*ngFor="let imageId of pin.files; let index = index"
|
|
|
|
*ngIf="!imagesLoaded"
|
|
|
|
[class]="
|
|
|
|
class="absolute inset-0 flex items-center justify-center"
|
|
|
|
'absolute inset-0 transition-opacity duration-700 ease-in-out' +
|
|
|
|
|
|
|
|
(index === currentIndex ? ' opacity-100' : ' opacity-0')
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
<span class="text-gray-500">Loading image...</span>
|
|
|
|
class="relative h-40 overflow-hidden rounded-lg flex items-center justify-center"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<img
|
|
|
|
|
|
|
|
[src]="imageUrls[index]"
|
|
|
|
|
|
|
|
[hidden]="!imagesLoaded"
|
|
|
|
|
|
|
|
class="object-contain max-h-full max-w-full h-full w-auto mx-auto"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
*ngIf="!imagesLoaded"
|
|
|
|
|
|
|
|
class="relative inset-0 bg-gray-200 w-52 h-40 mt-2 overflow-hidden rounded-lg flex items-center justify-center"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<span class="text-gray-500">Loading image...</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
@ -120,14 +114,14 @@
|
|
|
|
<div *ngIf="pin.files.length > 1">
|
|
|
|
<div *ngIf="pin.files.length > 1">
|
|
|
|
<button
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
type="button"
|
|
|
|
class="absolute top-0 left-0 z-30 flex items-center justify-center h-full cursor-pointer group focus:outline-none"
|
|
|
|
class="absolute inset-y-0 left-0 z-30 flex items-center justify-center px-2 group focus:outline-none"
|
|
|
|
(click)="prevSlide()"
|
|
|
|
(click)="prevSlide()"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
<span
|
|
|
|
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-black/30 dark:bg-black-800/30 group-hover:bg-black/50 dark:group-hover:bg-black-800/60"
|
|
|
|
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-black/30 group-hover:bg-black/50 transition"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
<svg
|
|
|
|
class="w-4 h-4 text-white rtl:rotate-180"
|
|
|
|
class="w-4 h-4 text-white"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
fill="none"
|
|
|
|
fill="none"
|
|
|
|
viewBox="0 0 6 10"
|
|
|
|
viewBox="0 0 6 10"
|
|
|
@ -143,16 +137,17 @@
|
|
|
|
<span class="sr-only">Previous</span>
|
|
|
|
<span class="sr-only">Previous</span>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
|
|
<button
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
type="button"
|
|
|
|
class="absolute top-0 right-0 z-30 flex items-center justify-center h-full cursor-pointer group focus:outline-none"
|
|
|
|
class="absolute inset-y-0 right-0 z-30 flex items-center justify-center px-2 group focus:outline-none"
|
|
|
|
(click)="nextSlide()"
|
|
|
|
(click)="nextSlide()"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
<span
|
|
|
|
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-black/30 dark:bg-black-800/30 group-hover:bg-black/50 dark:group-hover:bg-black-800/60"
|
|
|
|
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-black/30 group-hover:bg-black/50 transition"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
<svg
|
|
|
|
class="w-4 h-4 text-white rtl:rotate-180"
|
|
|
|
class="w-4 h-4 text-white"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
fill="none"
|
|
|
|
fill="none"
|
|
|
|
viewBox="0 0 6 10"
|
|
|
|
viewBox="0 0 6 10"
|
|
|
@ -169,32 +164,32 @@
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</ng-container>
|
|
|
|
</div>
|
|
|
|
<ng-template #noImagesPlaceholder>
|
|
|
|
</ng-container>
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="relative h-40 mt-2 overflow-hidden rounded-lg flex items-center justify-center bg-gray-200"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<span class="text-gray-500">No images available</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</ng-template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Description justifiée tronquée -->
|
|
|
|
<!-- Placeholder s'il n'y a pas d'image -->
|
|
|
|
|
|
|
|
<ng-template #noImagesPlaceholder>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
class="text-lg mb-4 text-justify transition-all duration-300"
|
|
|
|
class="relative h-36 mt-2 overflow-hidden rounded-xl flex items-center justify-center bg-gray-100 border border-gray-300"
|
|
|
|
[ngClass]="{
|
|
|
|
|
|
|
|
'line-clamp-5 overflow-hidden': !expandedDescriptions[0]
|
|
|
|
|
|
|
|
}"
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{{ pin.description || "Aucune description" }}
|
|
|
|
<span class="text-gray-400 text-sm">Aucune image disponible</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</ng-template>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Bouton "voir plus / moins" -->
|
|
|
|
<!-- Description -->
|
|
|
|
<div *ngIf="pin.description.length > 200" class="text-right mb-6">
|
|
|
|
<div
|
|
|
|
<button
|
|
|
|
class="text-base leading-relaxed text-justify text-gray-700 transition-all duration-300 mt-2"
|
|
|
|
class="text-blue-600 font-semibold hover:underline"
|
|
|
|
[ngClass]="{ 'line-clamp-5 overflow-hidden': !expandedDescriptions[0] }"
|
|
|
|
(click)="toggleDescription(0)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{{ pin.description || "Aucune description" }}
|
|
|
|
{{ expandedDescriptions[0] ? "Voir moins" : "Voir plus" }}
|
|
|
|
</div>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!-- Bouton "Voir plus / moins" -->
|
|
|
|
|
|
|
|
<div *ngIf="pin.description.length > 200" class="text-right mt-2 mb-4">
|
|
|
|
|
|
|
|
<button
|
|
|
|
|
|
|
|
class="text-blue-600 font-medium hover:underline transition"
|
|
|
|
|
|
|
|
(click)="toggleDescription(0)"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ expandedDescriptions[0] ? "Voir moins" : "Voir plus" }}
|
|
|
|
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|