btcpayserver/BTCPayServer/Views/Shared/Forms/FieldSetElement.cshtml
d11n c777746b69
Custom Forms: Allow HTML in labels and help text (#5136)
* Custom Forms: Allow HTML in labels and help text

Fixes #5003.

* Vue: Sanitize labels and helper text input

* Form editor: Fix blur on input for select option values

---------

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2023-07-11 13:02:02 +09:00

18 lines
669 B
Text

@using BTCPayServer.Forms
@using Microsoft.AspNetCore.Mvc.TagHelpers
@inject FormComponentProviders FormComponentProviders
@model BTCPayServer.Abstractions.Form.Field
@if (!Model.Constant)
{
<fieldset>
<legend class="h3 mt-4 mb-3">@Safe.Raw(Model.Label)</legend>
@foreach (var field in Model.Fields)
{
if (FormComponentProviders.TypeToComponentProvider.TryGetValue(field.Type, out var partial) && !string.IsNullOrEmpty(partial.View))
{
field.Name = $"{(string.IsNullOrEmpty(Model.Name)? string.Empty: $"{Model.Name}_")}{field.Name}";
<partial name="@partial.View" for="@field"></partial>
}
}
</fieldset>
}