Compare commits

...

5 Commits

Author SHA1 Message Date
a.beging@eas-solutions.de
c7e0bfd8da Add interaction removal functionality and improve ProspectContainer layout
All checks were successful
Build And Push Dev Docker Image / docker (push) Successful in 1m28s
2026-04-20 14:00:21 +02:00
a.beging@eas-solutions.de
5f5690e84d Update button label in Prospects page to include 'Neu' 2026-04-20 12:53:36 +02:00
a.beging@eas-solutions.de
05b74b929e Update .gitignore to exclude generated CSS files and appsettings.json 2026-04-20 12:47:37 +02:00
a.beging@eas-solutions.de
328e194611 Enhance ProspectContainer styling with improved CSS classes and layout adjustments 2026-04-20 12:47:02 +02:00
a.beging@eas-solutions.de
8a65c03c2c Update project configuration to replace LibSass with DartSass for improved styling capabilities 2026-04-20 11:35:44 +02:00
6 changed files with 129 additions and 60 deletions

5
.gitignore vendored
View File

@@ -8,3 +8,8 @@ Publish/
app.db app.db
FoodsharingSiegen.Server/wwwroot/buildinfo.txt FoodsharingSiegen.Server/wwwroot/buildinfo.txt
FoodsharingSiegen.Server/config/appsettings.json FoodsharingSiegen.Server/config/appsettings.json
# Generated CSS files from SCSS
FoodsharingSiegen.Server/Pages/AuditView.razor.css
FoodsharingSiegen.Server/Shared/DefaultLayout.razor.css
FoodsharingSiegen.Server/Shared/NavMenu.razor.css

View File

@@ -1,9 +1,10 @@
@using FoodsharingSiegen.Contracts.Enums @using FoodsharingSiegen.Contracts.Enums
@using FoodsharingSiegen.Shared.Helper @using FoodsharingSiegen.Shared.Helper
@using System.ComponentModel
@inherits FsBase @inherits FsBase
@{ @{
var divClass = $"{CssClass} pc-main"; var divClass = $"{CssClass} pc-main shadow border-0";
if (Prospect is { Complete: true }) divClass += " complete"; if (Prospect is { Complete: true }) divClass += " complete";
if (Prospect is { Warning: true }) divClass += " warning"; if (Prospect is { Warning: true }) divClass += " warning";
if (Prospect is { RecordState: RecordState.Archived }) divClass += " deleted"; if (Prospect is { RecordState: RecordState.Archived }) divClass += " deleted";
@@ -11,43 +12,32 @@
<div class="@divClass"> <div class="@divClass">
<h5 class="mb-2 d-flex"> <h5 class="mb-2 d-flex">
<div class="flex-grow-1"> <div class="flex-grow-1 d-flex">
@if(string.IsNullOrWhiteSpace(Prospect?.Name)) <div>
{ @if(string.IsNullOrWhiteSpace(Prospect?.Name))
<i class="fa-solid fa-exclamation-triangle text-warning"></i>
<doublearrows></doublearrows>
<em>»Name fehlt«</em>
}
else
{
@Prospect?.Name
}
@if (Prospect?.FsId != null && Prospect.FsId != 0)
{
<small style="font-size: .9rem; margin-left: 0.5rem;">@Prospect?.FsId</small>
}
</div>
<div>
@if (CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador))
{
<i class="fa-solid fa-pen-to-square link mr-2" @onclick="EditProspectAsync" @onclick:preventDefault></i>
}
<a href="@(CurrentUser.NetworkLink)/profile/@Prospect?.FsId" target="_blank"><i class="fa-solid fa-eye"></i></a>
@if (CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador))
{
if (Prospect?.RecordState != RecordState.Archived)
{ {
<i class="fa-solid fa-box-archive link ml-2" @onclick="ArchiveProspectAsync" title="Archivieren" @onclick:preventDefault></i> <i class="fa-solid fa-exclamation-triangle text-warning"></i>
<doublearrows></doublearrows>
<em>»Name fehlt«</em>
} }
else else
{ {
<i class="fa-solid fa-recycle link ml-2" @onclick="RestoreProspectAsync" title="Wiederherstellen" @onclick:preventDefault></i> @Prospect?.Name
} }
</div>
<div style="flex-grow: 1;"></div>
@if (Prospect?.FsId != null && Prospect.FsId != 0)
{
<a href="@(CurrentUser.NetworkLink)/profile/@Prospect?.FsId" target="_blank">
<small style="font-size: .9rem;">
<i class="fa-solid fa-eye"></i> @Prospect?.FsId
</small>
</a>
} }
</div> </div>
</h5> </h5>
@@ -154,27 +144,74 @@
ButtonIconClass="fa-solid fa-check" ButtonIconClass="fa-solid fa-check"
IconClass="fa-solid fa-user-check"> IconClass="fa-solid fa-user-check">
</InteractionRow> </InteractionRow>
<tr>
<td colspan="3">
<hr style="margin: 10px 0;">
</td>
</tr>
<InteractionRow
Prospect="Prospect"
AllowInteraction="@CurrentUser.IsInGroup(UserGroup.Ambassador)"
Type="InteractionType.Complete"
AddClick="AddInteraction"
RemoveClick="@RemoveInteraction"
ButtonIconClass="fa-solid fa-check"
IconClass="fa-solid fa-flag-checkered">
</InteractionRow>
} }
</table> </table>
<div class="flex-grow-1"></div> <div class="flex-grow-1"></div>
<small class="text-center" style="margin-top: .5rem;">Zuletzt geändert: @Prospect?.Modified?.ToLocalTime()</small> <div class="text-center d-flex justify-content-center gap-2 mt-1">
<Button
Color="Color.Secondary"
Height="Height.Px(35)"
title="Bearbeiten"
Clicked="EditProspectAsync"
Visibility="@(CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador) ? Visibility.Default : Visibility.Invisible)"
><i class="fa-solid fa-pen-to-square"></i>
</Button>
@if(StateFilter > ProspectStateFilter.OnBoarding)
{
@if(Prospect?.Complete != true)
{
<Button
Color="Color.Primary"
Height="Height.Px(35)"
title="Fertigstellen"
Clicked="@(() => AddInteraction(InteractionType.Complete))"
Visibility="@(CurrentUser.IsInGroup(UserGroup.Ambassador) ? Visibility.Default : Visibility.Invisible)"
><i class="fa-solid fa-flag-checkered"></i>
</Button>
} else {
<Button
Color="Color.Primary"
Height="Height.Px(35)"
title="Fertigstellen rückgängig"
Clicked="@(() => AddInteraction(InteractionType.Complete))"
Visibility="@(CurrentUser.IsInGroup(UserGroup.Ambassador) ? Visibility.Default : Visibility.Invisible)"
><i class="fa-solid fa-flag"></i>
</Button>
}
}
@if (Prospect?.RecordState != RecordState.Archived)
{
<Button
Color="Color.Danger"
Height="Height.Px(35)"
title="Archivieren"
Clicked="ArchiveProspectAsync"
Visibility="@(CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador) ? Visibility.Default : Visibility.Invisible)"
><i class="fa-solid fa-box-archive"></i>
</Button>
}
else
{
<Button
Color="Color.Success"
Height="Height.Px(35)"
title="Wiederherstellen"
Clicked="RestoreProspectAsync"
Visibility="@(CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador) ? Visibility.Default : Visibility.Invisible)"
><i class="fa-solid fa-recycle"></i>
</Button>
}
</div>
<small class="text-center" style="margin-top: .5rem;">Geändert: @Prospect?.Modified?.ToLocalTime()</small>
</div> </div>

View File

@@ -106,6 +106,27 @@ namespace FoodsharingSiegen.Server.Controls
}); });
} }
private async Task RemoveInteraction(InteractionType type)
{
var typeName = type.Translate(AppSettings);
await ConfirmDialog.ShowAsync(ModalService, "Bestätigen", $"Alle {typeName}-Interaktionen wirklich entfernen?", async () =>
{
var interactions = Prospect?.Interactions.Where(x => x.Type == type);
var dataChanged = false;
foreach (var interaction in interactions ?? [])
{
var removeR = await ProspectService.RemoveInteraction(interaction.Id);
if (!removeR.Success) continue;
dataChanged = true;
}
if(dataChanged && OnDataChanged != null) await OnDataChanged();
});
}
#endregion #endregion
#region Private Method RestoreProspectAsync #region Private Method RestoreProspectAsync

View File

@@ -19,10 +19,17 @@
flex-basis: 0; flex-basis: 0;
flex-grow: 1; flex-grow: 1;
max-width: 480px; max-width: 480px;
border: 1px solid #533a20; border-radius: 12px;
border-radius: 3px; margin: 15px;
margin: 5px; padding: 1rem 1rem 0 1rem;
padding: .5rem .5rem 0 .5rem; }
@media (max-width: 576px) {
.pc-main {
margin-left: 0;
margin-right: 0;
padding: .5rem .5rem 0 .5rem;
}
} }
.pc-main.warning { .pc-main.warning {

View File

@@ -22,13 +22,13 @@
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>
<LibSassOutputStyle>expanded</LibSassOutputStyle> <DartSassOutputStyle>expanded</DartSassOutputStyle>
<LibSassOutputLevel>verbose</LibSassOutputLevel> <DartSassOutputLevel>verbose</DartSassOutputLevel>
<LibSassMessageLevel>High</LibSassMessageLevel> <DartSassMessageLevel>High</DartSassMessageLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="LibSassBuilder" Version="2.0.1" /> <PackageReference Include="DartSassBuilder" Version="1.1.0" />
<PackageReference Include="MailKit" Version="4.4.0" /> <PackageReference Include="MailKit" Version="4.4.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.3"> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.3">

View File

@@ -17,13 +17,12 @@
<Button <Button
Color="Color.Primary" Color="Color.Primary"
Width="Width.Px(50)"
Height="Height.Px(50)" Height="Height.Px(50)"
title="Hinzufügen" title="Hinzufügen"
style="min-width: auto;" style="min-width: auto;"
Clicked="@CreateProspectAsync" Clicked="@CreateProspectAsync"
Visibility="@(CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador) ? Visibility.Default : Visibility.Invisible)" Visibility="@(CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador) ? Visibility.Default : Visibility.Invisible)"
><i class="fa-solid fa-plus"></i> ><i class="fa-solid fa-plus"></i> Neu
</Button> </Button>
| |