Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
65 lines (58 sloc) 1.94 KB
@model Object
@using MvcControlsToolkit.Core.Templates
@using MvcControlsToolkit.Core.TagHelpers
@using MvcControlsToolkit.Core.Views
@using Microsoft.Extensions.Localization
@using System.Globalization
@{
var options = ViewData["Options"] as DefaultServerQueryWindowLayoutOptions;
var helpers = new ContextualizedHelpers(ViewContext, Html, User, Component, Url, ViewData["LocalizerFactory"] as IStringLocalizerFactory);
var currProvider = ViewContext.TagHelperProvider();
var row = options.Rows[0];
var localizer = row.GetLocalizer(helpers.LocalizerFactory);
bool maibarFound = false;
var id = Html.GenerateIdFromName(options.Name);
}
<form data-control-type="@options.ControlType" id="@id">
<div data-valmsg-ajax="true" asp-validation-summary="ModelOnly" class="text-danger"></div>
@foreach (var bar in options.Toolbars)
{
if (bar.Key == options.HeaderBarName)
{
@Html.Raw(bar.Value)
}
}
@options.MainContent
@foreach (var bar in options.Toolbars)
{
if (bar.Key == options.SubmitBarName)
{
maibarFound = true;
@Html.Raw(bar.Value)
}
else if (bar.Key == options.FooterBarName)
{
@Html.Raw(bar.Value)
}
}
@if (!maibarFound)
{
<div class="form-group col-xs-12">
@currProvider.RenderButton(options.SubmitButton, options.OperationParameters, "btn-primary", helpers, localizer, true, false)
<button type="button" data-operation="reset-form" class="btn btn-primary">
@if (localizer != null)
{
<span>@localizer["reset"]</span>
}
else
{
<span>reset</span>
}
</button>
</div>
}
<div class="clearfix"></div>
</form>
<only-once asp-for="@Model">
<store-model asp-for="@Model" />
</only-once>