@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 (Authorization.Has(Claims.Device.ShowFlagAssignments))
{
@foreach (var flag in Model.Device.DeviceFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, DeviceFlagService.GetDeviceFlag(f.DeviceFlagId))))
{
@flag.Item2.Name@if (flag.Item1.Comments != null)
{}@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))
{
@Html.Partial(MVC.Device.Views.DeviceParts._Flags, Model)
}
@if (Authorization.Has(Claims.Device.ShowCertificates))
{
@Html.Partial(MVC.Device.Views.DeviceParts._Certificates, Model)
}
@if (requiresLive)
{
}