mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Crowdfund finetuning (#3488)
* Update crowdfund defaults * Crowdfund: Move sound, animation and discussion into additional options * Update sound URLs Fixes #3745. * Update featured image URL label * Improve the recurring goal section * Crowdfund: Goal section finetuning
This commit is contained in:
@@ -32,6 +32,7 @@ namespace BTCPayServer.Controllers
|
||||
return NotFound();
|
||||
|
||||
var settings = app.GetSettings<CrowdfundSettings>();
|
||||
var resetEvery = Enum.GetName(typeof(CrowdfundResetEvery), settings.ResetEvery);
|
||||
var vm = new UpdateCrowdfundViewModel
|
||||
{
|
||||
Title = settings.Title,
|
||||
@@ -57,7 +58,8 @@ namespace BTCPayServer.Controllers
|
||||
DisqusShortname = settings.DisqusShortname,
|
||||
AnimationsEnabled = settings.AnimationsEnabled,
|
||||
ResetEveryAmount = settings.ResetEveryAmount,
|
||||
ResetEvery = Enum.GetName(typeof(CrowdfundResetEvery), settings.ResetEvery),
|
||||
ResetEvery = resetEvery,
|
||||
IsRecurring = resetEvery != nameof(CrowdfundResetEvery.Never),
|
||||
UseAllStoreInvoices = app.TagAllInvoices,
|
||||
AppId = appId,
|
||||
SearchTerm = app.TagAllInvoices ? $"storeid:{app.StoreDataId}" : $"orderid:{AppService.GetCrowdfundOrderId(appId)}",
|
||||
@@ -94,6 +96,11 @@ namespace BTCPayServer.Controllers
|
||||
vm.TargetAmount = null;
|
||||
}
|
||||
|
||||
if (!vm.IsRecurring)
|
||||
{
|
||||
vm.ResetEvery = nameof(CrowdfundResetEvery.Never);
|
||||
}
|
||||
|
||||
if (Enum.Parse<CrowdfundResetEvery>(vm.ResetEvery) != CrowdfundResetEvery.Never && !vm.StartDate.HasValue)
|
||||
{
|
||||
ModelState.AddModelError(nameof(vm.StartDate), "A start date is needed when the goal resets every X amount of time.");
|
||||
|
||||
Reference in New Issue
Block a user