Interactions als Notneeded markieren
This commit is contained in:
@@ -32,11 +32,14 @@
|
||||
private List<Interaction> Interactions => Prospect?.Interactions?.Where(x => x.Type == Type).ToList() ?? new List<Interaction>();
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
<tr class="@rowClass" style="border-top: 5px solid transparent;">
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
tr.done th {
|
||||
color: #64ae24;
|
||||
}
|
||||
|
||||
tr.notneeded {
|
||||
filter: grayscale(100%);
|
||||
}
|
||||
@@ -7,11 +7,22 @@
|
||||
<CloseButton/>
|
||||
</ModalHeader>
|
||||
<ModalBody>
|
||||
@if (_showNotNeeded)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<Field>
|
||||
<Switch TValue="bool" @bind-Checked="Interaction.NotNeeded" >Nicht benötigt</Switch>
|
||||
</Field>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<Field>
|
||||
<FieldLabel>Wer?</FieldLabel>
|
||||
<Select TValue="Guid" @bind-SelectedValue="SelectedUser" id="aim-userselect">
|
||||
<Select TValue="Guid" @bind-SelectedValue="SelectedUser">
|
||||
@foreach (var user in Users ?? new List<User>())
|
||||
{
|
||||
<SelectItem Value="@user.Id">@user.Name</SelectItem>
|
||||
@@ -30,7 +41,8 @@
|
||||
@if (_showInfo)
|
||||
{
|
||||
<Field>
|
||||
<MemoEdit @bind-Text="Interaction.Info" Placeholder="@_infoName" Rows="5"/>
|
||||
<FieldLabel>@_infoName</FieldLabel>
|
||||
<TextEdit @bind-Text="Interaction.Info"></TextEdit>
|
||||
</Field>
|
||||
}
|
||||
</ModalBody>
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -11,19 +11,35 @@
|
||||
|
||||
<Button Color="Color.Primary" Clicked="() => ProspectModal.Show()">Hinzufügen</Button>
|
||||
|
||||
<div class="row">
|
||||
<Repeater Items="@ProspectList?.Where(x => x.Interactions.All(i => i.Type != InteractionType.Complete))">
|
||||
@{
|
||||
var activeProspects = ProspectList?.Where(x => x.Interactions.All(i => i.Type != InteractionType.Complete));
|
||||
}
|
||||
@if (activeProspects?.Any() == true)
|
||||
{
|
||||
<hr />
|
||||
<h4>Aktuell:</h4>
|
||||
<div class="row">
|
||||
<Repeater Items="@activeProspects">
|
||||
<ProspectContainer Prospect="context" InteractionModal="InteractionModal" RemoveInteraction="@RemoveInteraction"></ProspectContainer>
|
||||
</Repeater>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<hr />
|
||||
<h4>Abgeschlossen</h4>
|
||||
<div class="row">
|
||||
<Repeater Items="@ProspectList?.Where(x => x.Interactions.Any(i => i.Type == InteractionType.Complete))">
|
||||
|
||||
@{
|
||||
var completedProspects = ProspectList?.Where(x => x.Interactions.Any(i => i.Type == InteractionType.Complete));
|
||||
}
|
||||
@if (completedProspects?.Any() == true)
|
||||
{
|
||||
<hr />
|
||||
<h4>Abgeschlossen:</h4>
|
||||
<div class="row">
|
||||
<Repeater Items="@completedProspects">
|
||||
<ProspectContainer Prospect="context" InteractionModal="InteractionModal" RemoveInteraction="@RemoveInteraction"></ProspectContainer>
|
||||
</Repeater>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
<AddProspectModal @ref="ProspectModal" OnAdd="OnAddProspect"></AddProspectModal>
|
||||
<AddInteractionModal @ref="InteractionModal" OnAdd="OnAddInteraction" Users="Users"></AddInteractionModal>
|
||||
Reference in New Issue
Block a user