Fix transaction dropdowns

As brought up by @kukks with [this comment](https://github.com/btcpayserver/btcpayserver/pull/1434#issuecomment-609720019). The problem exists across themes, so the fix is separated from the originating PR.
This commit is contained in:
Dennis Reimann 2020-04-06 18:16:41 +02:00
parent 9fc451c9ca
commit 829b0dd5e2
No known key found for this signature in database
GPG Key ID: 5009E1797F03F8D0

View File

@ -137,25 +137,28 @@
<div class="dropdown" style="display:inline-block;">
<span class="fa fa-tags" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
<div class="dropdown-menu">
<form asp-action="ModifyTransaction" method="post"
<form asp-action="ModifyTransaction" method="post"
asp-route-walletId="@this.Context.GetRouteValue("walletId")">
<input type="hidden" name="transactionId" value="@transaction.Id" />
<div class="dropdown-item input-group">
<div class="input-group p-2">
<input name="addlabel" placeholder="Label name" maxlength="20" type="text" class="form-control form-control-sm" />
<div class="input-group-append">
<button type="submit" class="btn btn-primary btn-sm"><span class="fa fa-plus"></span></button>
</div>
</div>
<div class="dropdown-divider"></div>
@foreach (var label in Model.Labels)
@if (Model.Labels.Count > 0)
{
@if (transaction.Labels.Contains(label))
<div class="dropdown-divider"></div>
@foreach (var label in Model.Labels)
{
<button name="removelabel" type="submit" class="dropdown-item" value="@label.Value"><span class="badge" style="display:block;background-color:@label.Color;color:white;text-align:left;"><span class="fa fa-check"></span> @label.Value</span></button>
}
else
{
<button name="addlabelclick" type="submit" class="dropdown-item" value="@label.Value"><span class="badge" style="display:block;background-color:@label.Color;color:white;text-align:left;">@label.Value</span></button>
@if (transaction.Labels.Contains(label))
{
<button name="removelabel" class="btn btn-sm" type="submit" value="@label.Value"><span class="badge" style="display:block;background-color:@label.Color;color:white;text-align:left;"><span class="fa fa-check"></span> @label.Value</span></button>
}
else
{
<button name="addlabelclick" class="btn btn-sm" type="submit" value="@label.Value"><span class="badge" style="display:block;background-color:@label.Color;color:white;text-align:left;">@label.Value</span></button>
}
}
}
</form>
@ -171,11 +174,15 @@
<span class="fa fa-commenting" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
}
<div class="dropdown-menu">
<form asp-action="ModifyTransaction" method="post"
<form asp-action="ModifyTransaction" method="post"
asp-route-walletId="@this.Context.GetRouteValue("walletId")">
<input type="hidden" name="transactionId" value="@transaction.Id" />
<textarea name="addcomment" class="dropdown-item" maxlength="200" rows="2" cols="20">@transaction.Comment</textarea>
<div class="dropdown-item"><button type="submit" class="btn btn-primary">Save comment</button></div>
<div class="input-group p-2">
<textarea name="addcomment" maxlength="200" rows="2" cols="20" class="form-control form-control-sm">@transaction.Comment</textarea>
</div>
<div class="p-2">
<button type="submit" class="btn btn-primary">Save comment</button>
</div>
</form>
</div>
</div>