From c70fb6426ca11e838e5f48a4d714cf448cc3dfbb Mon Sep 17 00:00:00 2001 From: Andre Beging Date: Mon, 4 Apr 2022 16:31:18 +0200 Subject: [PATCH] Interactions als Notneeded markieren --- .../Controls/InteractionRow.razor | 5 ++- .../Controls/InteractionRow.razor.css | 4 ++ .../Dialogs/AddInteractionModal.razor | 16 +++++++- .../Dialogs/AddInteractionModal.razor.cs | 5 ++- .../Pages/Prospects.razor | 40 +++++++++++++------ 5 files changed, 54 insertions(+), 16 deletions(-) diff --git a/FoodsharingSiegen.Server/Controls/InteractionRow.razor b/FoodsharingSiegen.Server/Controls/InteractionRow.razor index bb90239..a0a2891 100644 --- a/FoodsharingSiegen.Server/Controls/InteractionRow.razor +++ b/FoodsharingSiegen.Server/Controls/InteractionRow.razor @@ -32,11 +32,14 @@ private List Interactions => Prospect?.Interactions?.Where(x => x.Type == Type).ToList() ?? new List(); private bool Done => Interactions.Count >= Minimum; + + private bool NotNeeded => Interactions.Any(x => x.NotNeeded); } @{ var rowClass = ""; - if (Done) rowClass += "done"; + if (Done) rowClass += " done"; + if (NotNeeded) rowClass += " notneeded"; } diff --git a/FoodsharingSiegen.Server/Controls/InteractionRow.razor.css b/FoodsharingSiegen.Server/Controls/InteractionRow.razor.css index 8e4b193..cbd74e1 100644 --- a/FoodsharingSiegen.Server/Controls/InteractionRow.razor.css +++ b/FoodsharingSiegen.Server/Controls/InteractionRow.razor.css @@ -1,3 +1,7 @@ tr.done th { color: #64ae24; +} + +tr.notneeded { + filter: grayscale(100%); } \ No newline at end of file diff --git a/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor b/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor index 102201f..19ef1ed 100644 --- a/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor +++ b/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor @@ -7,11 +7,22 @@ + @if (_showNotNeeded) + { +
+
+ + Nicht benötigt + +
+
+ } +
Wer? - @foreach (var user in Users ?? new List()) { @user.Name @@ -30,7 +41,8 @@ @if (_showInfo) { - + @_infoName + } diff --git a/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs b/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs index 17dd49a..e83eaa0 100644 --- a/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs +++ b/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs @@ -21,6 +21,7 @@ namespace FoodsharingSiegen.Server.Dialogs private string _header; private string _infoName; private bool _showInfo; + private bool _showNotNeeded; protected override async Task OnParametersSetAsync() { @@ -40,7 +41,7 @@ namespace FoodsharingSiegen.Server.Dialogs case InteractionType.EinAb: _header = "Einführung eintragen"; _showInfo = true; - _infoName = "Betrieb"; + _infoName = "Welcher Betrieb?"; break; case InteractionType.Welcome: _header = "Begrüßung eintragen"; @@ -51,10 +52,12 @@ namespace FoodsharingSiegen.Server.Dialogs break; case InteractionType.PrintPass: _header = "FS-Ausweis (Print)"; + _showNotNeeded = true; _showInfo = true; break; case InteractionType.PdfPass: _header = "FS-Ausweis (PDF)"; + _showNotNeeded = true; _showInfo = true; break; case InteractionType.Verify: diff --git a/FoodsharingSiegen.Server/Pages/Prospects.razor b/FoodsharingSiegen.Server/Pages/Prospects.razor index bf4d4a2..db48493 100644 --- a/FoodsharingSiegen.Server/Pages/Prospects.razor +++ b/FoodsharingSiegen.Server/Pages/Prospects.razor @@ -11,19 +11,35 @@ -
- - - -
+@{ + var activeProspects = ProspectList?.Where(x => x.Interactions.All(i => i.Type != InteractionType.Complete)); +} +@if (activeProspects?.Any() == true) +{ +
+

Aktuell:

+
+ + + +
+} + + +@{ + var completedProspects = ProspectList?.Where(x => x.Interactions.Any(i => i.Type == InteractionType.Complete)); +} +@if (completedProspects?.Any() == true) +{ +
+

Abgeschlossen:

+
+ + + +
+} -
-

Abgeschlossen

-
- - - -
\ No newline at end of file