diff --git a/.gitignore b/.gitignore index 2f1cfc8..25683c0 100644 --- a/.gitignore +++ b/.gitignore @@ -372,3 +372,4 @@ FodyWeavers.xsd /PhotoShareDb/Migrations/PhotoShareDbContextModelSnapshot.cs /photoshare.tar /testphotoshare.tar +/PhotoShareHelri/wwwroot/Photos/Bapteme2026 diff --git a/ModelsLib/PhotoUnit.cs b/ModelsLib/PhotoUnit.cs index bd80606..595edd4 100644 --- a/ModelsLib/PhotoUnit.cs +++ b/ModelsLib/PhotoUnit.cs @@ -8,16 +8,13 @@ namespace ModelsLib { } - public PhotoUnit(string photoName, string photoPath,bool isSelected) + public PhotoUnit(string photoPath) { - PhotoName = photoName; + Thumb = photoPath.Insert(photoPath.LastIndexOf("\\") + 1, "thumb\\"); PhotoPath = photoPath; - IsSelected = isSelected; } - public string PhotoName { get; set; } - - public bool IsSelected { get; set; } + public string Thumb { get; set; } public string PhotoPath { get; set; } diff --git a/PhotoShareHelri/Components/Pages/PhotoSelected.razor b/PhotoShareHelri/Components/Pages/PhotoSelected.razor index 42b8b86..001e21a 100644 --- a/PhotoShareHelri/Components/Pages/PhotoSelected.razor +++ b/PhotoShareHelri/Components/Pages/PhotoSelected.razor @@ -25,17 +25,18 @@ @for (int index = 0; index < Images.Count; index++) { - var img = Images[index]; + var img = ListImages[index]; - + loading="lazy" + @onclick="() => OpenModalZoom(img.PhotoPath)" /> } @@ -69,6 +70,7 @@ // Liste des images disponibles private List Images = new(); + private List ListImages = new(); public string Title { get; set; } bool IsModalZoomOpen = false; @@ -135,7 +137,10 @@ ShootingId = id; Images = ShootingDb.LireContenu(ShootingId, true); - + foreach (var img in Images) + { + ListImages.Add(new PhotoUnit(img)); + } } } diff --git a/PhotoShareHelri/Components/Pages/PhotoSelector.razor b/PhotoShareHelri/Components/Pages/PhotoSelector.razor index c720bf5..6789c30 100644 --- a/PhotoShareHelri/Components/Pages/PhotoSelector.razor +++ b/PhotoShareHelri/Components/Pages/PhotoSelector.razor @@ -40,24 +40,24 @@ @for (int index = 0; index < Images.Count; index++) { - var img = Images[index]; - var isSelected = SelectedImages.Contains(img); + var img = ListImages[index]; + var isSelected = SelectedImages.Contains(img.PhotoPath); var buttonClass = $"select-icon-btn {(isSelected ? "selected" : "not-selected")}"; - + @onclick="() => OpenModalZoom(img.PhotoPath)" />
+ OnClick="() => ToggleImage(img.PhotoPath)" />
@@ -102,7 +102,7 @@ // Liste des images disponibles private List Images = new(); - + private List ListImages = new(); public string Title { get; set; } bool IsModalZoomOpen = false; string? CurrentImage; @@ -171,8 +171,13 @@ ShootingId = id; Images = ShootingDb.LireContenu(ShootingId); + foreach (var img in Images) + { + ListImages.Add(new PhotoUnit(img)); + } } + MaxSelect = Datas.MaxChoice; Title = "Résultat du shooting " + Datas.Key; } }