| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- @using VberZero.Tools.StringModel
- @using VberAdmin.Web.Models.Input
- @model VberAdmin.Web.Models.Input.VmInputGroup
- @if (Model is {HiddenInputs.Count: > 0 })
- {
- if (Model.HiddenInputs.Any())
- {
- foreach (var hInput in Model.HiddenInputs)
- {
- @await Html.PartialAsync("Input/_Input",hInput)
- }
- }
- }
- @if (Model is {Count: > 0 })
- {
- //string divClass = Model.IsChild ? $"{Model.Parent.LayoutClass}" : "row g-9 mb-3";
-
- <div class="@(Model.Count==1?"":"row") g-3 mb-3">
- @for (int i = 0; i < Model.Count; i++)
- {
- VmInputGroup group = null;//Model.GetGroup(i);
- if (group != null)
- {
- @await Html.PartialAsync("Input/_InputGroup",group)
- }
- else
- {
- var input = Model.GetInput(i);
- if (input is {IsHidden: false })
- {
- @if (input.Special.Empty())
- {
- if (Model.Count>1)
- {
- @Html.Raw($"<div class=\"{Model.LayoutClass}\">")
- }
-
- @if (input.Help.Empty()){
- <div class="d-flex flex-column ">
- @if (input.Help.Empty())
- {
- <label class="@(input.LabelClass) @(input.IsRequired ? "required" : "") ">@input.DisplayName</label>
- }
- else
- {
- <label class="d-flex align-items-center @(input.LabelClass)">
- <span class="@(input.IsRequired ? "required" : "")">@input.DisplayName </span>
- <i class="fas fa-exclamation-circle ms-2 fs-7" data-bs-toggle="tooltip" data-bs-delay-hide="800" data-bs-delay-show="200" title="@(input.Help)"></i>
- </label>
- }
- @await Html.PartialAsync("Input/_Input", input)
- <div class="invalid-feedback"></div>
- </div>
- }
- else
- {
- switch (input.InputType)
- {
- case VmInputType.RadioBox:
- case VmInputType.CheckBox:
- case VmInputType.Switch:
- <div class="d-flex flex-stack">
- <div class="fw-bold me-5">
- <label class="@(input.LabelClass) @(input.IsRequired ? "required" : "")">@input.DisplayName</label>
- @if (input.Help.NotEmpty())
- {
- <div class="fs-7 text-muted">@input.Help</div>
- }
- </div>
- @await Html.PartialAsync("Input/_Input", input)
-
- </div>
- break;
- default:
- <div class="d-flex flex-column ">
- @if (input.Help.Empty())
- {
- <label class="@(input.LabelClass) @(input.IsRequired ? "required" : "") ">@input.DisplayName</label>
- }
- else
- {
- <label class="d-flex align-items-center @(input.LabelClass)">
- <span class="@(input.IsRequired ? "required" : "")">@input.DisplayName </span>
- <i class="fas fa-exclamation-circle ms-2 fs-7" data-bs-toggle="tooltip" data-bs-delay-hide="800" data-bs-delay-show="200" title="@(input.Help)"></i>
- </label>
- }
- @await Html.PartialAsync("Input/_Input", input)
- <div class="invalid-feedback"></div>
- </div>
- break;
- }
- }
- if (Model.Count>1)
- {
- @Html.Raw(" </div>")
- }
-
- }
- else
- {
- @Html.Raw(input.Special)
- }
- }
- }
- }
- </div>
-
- }
|