mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-27 07:57:33 +01:00
28 lines
774 B
Text
28 lines
774 B
Text
|
@using BTCPayServer.Abstractions.Form
|
||
|
@using BTCPayServer.Forms
|
||
|
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||
|
@using Newtonsoft.Json.Linq
|
||
|
@inject FormComponentProvider FormComponentProvider
|
||
|
@model BTCPayServer.Abstractions.Form.Field
|
||
|
@{
|
||
|
if (Model is not Fieldset fieldset)
|
||
|
{
|
||
|
fieldset = JObject.FromObject(Model).ToObject<Fieldset>();
|
||
|
}
|
||
|
}
|
||
|
@if (!fieldset.Hidden)
|
||
|
{
|
||
|
<fieldset>
|
||
|
<legend class="h3 mt-4 mb-3">@fieldset.Label</legend>
|
||
|
@foreach (var field in fieldset.Fields)
|
||
|
{
|
||
|
var partial = FormComponentProvider.CanHandle(field);
|
||
|
if (string.IsNullOrEmpty(partial))
|
||
|
{
|
||
|
continue;
|
||
|
}
|
||
|
<partial name="@partial" for="@field"></partial>
|
||
|
}
|
||
|
</fieldset>
|
||
|
}
|