Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
80 lines (73 sloc) 2.59 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 DefaultServerDetailLayoutOptions;
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);
}
@if (options.EditMode)
{
bool maibarFound = false;
<form data-control-type="server-detail" id="@options.Id"
class="@(options.CssClass)"
action="@(options.FormAction??string.Empty)"
method="@(options.FormMethod??"POST")"
asp-antiforgery="@options.Antiforgery">
<div data-valmsg-ajax="true" asp-validation-summary="ModelOnly" class="text-danger"></div>
@foreach (var bar in options.Toolbars)
{
if (bar.Key == LayoutStandardPlaces.HeaderEdit || bar.Key == LayoutStandardPlaces.Header)
{
@Html.Raw(bar.Value)
}
}
@options.MainContent
@foreach (var bar in options.Toolbars)
{
if (bar.Key == LayoutStandardPlaces.SubmitBar)
{
maibarFound = true;
@Html.Raw(bar.Value)
}
else if (bar.Key == LayoutStandardPlaces.FooterEdit || bar.Key == LayoutStandardPlaces.Footer)
{
@Html.Raw(bar.Value)
}
}
@if(!maibarFound)
{
<div class="form-group col-xs-12">
@currProvider.RenderButton(StandardButtons.Save, null, "btn-primary", helpers, localizer, true, !options.NoSubmit)
</div>
}
<div class="clearfix"></div>
</form>
}
else
{
<div data-control-type="server-detail" @Html.Raw(options.Id != null ? "id='"+options.Id+"'": "")
class="@(options.CssClass)">
@foreach (var bar in options.Toolbars)
{
if (bar.Key == LayoutStandardPlaces.HeaderDisplay || bar.Key == LayoutStandardPlaces.Header)
{
@Html.Raw(bar.Value)
}
}
@options.MainContent
@foreach (var bar in options.Toolbars)
{
if (bar.Key == LayoutStandardPlaces.FooterDisplay || bar.Key == LayoutStandardPlaces.Footer)
{
@Html.Raw(bar.Value)
}
}
<div class="clearfix"></div>
</div>
}