47 lines
1.6 KiB
Plaintext
47 lines
1.6 KiB
Plaintext
@using EnvelopeGenerator.Domain.Entities;
|
|
@using EnvelopeGenerator.Domain.Constants;
|
|
@using EnvelopeGenerator.Application.Extensions;
|
|
@{
|
|
ViewData["Title"] = "Debug";
|
|
}
|
|
|
|
@functions {
|
|
string encodeEnvelopeKey(Envelope envelope)
|
|
{
|
|
var receiver = envelope.EnvelopeReceivers!.First();
|
|
return (envelope.Uuid, receiver.Receiver!.Signature).ToEnvelopeKey();
|
|
}
|
|
|
|
IEnumerable<IGrouping<EnvelopeStatus, Envelope>> groupEnvelopes(List<Envelope> envelopes)
|
|
{
|
|
return envelopes.GroupBy(item => (EnvelopeStatus) item.Status).OrderBy(item => item.Key);
|
|
}
|
|
}
|
|
|
|
<div class="container">
|
|
<section>
|
|
@foreach (IGrouping<EnvelopeStatus, Envelope> group in groupEnvelopes((List<Envelope>)@Model))
|
|
{
|
|
<section>
|
|
<h2>@group.Key.ToString() @group.Count()</h2>
|
|
|
|
<details>
|
|
<summary>Show envelopes</summary>
|
|
@foreach (Envelope envelope in @group)
|
|
{
|
|
<section>
|
|
<article class="envelope">
|
|
<strong><a href="/EnvelopeKey/@encodeEnvelopeKey(envelope)">@envelope.Title</a></strong>
|
|
<div><strong>Ersteller</strong> @envelope.User.Email</div>
|
|
<div><strong>Datum</strong> @envelope.AddedWhen</div>
|
|
</article>
|
|
</section>
|
|
|
|
}
|
|
</details>
|
|
|
|
<hr />
|
|
</section>
|
|
}
|
|
</section>
|
|
</div> |