mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-11 01:35:22 +01:00
Tweaking display with display name and crypto code
This commit is contained in:
parent
c44132fd35
commit
d49bbc95af
4 changed files with 27 additions and 11 deletions
|
@ -248,8 +248,8 @@ namespace BTCPayServer.Controllers
|
|||
{
|
||||
CryptoCode = network.CryptoCode,
|
||||
PaymentMethodId = paymentMethodId.ToString(),
|
||||
PaymentMethodName = network.DisplayName,
|
||||
CryptoImage = "/" + GetImage(paymentMethodId, network),
|
||||
PaymentMethodName = GetDisplayName(paymentMethodId, network),
|
||||
CryptoImage = GetImage(paymentMethodId, network),
|
||||
IsLightning = paymentMethodId.PaymentType == PaymentTypes.LightningLike,
|
||||
ServerUrl = HttpContext.Request.GetAbsoluteRoot(),
|
||||
OrderId = invoice.OrderId,
|
||||
|
@ -289,9 +289,10 @@ namespace BTCPayServer.Controllers
|
|||
.Select(kv => new PaymentModel.AvailableCrypto()
|
||||
{
|
||||
PaymentMethodId = kv.GetId().ToString(),
|
||||
PaymentMethodName = kv.Network.DisplayName,
|
||||
CryptoCode = kv.GetId().CryptoCode,
|
||||
PaymentMethodName = GetDisplayName(kv.GetId(), kv.Network),
|
||||
LightningLike = kv.GetId().PaymentType == PaymentTypes.LightningLike,
|
||||
CryptoImage = "/" + GetImage(kv.GetId(), kv.Network),
|
||||
CryptoImage = GetImage(kv.GetId(), kv.Network),
|
||||
Link = Url.Action(nameof(Checkout), new { invoiceId = invoiceId, paymentMethodId = kv.GetId().ToString() })
|
||||
}).Where(c => c.CryptoImage != "/")
|
||||
.OrderBy(a => a.PaymentMethodName).ThenBy(a => a.LightningLike ? 1 : 0)
|
||||
|
@ -303,9 +304,17 @@ namespace BTCPayServer.Controllers
|
|||
return model;
|
||||
}
|
||||
|
||||
private string GetDisplayName(PaymentMethodId paymentMethodId, BTCPayNetwork network)
|
||||
{
|
||||
return paymentMethodId.PaymentType == PaymentTypes.BTCLike ?
|
||||
network.DisplayName : network.DisplayName + " - Lightning Network";
|
||||
}
|
||||
|
||||
private string GetImage(PaymentMethodId paymentMethodId, BTCPayNetwork network)
|
||||
{
|
||||
return (paymentMethodId.PaymentType == PaymentTypes.BTCLike ? Url.Content(network.CryptoImagePath) : Url.Content(network.LightningImagePath));
|
||||
var res = paymentMethodId.PaymentType == PaymentTypes.BTCLike ?
|
||||
Url.Content(network.CryptoImagePath) : Url.Content(network.LightningImagePath);
|
||||
return "/" + res;
|
||||
}
|
||||
|
||||
private string OrderAmountFromInvoice(string cryptoCode, ProductInformation productInformation)
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace BTCPayServer.Models.InvoicingModels
|
|||
public string Link { get; set; }
|
||||
public string PaymentMethodName { get; set; }
|
||||
public bool LightningLike { get; set; }
|
||||
public string CryptoCode { get; set; }
|
||||
}
|
||||
public string HtmlTitle { get; set; }
|
||||
public string CustomCSSLink { get; set; }
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
<a href="@crypto.Link" onclick="return closeVexChangeCurrency('@crypto.PaymentMethodId');">
|
||||
<img style="height:24px;" alt="@crypto.PaymentMethodId" src="@crypto.CryptoImage" />
|
||||
@crypto.PaymentMethodName
|
||||
<span>@crypto.CryptoCode</span>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
|
|
|
@ -19,13 +19,18 @@
|
|||
display: block;
|
||||
}
|
||||
|
||||
.vexmenuitem:hover {
|
||||
background-color: #eee;
|
||||
}
|
||||
.vexmenuitem a span {
|
||||
float: right;
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.vexmenuitem:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.vexmenuitem:hover {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.vexmenuitem:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
#vexPopupDialog {
|
||||
display: none;
|
||||
|
|
Loading…
Add table
Reference in a new issue