mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Updating idents, code formatting
This commit is contained in:
@@ -70,7 +70,7 @@ namespace BTCPayServer.Controllers
|
||||
[Route("{appId}/settings/crowdfund")]
|
||||
public async Task<IActionResult> UpdateCrowdfund(string appId, UpdateCrowdfundViewModel vm, string command)
|
||||
{
|
||||
if (!string.IsNullOrEmpty( vm.TargetCurrency) && _currencies.GetCurrencyData(vm.TargetCurrency, false) == null)
|
||||
if (!string.IsNullOrEmpty(vm.TargetCurrency) && _currencies.GetCurrencyData(vm.TargetCurrency, false) == null)
|
||||
ModelState.AddModelError(nameof(vm.TargetCurrency), "Invalid currency");
|
||||
|
||||
try
|
||||
@@ -98,7 +98,7 @@ namespace BTCPayServer.Controllers
|
||||
}
|
||||
|
||||
var parsedSounds = vm.Sounds.Split(
|
||||
new[] {"\r\n", "\r", "\n"},
|
||||
new[] { "\r\n", "\r", "\n" },
|
||||
StringSplitOptions.None
|
||||
).Select(s => s.Trim()).ToArray();
|
||||
if (vm.SoundsEnabled && !parsedSounds.Any())
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace BTCPayServer.Controllers
|
||||
NotificationEmail = settings.NotificationEmail,
|
||||
NotificationUrl = settings.NotificationUrl,
|
||||
SearchTerm = $"storeid:{app.StoreDataId}",
|
||||
RedirectAutomatically = settings.RedirectAutomatically.HasValue? settings.RedirectAutomatically.Value? "true": "false" : ""
|
||||
RedirectAutomatically = settings.RedirectAutomatically.HasValue ? settings.RedirectAutomatically.Value ? "true" : "false" : ""
|
||||
};
|
||||
if (HttpContext?.Request != null)
|
||||
{
|
||||
@@ -197,7 +197,7 @@ namespace BTCPayServer.Controllers
|
||||
NotificationEmail = vm.NotificationEmail,
|
||||
Description = vm.Description,
|
||||
EmbeddedCSS = vm.EmbeddedCSS,
|
||||
RedirectAutomatically = string.IsNullOrEmpty(vm.RedirectAutomatically)? (bool?) null: bool.Parse(vm.RedirectAutomatically)
|
||||
RedirectAutomatically = string.IsNullOrEmpty(vm.RedirectAutomatically) ? (bool?)null : bool.Parse(vm.RedirectAutomatically)
|
||||
|
||||
});
|
||||
await _AppService.UpdateOrCreateApp(app);
|
||||
|
||||
@@ -10,11 +10,15 @@ namespace BTCPayServer.Models.AppViewModels
|
||||
public class UpdateCrowdfundViewModel
|
||||
{
|
||||
public string StoreId { get; set; }
|
||||
[Required] [MaxLength(30)] public string Title { get; set; }
|
||||
[Required]
|
||||
[MaxLength(30)]
|
||||
public string Title { get; set; }
|
||||
|
||||
[MaxLength(50)] public string Tagline { get; set; }
|
||||
[MaxLength(50)]
|
||||
public string Tagline { get; set; }
|
||||
|
||||
[Required] public string Description { get; set; }
|
||||
[Required]
|
||||
public string Description { get; set; }
|
||||
|
||||
[Display(Name = "Featured Image")]
|
||||
public string MainImageUrl { get; set; }
|
||||
@@ -59,7 +63,8 @@ namespace BTCPayServer.Models.AppViewModels
|
||||
|
||||
public IEnumerable<string> ResetEveryValues = Enum.GetNames(typeof(CrowdfundResetEvery));
|
||||
|
||||
[Display(Name = "Reset goal every")] public string ResetEvery { get; set; } = nameof(CrowdfundResetEvery.Never);
|
||||
[Display(Name = "Reset goal every")]
|
||||
public string ResetEvery { get; set; } = nameof(CrowdfundResetEvery.Never);
|
||||
|
||||
public int ResetEveryAmount { get; set; } = 1;
|
||||
|
||||
@@ -90,10 +95,18 @@ namespace BTCPayServer.Models.AppViewModels
|
||||
|
||||
|
||||
[Display(Name = "Sounds to play when a payment is made. One sound per line")]
|
||||
public string Sounds{ get; set; }
|
||||
public string Sounds { get; set; }
|
||||
[Display(Name = "Colors to rotate between with animation when a payment is made. First color is the default background. One color per line. Can be any valid css color value.")]
|
||||
public string AnimationColors{ get; set; }
|
||||
public string AnimationColors { get; set; }
|
||||
|
||||
public bool NotificationEmailWarning { get; set; }
|
||||
|
||||
|
||||
// NOTE: Improve validation if needed
|
||||
public bool ModelWithMinimumData
|
||||
{
|
||||
get { return Description != null && Title != null && TargetCurrency != null; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,8 +263,7 @@
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<label>Price</label>*
|
||||
<input
|
||||
class="js-product-price form-control mb-2"
|
||||
<input class="js-product-price form-control mb-2"
|
||||
inputmode="numeric"
|
||||
pattern="\d*"
|
||||
step="any"
|
||||
@@ -293,7 +292,7 @@
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<label>Inventory (leave blank to not use inventory feature)</label>
|
||||
<input type="number" step="1" class="js-product-inventory form-control mb-2" value="{inventory}"/>
|
||||
<input type="number" step="1" class="js-product-inventory form-control mb-2" value="{inventory}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -261,8 +261,7 @@
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<label>Price</label>*
|
||||
<input
|
||||
class="js-product-price form-control mb-2"
|
||||
<input class="js-product-price form-control mb-2"
|
||||
inputmode="numeric"
|
||||
pattern="\d*"
|
||||
type="number"
|
||||
@@ -290,7 +289,7 @@
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<label>Inventory (leave blank to not use inventory feature)</label>
|
||||
<input type="number" step="1" class="js-product-inventory form-control mb-2" value="{inventory}"/>
|
||||
<input type="number" step="1" class="js-product-inventory form-control mb-2" value="{inventory}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -38,12 +38,12 @@
|
||||
|
||||
</head>
|
||||
<body>
|
||||
@if (Context.Request.Query.ContainsKey("simple"))
|
||||
{
|
||||
@if (Context.Request.Query.ContainsKey("simple"))
|
||||
{
|
||||
@await Html.PartialAsync("/Views/AppsPublic/Crowdfund/MinimalCrowdfund.cshtml", Model)
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
<noscript>
|
||||
@await Html.PartialAsync("/Views/AppsPublic/Crowdfund/MinimalCrowdfund.cshtml", Model)
|
||||
</noscript>
|
||||
@@ -53,7 +53,7 @@ else
|
||||
<canvas id="fireworks"></canvas>
|
||||
}
|
||||
@await Html.PartialAsync("/Views/AppsPublic/Crowdfund/VueCrowdfund.cshtml", Model)
|
||||
}
|
||||
}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user