changement et ajouts des thumb pour chargement plus rapide
This commit is contained in:
@@ -25,17 +25,18 @@
|
||||
<MudGrid Justify="Justify.Center" Spacing="3">
|
||||
@for (int index = 0; index < Images.Count; index++)
|
||||
{
|
||||
var img = Images[index];
|
||||
var img = ListImages[index];
|
||||
|
||||
|
||||
<MudItem xs="12" sm="6" md="4" lg="3" xl="2">
|
||||
<MudPaper Class="image-card pa-2 position-relative" Elevation="2">
|
||||
|
||||
<MudImage Src="@img"
|
||||
<MudImage Src="@img.Thumb"
|
||||
Alt="Photo sélection"
|
||||
Class="gallery-thumb"
|
||||
Fluid="true"
|
||||
@onclick="() => OpenModalZoom(img)" />
|
||||
loading="lazy"
|
||||
@onclick="() => OpenModalZoom(img.PhotoPath)" />
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
}
|
||||
@@ -69,6 +70,7 @@
|
||||
|
||||
// Liste des images disponibles
|
||||
private List<string> Images = new();
|
||||
private List<PhotoUnit> 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,24 +40,24 @@
|
||||
<MudGrid Justify="Justify.Center" Spacing="3">
|
||||
@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")}";
|
||||
|
||||
<MudItem xs="12" sm="6" md="4" lg="3" xl="2">
|
||||
<MudPaper Class="image-card pa-2 position-relative" Elevation="2">
|
||||
|
||||
<MudImage Src="@img"
|
||||
<MudImage Src="@img.Thumb"
|
||||
Alt="Photo sélection"
|
||||
Class="gallery-thumb"
|
||||
Fluid="true"
|
||||
@onclick="() => OpenModalZoom(img)" />
|
||||
@onclick="() => OpenModalZoom(img.PhotoPath)" />
|
||||
|
||||
<div @onclick:stopPropagation="true">
|
||||
<MudIconButton Icon="@(isSelected? Icons.Material.Filled.Check : Icons.Material.Outlined.RadioButtonUnchecked)"
|
||||
Class="@buttonClass"
|
||||
Disabled="@(SelectedImages.Count >= MaxSelect && !isSelected)"
|
||||
OnClick="() => ToggleImage(img)" />
|
||||
OnClick="() => ToggleImage(img.PhotoPath)" />
|
||||
</div>
|
||||
|
||||
</MudPaper>
|
||||
@@ -102,7 +102,7 @@
|
||||
|
||||
// Liste des images disponibles
|
||||
private List<string> Images = new();
|
||||
|
||||
private List<PhotoUnit> 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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user