Enhance ReviewAttachmentsDialog with tooltips for better user guidance and improved file status indicators.

This commit is contained in:
hart_s3 2025-12-17 11:36:56 +01:00
parent ca141e3ebd
commit 35a6702e0d

View File

@ -5,35 +5,51 @@
Your attached files Your attached files
</TitleContent> </TitleContent>
<DialogContent> <DialogContent>
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
@T("Here you can see all attached files. Files that can no longer be found (deleted, renamed, or moved) are marked with a warning icon and a strikethrough name. You can remove any attachment using the trash can icon.")
</MudJustifiedText>
<MudDivider/>
@foreach (var filePath in this.DocumentPaths) @foreach (var filePath in this.DocumentPaths)
{ {
@if (File.Exists(filePath)) @if (File.Exists(filePath))
{ {
<MudStack Row Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center" Class="mb-2"> <MudStack Row Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center" Class="mb-2">
<MudIcon Icon="@Icons.Material.Filled.AttachFile" Class="mr-2"/> <MudTooltip Text="@T("Your attached file")" Placement="Placement.Bottom">
<span class="d-inline-flex align-items-center" style="max-width: 100%;">
<MudText Class="flex-grow-1 overflow-hidden text-ellipsis" Style="white-space: nowrap;"> <MudIcon Icon="@Icons.Material.Filled.AttachFile" Class="mr-2"/>
@Path.GetFileName(filePath) <MudText Class="flex-grow-1 overflow-hidden text-ellipsis" Style="white-space: nowrap;">
</MudText> @Path.GetFileName(filePath)
</MudText>
</span>
</MudTooltip>
<MudTooltip Text="@T("Delete")" Placement="Placement.Bottom">
<MudIconButton Icon="@Icons.Material.Filled.Delete" <MudIconButton Icon="@Icons.Material.Filled.Delete"
Color="Color.Error" Color="Color.Error"
Class="ml-2" Class="ml-2"
OnClick="@(() => DeleteAttachment(filePath))"/> OnClick="@(() => DeleteAttachment(filePath))"/>
</MudTooltip>
</MudStack> </MudStack>
} }
else else
{ {
<MudStack Row Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center" Class="mb-2"> <MudStack Row Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center" Class="mb-2">
<MudText Class="flex-grow-1 overflow-hidden text-ellipsis" Style="white-space: nowrap;"> <MudTooltip Text="@T("The file was deleted, renamed, or moved")" Placement="Placement.Bottom">
<s>@Path.GetFileName(filePath)</s> <span class="d-inline-flex align-items-center" style="max-width: 100%;">
</MudText> <MudIcon Icon="@Icons.Material.Filled.Report" Color="Color.Error" Class="mr-2"/>
<MudText Class="flex-grow-1 overflow-hidden text-ellipsis" Style="white-space: nowrap;">
<s>@Path.GetFileName(filePath)</s>
</MudText>
</span>
</MudTooltip>
<MudIconButton Icon="@Icons.Material.Filled.Delete" <MudTooltip Text="@T("Delete")" Placement="Placement.Bottom">
Color="Color.Error" <MudIconButton Icon="@Icons.Material.Filled.Delete"
Class="ml-2" Color="Color.Error"
OnClick="@(() => DeleteAttachment(filePath))"/> Class="ml-2"
OnClick="@(() => DeleteAttachment(filePath))"/>
</MudTooltip>
</MudStack> </MudStack>
} }
} }