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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 205 additions and 161 deletions

View file

@ -15,7 +15,6 @@ namespace BTCPayServer.Data
public bool TagAllInvoices { get; set; }
public string Settings { get; set; }
internal static void OnModelCreating(ModelBuilder builder)
{
builder.Entity<AppData>()
@ -28,9 +27,7 @@ namespace BTCPayServer.Data
// utility methods
public T GetSettings<T>() where T : class, new()
{
if (String.IsNullOrEmpty(Settings))
return new T();
return JsonConvert.DeserializeObject<T>(Settings);
return string.IsNullOrEmpty(Settings) ? new T() : JsonConvert.DeserializeObject<T>(Settings);
}
public void SetSettings(object value)

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

View file

@ -128,21 +128,20 @@ namespace BTCPayServer.Controllers
var empty = new PointOfSaleSettings { Currency = defaultCurrency };
appData.SetSettings(empty);
break;
default:
throw new ArgumentOutOfRangeException();
}
await _appService.UpdateOrCreateApp(appData);
TempData[WellKnownTempData.SuccessMessage] = "App successfully created";
CreatedAppId = appData.Id;
switch (appType)
return appType switch
{
case AppType.PointOfSale:
return RedirectToAction(nameof(UpdatePointOfSale), new { appId = appData.Id });
case AppType.Crowdfund:
return RedirectToAction(nameof(UpdateCrowdfund), new { appId = appData.Id });
default:
return RedirectToAction(nameof(ListApps), new { storeId = appData.StoreDataId });
}
AppType.PointOfSale => RedirectToAction(nameof(UpdatePointOfSale), new { appId = appData.Id }),
AppType.Crowdfund => RedirectToAction(nameof(UpdateCrowdfund), new { appId = appData.Id }),
_ => throw new ArgumentOutOfRangeException()
};
}
[HttpGet("{appId}/delete")]

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using BTCPayServer.Services.Apps;
using BTCPayServer.Validation;
@ -28,7 +29,7 @@ namespace BTCPayServer.Models.AppViewModels
[Required]
public string Description { get; set; }
[Display(Name = "Featured Image")]
[Display(Name = "Featured Image URL")]
public string MainImageUrl { get; set; }
[Display(Name = "Callback Notification URL")]
@ -68,11 +69,15 @@ namespace BTCPayServer.Models.AppViewModels
[Range(0, double.PositiveInfinity)]
public decimal? TargetAmount { get; set; }
public IEnumerable<string> ResetEveryValues = Enum.GetNames(typeof(CrowdfundResetEvery));
public IEnumerable<string> ResetEveryValues = Enum.GetNames(typeof(CrowdfundResetEvery))
.Where(i => i != nameof(CrowdfundResetEvery.Never));
public bool IsRecurring { get; set; }
[Display(Name = "Reset goal every")]
public string ResetEvery { get; set; } = nameof(CrowdfundResetEvery.Never);
[Display(Name = "Reset goal every")]
public int ResetEveryAmount { get; set; } = 1;
[Display(Name = "Do not allow additional contributions after target has been reached")]

View file

@ -6,12 +6,11 @@ namespace BTCPayServer.Services.Apps
{
public string Title { get; set; }
public string Description { get; set; }
public bool Enabled { get; set; }
public bool Enabled { get; set; } = true;
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public string TargetCurrency { get; set; }
decimal? _TargetAmount;
public decimal? TargetAmount
{
@ -38,7 +37,7 @@ namespace BTCPayServer.Services.Apps
public bool DisqusEnabled { get; set; }
public bool SoundsEnabled { get; set; }
public string DisqusShortname { get; set; }
public bool AnimationsEnabled { get; set; } = true;
public bool AnimationsEnabled { get; set; }
public int ResetEveryAmount { get; set; } = 1;
public CrowdfundResetEvery ResetEvery { get; set; } = CrowdfundResetEvery.Never;
[Obsolete("Use AppData.TagAllInvoices instead")]
@ -53,46 +52,33 @@ namespace BTCPayServer.Services.Apps
public string[] Sounds { get; set; } =
{
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/dominating.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/doublekill.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/doublekill2.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/eagleeye.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/firstblood.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/firstblood2.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/firstblood3.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/flawless.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/godlike.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/hattrick.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/headhunter.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/headshot.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/headshot2.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/headshot3.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/holyshit.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/killingspree.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/knife.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/knife2.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/knife3.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/ludicrouskill.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/megakill.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/monsterkill.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/multikill.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/nade.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/ownage.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/payback.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/prepare.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/prepare2.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/prepare3.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/prepare4.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/rampage.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/suicide.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/suicide2.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/suicide3.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/suicide4.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/teamkiller.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/triplekill.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/ultrakill.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/unstoppable.wav",
"//github.com/ClaudiuHKS/AdvancedQuakeSounds/raw/master/sound/QuakeSounds/whickedsick.wav"
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/dominating.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/doublekill.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/doublekill2.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/eagleeye.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/firstblood.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/firstblood2.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/firstblood3.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/godlike.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/hattrick.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/headhunter.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/headshot.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/headshot2.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/headshot3.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/holyshit.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/killingspree.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/ludicrouskill.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/megakill.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/monsterkill.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/multikill.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/ownage.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/payback.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/rampage.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/teamkiller.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/triplekill.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/ultrakill.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/unstoppable.wav",
"https://github.com/ClaudiuHKS/AdvancedQuakeSounds/tree/master/sound/AQS/whickedsick.wav"
};
}
public enum CrowdfundResetEvery

View file

@ -63,22 +63,24 @@
<textarea asp-for="Description" rows="20" cols="40" class="form-control richtext"></textarea>
<span asp-validation-for="Description" class="text-danger"></span>
</div>
<div class="form-group mb-0">
<div class="d-flex align-items-center mb-3">
<div class="form-group">
<div class="d-flex align-items-center">
<input asp-for="Enabled" type="checkbox" class="btcpay-toggle me-3"/>
<label asp-for="Enabled" class="form-label mb-0"></label>
<div>
<label asp-for="Enabled" class="form-label mb-0"></label>
<span asp-validation-for="Enabled" class="text-danger"></span>
<div class="text-muted" hidden="@Model.Enabled">The crowdfund is only visible to you. To make it visible to anyone else, enable this.</div>
<div class="text-muted" hidden="@(!Model.Enabled)">The crowdfund is visible to anyone. To make it only visible to you, disable this.</div>
</div>
</div>
<span asp-validation-for="Enabled" class="text-danger"></span>
<div class="text-muted" hidden="@Model.Enabled">The crowdfund is only visible to you. To make it visible to anyone else, enable this.</div>
<div class="text-muted" hidden="@(!Model.Enabled)">The crowdfund is visible to anyone. To make it only visible to you, disable this.</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-8 col-xxl-constrain">
<div class="col-xl-10 col-xxl-constrain">
<h3 class="mt-5 mb-4">Goal</h3>
<div class="d-flex justify-content-between">
<div class="form-group flex-fill me-4">
<div class="d-flex flex-wrap gap-3 mb-3">
<div class="form-group w-250px mb-0">
<label asp-for="TargetAmount" class="form-label"></label>
<input inputmode="decimal" asp-for="TargetAmount" class="form-control" />
<span asp-validation-for="TargetAmount" class="text-danger"></span>
@ -90,50 +92,60 @@
<span asp-validation-for="TargetCurrency" class="text-danger"></span>
</div>
</div>
<div class="row g-3">
<div class="col col-12 col-sm-6">
<div class="form-group">
<label asp-for="StartDate" class="form-label"></label>
<div class="input-group flex-nowrap">
<input type="datetime-local" asp-for="StartDate"
value="@(Model.StartDate?.ToString("u", CultureInfo.InvariantCulture))"
class="form-control flatdtpicker"
placeholder="No start date has been set" />
<button class="btn btn-secondary input-group-clear" type="button" title="Clear">
<span class="fa fa-times"></span>
</button>
</div>
<span asp-validation-for="StartDate" class="text-danger"></span>
<div class="d-flex flex-wrap gap-3 align-items-center mb-4">
<div class="form-group mb-0 w-250px">
<label asp-for="StartDate" class="form-label"></label>
<div class="input-group flex-nowrap">
<input type="datetime-local" asp-for="StartDate"
value="@(Model.StartDate?.ToString("u", CultureInfo.InvariantCulture))"
class="form-control flatdtpicker"
placeholder="No start date has been set" />
<button class="btn btn-secondary input-group-clear px-3" type="button" title="Clear">
<vc:icon symbol="close"/>
</button>
</div>
<span asp-validation-for="StartDate" class="text-danger"></span>
</div>
<div class="col col-12 col-sm-6">
<div class="form-group">
<label asp-for="EndDate" class="form-label"></label>
<div class="input-group flex-nowrap">
<input type="datetime-local" asp-for="EndDate"
value="@(Model.EndDate?.ToString("u", CultureInfo.InvariantCulture))"
class="form-control flatdtpicker"
placeholder="No end date has been set" />
<button class="btn btn-secondary input-group-clear input-group-text" type="button" title="Clear">
<span class="fa fa-times"></span>
</button>
</div>
<span asp-validation-for="EndDate" class="text-danger"></span>
<div class="form-group mb-0 w-250px">
<label asp-for="EndDate" class="form-label"></label>
<div class="input-group flex-nowrap">
<input type="datetime-local" asp-for="EndDate"
value="@(Model.EndDate?.ToString("u", CultureInfo.InvariantCulture))"
class="form-control flatdtpicker"
placeholder="No end date has been set" />
<button class="btn btn-secondary input-group-clear px-3" type="button" title="Clear">
<vc:icon symbol="close"/>
</button>
</div>
<span asp-validation-for="EndDate" class="text-danger"></span>
</div>
</div>
<div class="form-group mb-0" id="ResetRow" hidden="@(Model.StartDate == null)">
<label asp-for="ResetEvery" class="form-label"></label>
<div class="input-group">
<input type="number" inputmode="numeric" asp-for="ResetEveryAmount" placeholder="Amount" class="form-control" min="0">
<select class="form-select" asp-for="ResetEvery">
@foreach (var opt in Model.ResetEveryValues)
{
<option value="@opt">@opt</option>
}
</select>
<div class="form-group mt-4" id="ResetRow" hidden="@(Model.StartDate == null)">
<div class="d-flex align-items-center mb-3">
<input asp-for="IsRecurring" type="checkbox" class="btcpay-toggle me-3" data-bs-toggle="collapse" data-bs-target="#ResetEverySettings" aria-expanded="@(Model.IsRecurring)" aria-controls="ResetEverySettings" />
<div>
<label asp-for="IsRecurring" class="form-label mb-0">Recurring Goal</label>
<span asp-validation-for="IsRecurring" class="text-danger"></span>
<div class="text-muted">Reset goal after a specific period of time, based on your crowdfund's start date.</div>
</div>
</div>
<div class="collapse @(Model.IsRecurring ? "show" : "")" id="ResetEverySettings">
<div class="form-group mb-0 pt-2 w-250px">
<label asp-for="ResetEveryAmount" class="form-label"></label>
<div class="d-flex align-items-center">
<input type="number" inputmode="numeric" asp-for="ResetEveryAmount" placeholder="Amount" class="form-control me-3" min="0">
<select class="form-select w-auto" asp-for="ResetEvery">
@foreach (var opt in Model.ResetEveryValues)
{
<option value="@opt">@opt</option>
}
</select>
</div>
<span asp-validation-for="ResetEveryAmount" class="text-danger"></span>
</div>
</div>
<span asp-validation-for="ResetEveryAmount" class="text-danger"></span>
</div>
</div>
</div>
@ -181,58 +193,88 @@
<label asp-for="UseAllStoreInvoices" class="form-check-label"></label>
<span asp-validation-for="UseAllStoreInvoices" class="text-danger"></span>
</div>
<h3 class="mt-5 mb-4">Sound</h3>
<div class="form-group mb-0">
<div class="d-flex align-items-center">
<input asp-for="SoundsEnabled" type="checkbox" class="btcpay-toggle me-3" data-bs-toggle="collapse" data-bs-target="#SoundsEnabledSettings" aria-expanded="@Model.SoundsEnabled" aria-controls="SoundsEnabledSettings"/>
<label asp-for="SoundsEnabled" class="form-label mb-0"></label>
<span asp-validation-for="SoundsEnabled" class="text-danger"></span>
</div>
</div>
<div class="collapse @(Model.SoundsEnabled ? "show" : "")" id="SoundsEnabledSettings">
<div class="form-group mb-0 pt-3">
<label asp-for="Sounds" class="form-label"></label>
<textarea asp-for="Sounds" class="form-control"></textarea>
<span asp-validation-for="Sounds" class="text-danger"></span>
</div>
</div>
<h3 class="mt-5 mb-4">Animation</h3>
<div class="form-group mb-3">
<div class="d-flex align-items-center">
<input asp-for="AnimationsEnabled" type="checkbox" class="btcpay-toggle me-3" data-bs-toggle="collapse" data-bs-target="#AnimationsEnabledSettings" aria-expanded="@Model.AnimationsEnabled" aria-controls="AnimationsEnabledSettings"/>
<label asp-for="AnimationsEnabled" class="form-label mb-0"></label>
<span asp-validation-for="AnimationsEnabled" class="text-danger"></span>
</div>
</div>
<div class="collapse @(Model.AnimationsEnabled ? "show" : "")" id="AnimationsEnabledSettings">
<div class="form-group mb-0 pt-3">
<label asp-for="AnimationColors" class="form-label"></label>
<textarea asp-for="AnimationColors" class="form-control"></textarea>
<span asp-validation-for="AnimationColors" class="text-danger"></span>
</div>
</div>
<h3 class="mt-5 mb-4">Discussion</h3>
<div class="form-group mb-3">
<div class="d-flex align-items-center">
<input asp-for="DisqusEnabled" type="checkbox" class="btcpay-toggle me-3" data-bs-toggle="collapse" data-bs-target="#DisqusEnabledSettings" aria-expanded="@Model.DisqusEnabled" aria-controls="DisqusEnabledSettings"/>
<label asp-for="DisqusEnabled" class="form-label mb-0"></label>
<span asp-validation-for="DisqusEnabled" class="text-danger"></span>
</div>
</div>
<div class="collapse @(Model.DisqusEnabled ? "show" : "")" id="DisqusEnabledSettings">
<div class="form-group mb-0 pt-3">
<label asp-for="DisqusShortname" class="form-label"></label>
<input asp-for="DisqusShortname" class="form-control" />
<span asp-validation-for="DisqusShortname" class="text-danger"></span>
</div>
</div>
<h3 class="mt-5 mb-2">Additional Options</h3>
<div class="form-group">
<div class="accordion" id="additional">
<div class="accordion-item">
<h2 class="accordion-header" id="additional-sound-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#additional-sound" aria-expanded="false" aria-controls="additional-sound">
Sound
<vc:icon symbol="caret-down" />
</button>
</h2>
<div id="additional-sound" class="accordion-collapse collapse" aria-labelledby="additional-sound-header">
<div class="accordion-body">
<div class="form-group mb-0">
<div class="d-flex align-items-center">
<input asp-for="SoundsEnabled" type="checkbox" class="btcpay-toggle me-3" data-bs-toggle="collapse" data-bs-target="#SoundsEnabledSettings" aria-expanded="@Model.SoundsEnabled" aria-controls="SoundsEnabledSettings"/>
<label asp-for="SoundsEnabled" class="form-label mb-0"></label>
<span asp-validation-for="SoundsEnabled" class="text-danger"></span>
</div>
</div>
<div class="collapse @(Model.SoundsEnabled ? "show" : "")" id="SoundsEnabledSettings">
<div class="form-group mb-0 pt-3">
<label asp-for="Sounds" class="form-label"></label>
<textarea asp-for="Sounds" class="form-control" rows="5"></textarea>
<span asp-validation-for="Sounds" class="text-danger"></span>
</div>
</div>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="additional-animation-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#additional-animation" aria-expanded="false" aria-controls="additional-animation">
Animation
<vc:icon symbol="caret-down" />
</button>
</h2>
<div id="additional-animation" class="accordion-collapse collapse" aria-labelledby="additional-animation-header">
<div class="accordion-body">
<div class="form-group mb-0">
<div class="d-flex align-items-center">
<input asp-for="AnimationsEnabled" type="checkbox" class="btcpay-toggle me-3" data-bs-toggle="collapse" data-bs-target="#AnimationsEnabledSettings" aria-expanded="@Model.AnimationsEnabled" aria-controls="AnimationsEnabledSettings"/>
<label asp-for="AnimationsEnabled" class="form-label mb-0"></label>
<span asp-validation-for="AnimationsEnabled" class="text-danger"></span>
</div>
</div>
<div class="collapse @(Model.AnimationsEnabled ? "show" : "")" id="AnimationsEnabledSettings">
<div class="form-group mb-0 pt-3">
<label asp-for="AnimationColors" class="form-label"></label>
<textarea asp-for="AnimationColors" class="form-control" rows="5"></textarea>
<span asp-validation-for="AnimationColors" class="text-danger"></span>
</div>
</div>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="additional-discussion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#additional-discussion" aria-expanded="false" aria-controls="additional-discussion">
Discussion
<vc:icon symbol="caret-down" />
</button>
</h2>
<div id="additional-discussion" class="accordion-collapse collapse" aria-labelledby="additional-discussion-header">
<div class="accordion-body">
<div class="form-group mb-0">
<div class="d-flex align-items-center">
<input asp-for="DisqusEnabled" type="checkbox" class="btcpay-toggle me-3" data-bs-toggle="collapse" data-bs-target="#DisqusEnabledSettings" aria-expanded="@Model.DisqusEnabled" aria-controls="DisqusEnabledSettings"/>
<label asp-for="DisqusEnabled" class="form-label mb-0"></label>
<span asp-validation-for="DisqusEnabled" class="text-danger"></span>
</div>
</div>
<div class="collapse @(Model.DisqusEnabled ? "show" : "")" id="DisqusEnabledSettings">
<div class="form-group mb-0 pt-3">
<label asp-for="DisqusShortname" class="form-label"></label>
<input asp-for="DisqusShortname" class="form-control" />
<span asp-validation-for="DisqusShortname" class="text-danger"></span>
</div>
</div>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="additional-custom-css-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#additional-custom-css" aria-expanded="false" aria-controls="additional-custom-css">
@ -306,7 +348,7 @@
// Show the reset row if start date is selected.
// Since start date must be selected in order for the reset options to be set
// we don't need to show it by default and can show it only when start date is selected
resetRow.removeAttribute('hidden');
resetRow.removeAttribute('hidden');
}
});
}

View file

@ -20,6 +20,10 @@ hr.primary {
display: none;
}
.input-group-clear .icon {
--btn-icon-size: .65rem;
}
.note-editable {
color: var(--btcpay-form-text);
background-color: var(--btcpay-form-bg);
@ -219,6 +223,7 @@ h2 small .fa-question-circle-o {
border: 1px dotted var(--btcpay-neutral-400);
}
/* Icons */
svg.icon {
display: inline-block;
width: 1rem;

View file

@ -96,12 +96,12 @@
right: 50%;
}
.flatpickr-calendar:before {
border-width: 5px;
margin: 0 -5px;
border-width: 8px;
margin: 0 -8px;
}
.flatpickr-calendar:after {
border-width: 4px;
margin: 0 -4px;
border-width: 7px;
margin: 0 -7px;
}
.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after {
@ -111,7 +111,7 @@
border-bottom-color: var(--btcpay-body-border-medium);
}
.flatpickr-calendar.arrowTop:after {
border-bottom-color: #fff;
border-bottom-color: var(--btcpay-body-border-medium);
}
.flatpickr-calendar.arrowBottom:before,
.flatpickr-calendar.arrowBottom:after {
@ -121,7 +121,7 @@
border-top-color: var(--btcpay-body-border-medium);
}
.flatpickr-calendar.arrowBottom:after {
border-top-color: #fff;
border-top-color: var(--btcpay-body-border-medium);
}
.flatpickr-calendar:focus {
outline: 0;
@ -754,6 +754,9 @@ span.flatpickr-weekday {
text-align: center;
font-weight: 400;
}
.flatdtpicker[readonly] {
background-color: var(--btcpay-form-bg);
}
.flatpickr-input[readonly] {
cursor: pointer;
}