Files
Disco/Disco.Web/Views/Device/_DeviceTable.cshtml
T
Gary Sharp a0e18ef963 SignalR Bug Fixes & Minor UI Changes
Document Template import status and Device Enrolment status fixes.
Attachment download fixes for SignalR foreverFrame transport. Database
queries for Devices, Jobs and Users updated. Device attributes (model,
profile, batch) now shown in various places.
2014-06-03 12:36:48 +10:00

110 lines
4.1 KiB
Plaintext

@model IEnumerable<Disco.Models.Services.Searching.DeviceSearchResultItem>
@{
var canShowDevices = Authorization.Has(Claims.Device.Show);
var canShowUsers = Authorization.Has(Claims.User.Show);
}
<div class="genericData deviceTable">
@if (Model != null && Model.Count() > 0)
{
<table class="genericData deviceTable">
<thead>
<tr>
<th>Serial#
</th>
<th>Asset#
</th>
<th>Name
</th>
<th>Model
</th>
<th>Profile
</th>
<th>Batch
</th>
<th>Assigned User
</th>
<th>Jobs
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr class="@(item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty)">
<td>
@if (canShowDevices)
{@Html.ActionLink(item.Id, MVC.Device.Show(item.Id))}
else
{@item.Id}
</td>
<td>
@item.AssetNumber
@if (item.DecommissionedDate.HasValue)
{ <span class="smallMessage">(Decommissioned
@CommonHelpers.FriendlyDate(item.DecommissionedDate.Value))</span> }
</td>
<td>
@if (string.IsNullOrWhiteSpace(item.ComputerName))
{
<span class="smallMessage">Unknown</span>
}
else
{
@item.ComputerName
}
</td>
<td>
@if (item.DeviceModelDescription != null)
{
<span>@item.DeviceModelDescription</span>
}
else
{
<span class="smallMessage">Unknown</span>
}
</td>
<td>
@item.DeviceProfileDescription
</td>
<td>
@if (item.DeviceBatchName != null)
{
<span>@item.DeviceBatchName</span>
}
else
{
<span class="smallMessage">N/A</span>
}
</td>
<td>
@if (string.IsNullOrEmpty(item.AssignedUserId))
{
<span class="smallMessage">N/A</span>
}
else
{
<span>@if (canShowUsers)
{
@Html.ActionLink(item.AssignedUserDescription, MVC.User.Show(item.AssignedUserId))
}
else
{
@item.AssignedUserDescription
}
</span>
}
</td>
<td>
@item.JobCount
</td>
</tr>
}
</tbody>
</table>
}
else
{
<span class="smallMessage">No Devices Found</span>
}
</div>