2018-03-27 00:54:20 -04:00
|
|
|
@model WebfrontCore.ViewModels.ActionInfo
|
|
|
|
@{
|
|
|
|
Layout = null;
|
|
|
|
}
|
|
|
|
<form class="action-form" action="/Action/@Model.Action">
|
2018-04-04 15:38:34 -04:00
|
|
|
@foreach (var input in Model.Inputs)
|
|
|
|
{
|
2019-07-13 21:45:25 -04:00
|
|
|
string inputType = input.Type ?? "text";
|
|
|
|
string value = input.Value ?? "";
|
2018-03-27 00:54:20 -04:00
|
|
|
|
2019-07-13 21:45:25 -04:00
|
|
|
if (input.Type != "hidden")
|
|
|
|
{
|
|
|
|
<div class="input-group mb-3">
|
2018-09-02 17:59:27 -04:00
|
|
|
|
2019-07-13 21:45:25 -04:00
|
|
|
<div class="input-group-prepend">
|
|
|
|
<span class="input-group-text" id="basic-addon-@input.Name">@input.Label</span>
|
2018-09-02 17:59:27 -04:00
|
|
|
</div>
|
|
|
|
|
2019-07-13 21:45:25 -04:00
|
|
|
@if (inputType == "select")
|
|
|
|
{
|
|
|
|
<select name="@input.Name" class="form-control" aria-label="@input.Name" aria-describedby="basic-addon-@input.Name">
|
|
|
|
@foreach (var item in input.Values)
|
|
|
|
{
|
|
|
|
<option value="@item.Key">@item.Value</option>
|
|
|
|
}
|
|
|
|
</select>
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (inputType == "checkbox")
|
|
|
|
{
|
|
|
|
<div class="btn-group-toggle" data-toggle="buttons">
|
|
|
|
<label class="btn btn-primary active">
|
|
|
|
<input type="checkbox" name="@input.Name" @(input.Checked ? "checked" : "") autocomplete="off">@input.Label
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
}
|
2018-04-04 15:38:34 -04:00
|
|
|
|
2019-07-13 21:45:25 -04:00
|
|
|
else
|
|
|
|
{
|
|
|
|
<input type="@inputType" name="@input.Name" value="@value" class="form-control" placeholder="@input.Placeholder" aria-label="@input.Name" aria-describedby="basic-addon-@input.Name">
|
|
|
|
}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<input type="@inputType" name="@input.Name" value="@value" hidden="hidden">
|
|
|
|
}
|
2018-04-04 15:38:34 -04:00
|
|
|
}
|
2018-03-27 00:54:20 -04:00
|
|
|
<button type="submit" class="btn btn-block btn-primary">@Model.ActionButtonLabel</button>
|
|
|
|
</form>
|