Compare commits
5 Commits
297a7c60bd
...
c7e0bfd8da
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7e0bfd8da | ||
|
|
5f5690e84d | ||
|
|
05b74b929e | ||
|
|
328e194611 | ||
|
|
8a65c03c2c |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -8,3 +8,8 @@ Publish/
|
||||
app.db
|
||||
FoodsharingSiegen.Server/wwwroot/buildinfo.txt
|
||||
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
|
||||
@@ -1,9 +1,10 @@
|
||||
@using FoodsharingSiegen.Contracts.Enums
|
||||
@using FoodsharingSiegen.Shared.Helper
|
||||
@using System.ComponentModel
|
||||
@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 { Warning: true }) divClass += " warning";
|
||||
if (Prospect is { RecordState: RecordState.Archived }) divClass += " deleted";
|
||||
@@ -11,7 +12,8 @@
|
||||
|
||||
<div class="@divClass">
|
||||
<h5 class="mb-2 d-flex">
|
||||
<div class="flex-grow-1">
|
||||
<div class="flex-grow-1 d-flex">
|
||||
<div>
|
||||
@if(string.IsNullOrWhiteSpace(Prospect?.Name))
|
||||
{
|
||||
<i class="fa-solid fa-exclamation-triangle text-warning"></i>
|
||||
@@ -23,32 +25,20 @@
|
||||
{
|
||||
@Prospect?.Name
|
||||
}
|
||||
</div>
|
||||
|
||||
<div style="flex-grow: 1;"></div>
|
||||
|
||||
@if (Prospect?.FsId != null && Prospect.FsId != 0)
|
||||
{
|
||||
<small style="font-size: .9rem; margin-left: 0.5rem;">@Prospect?.FsId</small>
|
||||
<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>
|
||||
@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>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="fa-solid fa-recycle link ml-2" @onclick="RestoreProspectAsync" title="Wiederherstellen" @onclick:preventDefault></i>
|
||||
}
|
||||
|
||||
}
|
||||
</div>
|
||||
</h5>
|
||||
|
||||
@if (!string.IsNullOrWhiteSpace(Prospect?.Memo))
|
||||
@@ -154,27 +144,74 @@
|
||||
ButtonIconClass="fa-solid fa-check"
|
||||
IconClass="fa-solid fa-user-check">
|
||||
</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>
|
||||
|
||||
<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>
|
||||
@@ -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
|
||||
|
||||
#region Private Method RestoreProspectAsync
|
||||
|
||||
@@ -19,10 +19,17 @@
|
||||
flex-basis: 0;
|
||||
flex-grow: 1;
|
||||
max-width: 480px;
|
||||
border: 1px solid #533a20;
|
||||
border-radius: 3px;
|
||||
margin: 5px;
|
||||
border-radius: 12px;
|
||||
margin: 15px;
|
||||
padding: 1rem 1rem 0 1rem;
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.pc-main {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
padding: .5rem .5rem 0 .5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.pc-main.warning {
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<LibSassOutputStyle>expanded</LibSassOutputStyle>
|
||||
<LibSassOutputLevel>verbose</LibSassOutputLevel>
|
||||
<LibSassMessageLevel>High</LibSassMessageLevel>
|
||||
<DartSassOutputStyle>expanded</DartSassOutputStyle>
|
||||
<DartSassOutputLevel>verbose</DartSassOutputLevel>
|
||||
<DartSassMessageLevel>High</DartSassMessageLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="LibSassBuilder" Version="2.0.1" />
|
||||
<PackageReference Include="DartSassBuilder" Version="1.1.0" />
|
||||
<PackageReference Include="MailKit" Version="4.4.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.3" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.3">
|
||||
|
||||
@@ -17,13 +17,12 @@
|
||||
|
||||
<Button
|
||||
Color="Color.Primary"
|
||||
Width="Width.Px(50)"
|
||||
Height="Height.Px(50)"
|
||||
title="Hinzufügen"
|
||||
style="min-width: auto;"
|
||||
Clicked="@CreateProspectAsync"
|
||||
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>
|
||||
|
|
||||
|
||||
|
||||
Reference in New Issue
Block a user