mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-21 14:04:12 +01:00
Merge pull request #2113 from bolatovumar/feat/add-pull-payment-css
Add ability to add custom CSS to pull payments
This commit is contained in:
commit
c8a9b66694
4 changed files with 29 additions and 6 deletions
|
@ -30,7 +30,9 @@ namespace BTCPayServer.Controllers
|
||||||
return View(new NewPullPaymentModel()
|
return View(new NewPullPaymentModel()
|
||||||
{
|
{
|
||||||
Name = "",
|
Name = "",
|
||||||
Currency = "BTC"
|
Currency = "BTC",
|
||||||
|
CustomCSSLink = "",
|
||||||
|
EmbeddedCSS = "",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +67,9 @@ namespace BTCPayServer.Controllers
|
||||||
Amount = model.Amount,
|
Amount = model.Amount,
|
||||||
Currency = model.Currency,
|
Currency = model.Currency,
|
||||||
StoreId = walletId.StoreId,
|
StoreId = walletId.StoreId,
|
||||||
PaymentMethodIds = new[] { paymentMethodId }
|
PaymentMethodIds = new[] { paymentMethodId },
|
||||||
|
EmbeddedCSS = model.EmbeddedCSS,
|
||||||
|
CustomCSSLink = model.CustomCSSLink
|
||||||
});
|
});
|
||||||
this.TempData.SetStatusMessageModel(new StatusMessageModel()
|
this.TempData.SetStatusMessageModel(new StatusMessageModel()
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,6 +29,8 @@ namespace BTCPayServer.HostedServices
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public decimal Amount { get; set; }
|
public decimal Amount { get; set; }
|
||||||
public string Currency { get; set; }
|
public string Currency { get; set; }
|
||||||
|
public string CustomCSSLink { get; set; }
|
||||||
|
public string EmbeddedCSS { get; set; }
|
||||||
public PaymentMethodId[] PaymentMethodIds { get; set; }
|
public PaymentMethodId[] PaymentMethodIds { get; set; }
|
||||||
public TimeSpan? Period { get; set; }
|
public TimeSpan? Period { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -110,9 +112,9 @@ namespace BTCPayServer.HostedServices
|
||||||
{
|
{
|
||||||
Title = create.Name ?? string.Empty,
|
Title = create.Name ?? string.Empty,
|
||||||
Description = string.Empty,
|
Description = string.Empty,
|
||||||
CustomCSSLink = null,
|
CustomCSSLink = create.CustomCSSLink,
|
||||||
Email = null,
|
Email = null,
|
||||||
EmbeddedCSS = null,
|
EmbeddedCSS = create.EmbeddedCSS,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ctx.PullPayments.Add(o);
|
ctx.PullPayments.Add(o);
|
||||||
|
|
|
@ -42,5 +42,10 @@ namespace BTCPayServer.Models.WalletViewModels
|
||||||
[Required]
|
[Required]
|
||||||
[ReadOnly(true)]
|
[ReadOnly(true)]
|
||||||
public string Currency { get; set; }
|
public string Currency { get; set; }
|
||||||
|
[MaxLength(500)]
|
||||||
|
[Display(Name = "Custom bootstrap CSS file")]
|
||||||
|
public string CustomCSSLink { get; set; }
|
||||||
|
[Display(Name = "Custom CSS Code")]
|
||||||
|
public string EmbeddedCSS { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
@model NewPullPaymentModel
|
@model NewPullPaymentModel
|
||||||
@{
|
@{
|
||||||
Layout = "../Shared/_NavLayout.cshtml";
|
Layout = "../Shared/_NavLayout.cshtml";
|
||||||
ViewData["Title"] = "Manage pull payments";
|
ViewData["Title"] = "New pull payment";
|
||||||
ViewData.SetActivePageAndTitle(WalletsNavPages.PullPayments);
|
|
||||||
}
|
}
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.smMaxWidth {
|
.smMaxWidth {
|
||||||
|
@ -79,6 +78,19 @@
|
||||||
<span asp-validation-for="Currency" class="text-danger"></span>
|
<span asp-validation-for="Currency" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label asp-for="CustomCSSLink" class="control-label"></label>
|
||||||
|
<a href="https://docs.btcpayserver.org/Theme/#2-bootstrap-themes" target="_blank">
|
||||||
|
<span class="fa fa-question-circle-o" title="More information..."></span>
|
||||||
|
</a>
|
||||||
|
<input asp-for="CustomCSSLink" class="form-control" />
|
||||||
|
<span asp-validation-for="CustomCSSLink" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label asp-for="EmbeddedCSS" class="control-label"></label>
|
||||||
|
<textarea asp-for="EmbeddedCSS" rows="10" cols="40" class="form-control"></textarea>
|
||||||
|
<span asp-validation-for="EmbeddedCSS" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="submit" value="Create" class="btn btn-primary" id="Create" />
|
<input type="submit" value="Create" class="btn btn-primary" id="Create" />
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue