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:
d11n
2022-06-28 05:03:13 +02:00
committed by GitHub
parent 618666abf1
commit 9428347cb6
8 changed files with 205 additions and 161 deletions

View File

@@ -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.");