@using Zap.BI.Portal.Models.Diagnostics
@using Zap.BI.Portal.Pages.Diagnostics
@using Zap.Collections
@model Zap.BI.Core.Security.Diagnostics.AdGroupDiagnostic

@{
    Layout = null;
}

@if (Model.Group == null)
{
    <h2 class="badMessage">@DiagnosticText.ADDiagnostics_CouldNotFindGroup</h2>
}
else
{
    <h2 class="group-found">@Model.Group.FullName</h2>

    if (Model.GroupPrincipal != null)
    {
        Html.RenderPartial("Principals", new PrincipalListModel(Model.GroupPrincipal.Result.ToEnumerable()));
    }

    <h3>@DiagnosticText.ADDiagnostics_Members</h3>
    Html.RenderPartial("ExecutionInfo", Model.Members);
    Html.RenderPartial("SecurityPrincipals", new SecurityPrincipalListModel(Model.Members.Result));

    <h3>@DiagnosticText.ADDiagnostics_SubGroups</h3>
    Html.RenderPartial("ExecutionInfo", Model.Subgroups);
    Html.RenderPartial("SecurityPrincipals", new SecurityPrincipalListModel(Model.Subgroups.Result));
}