@model Disco.Web.Models.Device.ShowModel @using Disco.Services.Devices.DeviceFlags; @{ ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), string.Format("Device: {0}", Model.Device.SerialNumber)); var requiresLive = Authorization.HasAny(Claims.Device.ShowComments, Claims.Device.ShowAttachments); if (requiresLive) { Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR"); } }
 @Model.Device.Status()
@if (Model.Device.DeviceFlagAssignments.CanShowAny()) {
@foreach (var flag in Model.Device.DeviceFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, DeviceFlagService.GetDeviceFlag(f.DeviceFlagId)))) { if (flag.Item2.permission.CanShow()) { @flag.Item2.flag.Name@if (flag.Item1.Comments != null) {@flag.Item1.Comments.ToHtmlComment()}@CommonHelpers.FriendlyDateAndUser(flag.Item1.AddedDate, flag.Item1.AddedUser) } }
} @Html.Partial(MVC.Device.Views.DeviceParts._Subject, Model)
@if (Authorization.HasAny(Claims.Device.ShowComments, Claims.Device.ShowJobs)) { @Html.Partial(MVC.Device.Views.DeviceParts._CommentsAndJobs, Model) } @if (Authorization.Has(Claims.Device.ShowDetails)) { @Html.Partial(MVC.Device.Views.DeviceParts._Details, Model) } @if (Authorization.Has(Claims.Device.ShowAssignmentHistory)) { @Html.Partial(MVC.Device.Views.DeviceParts._AssignmentHistory, Model) } @if (Authorization.Has(Claims.Device.ShowAttachments)) { @Html.Partial(MVC.Device.Views.DeviceParts._Resources, Model) } @if (Authorization.Has(Claims.Device.ShowFlagAssignments) || Model.Device.DeviceFlagAssignments.CanShowAny()) { @Html.Partial(MVC.Device.Views.DeviceParts._Flags, Model) } @if (Authorization.Has(Claims.Device.ShowCertificates)) { @Html.Partial(MVC.Device.Views.DeviceParts._Certificates, Model) }
@if (requiresLive) { }