@model Disco.Web.Areas.Config.Models.DeviceFlag.IndexModel @{ Authorization.Require(Claims.Config.DeviceFlag.Show); ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Flags"); var showTags = Model.DeviceFlags.Keys.Any(i => i.DevicesLinkedGroup != null || i.DeviceUsersLinkedGroup != null || i.OnAssignmentExpression != null || i.OnUnassignmentExpression != null || i.DefaultRemoveDays.HasValue); }
@if (Model.DeviceFlags.Count == 0) {

No device flags are configured

} else { @if (showTags) { } @foreach (var pair in Model.DeviceFlags.OrderBy(i => i.Key.Name)) { var item = pair.Key; var assignmentCount = pair.Value; @if (showTags) { } }
Name Description Current Assignments 
@item.Name @if (string.IsNullOrWhiteSpace(item.Description)) { <none> } else { @item.Description.ToHtmlComment() } @assignmentCount.ToString("N0") @if (item.DevicesLinkedGroup != null || item.DeviceUsersLinkedGroup != null) { } @if (item.OnAssignmentExpression != null || item.OnUnassignmentExpression != null) { } @if (item.DefaultRemoveDays.HasValue) { }
}
@if (Authorization.Has(Claims.Config.DeviceFlag.Export) && Model.DeviceFlags.Count > 0) { @Html.ActionLinkButton("Export", MVC.Config.DeviceFlag.Export()) } @if (Authorization.Has(Claims.Config.DeviceFlag.Create)) { @Html.ActionLinkButton("Create Device Flag", MVC.Config.DeviceFlag.Create()) }