Hide Document Templates & UI Tweaks
Flag Document Templates as hidden. UI changes aim to improve visibility of used features in lists.
This commit is contained in:
@@ -2,17 +2,19 @@
|
||||
@{
|
||||
Authorization.Require(Claims.Config.DeviceBatch.Show);
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches");
|
||||
var hasDecommissionedBatches = Model.DeviceBatches.Any(db => db.DeviceCount > 0 && db.DeviceDecommissionedCount >= db.DeviceCount);
|
||||
var showTags = hasDecommissionedBatches || Model.DeviceBatches.Any(i => i.IsLinked);
|
||||
}
|
||||
<div id="Config_DeviceBatches">
|
||||
@if (Model.DeviceBatches.Count == 0)
|
||||
{
|
||||
<div class="form" style="width: 450px; padding: 100px 0;">
|
||||
<h2>No device batches are configured</h2>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Model.DeviceBatches.Any(db => db.DeviceCount > 0 && db.DeviceDecommissionedCount >= db.DeviceCount))
|
||||
if (hasDecommissionedBatches)
|
||||
{
|
||||
<a id="Config_DeviceBatches_ShowDecommissioned" href="#" class="button small">Show Decommissioned (@(Model.DeviceBatches.Count(db => db.DeviceCount > 0 && db.DeviceDecommissionedCount >= db.DeviceCount)))</a>
|
||||
<script>
|
||||
@@ -21,7 +23,7 @@
|
||||
|
||||
$('#Config_DeviceBatches_ShowDecommissioned').click(function () {
|
||||
$(this).remove();
|
||||
$('#Config_DeviceBatches_List').find('tr.decommissioned').show();
|
||||
$('#Config_DeviceBatches_List').find('tr.hidden').show();
|
||||
return false;
|
||||
}).detach().appendTo('#layout_PageHeading');
|
||||
})
|
||||
@@ -29,25 +31,23 @@
|
||||
}
|
||||
<table id="Config_DeviceBatches_List" class="tableData">
|
||||
<tr>
|
||||
<th>Name
|
||||
</th>
|
||||
<th>Default Model
|
||||
</th>
|
||||
<th>Purchase Date
|
||||
</th>
|
||||
<th>Warranty Expires
|
||||
</th>
|
||||
<th>Insurance Expires
|
||||
</th>
|
||||
<th>Device Count
|
||||
</th>
|
||||
<th>Name</th>
|
||||
<th>Default Model</th>
|
||||
<th>Purchase Date</th>
|
||||
<th>Warranty Expires</th>
|
||||
<th>Insurance Expires</th>
|
||||
<th>Device Count</th>
|
||||
@if (showTags)
|
||||
{
|
||||
<th> </th>
|
||||
}
|
||||
</tr>
|
||||
@foreach (var item in Model.DeviceBatches)
|
||||
{
|
||||
var isDecommissioned = item.DeviceCount > 0 && item.DeviceDecommissionedCount >= item.DeviceCount;
|
||||
<tr class="@(isDecommissioned ? "decommissioned" : null)">
|
||||
<tr class="@(isDecommissioned ? "hidden" : null)">
|
||||
<td>
|
||||
@Html.ActionLink(item.Name, MVC.Config.DeviceBatch.Index(item.Id)) @if (isDecommissioned) { <em>Decommissioned</em> }
|
||||
@Html.ActionLink(item.Name, MVC.Config.DeviceBatch.Index(item.Id))
|
||||
</td>
|
||||
<td>
|
||||
@item.DefaultDeviceModel
|
||||
@@ -64,18 +64,31 @@
|
||||
</td>
|
||||
<td>
|
||||
@if (item.PurchaseUnitQuantity.HasValue)
|
||||
{
|
||||
{
|
||||
<span>@item.DeviceCount.ToString("n0")/@(item.PurchaseUnitQuantity.Value.ToString("n0"))</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
@item.DeviceCount.ToString("n0")
|
||||
}
|
||||
@if (item.DeviceDecommissionedCount > 0)
|
||||
{
|
||||
{
|
||||
<span class="smallMessage" title="@(item.DeviceDecommissionedCount.ToString("n0")) Decommissioned">(@(item.DeviceDecommissionedCount.ToString("n0")))</span>
|
||||
}
|
||||
</td>
|
||||
@if (showTags)
|
||||
{
|
||||
<td>
|
||||
@if (item.IsLinked)
|
||||
{
|
||||
<i class="fa fa-link fa-lg success" title="Is Linked"></i>
|
||||
}
|
||||
@if (isDecommissioned)
|
||||
{
|
||||
<i class="fa fa-minus-square fa-lg alert" title="Decommissioned"></i>
|
||||
}
|
||||
</td>
|
||||
}
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
@@ -85,7 +98,7 @@
|
||||
{
|
||||
<div class="actionBar">
|
||||
@if (Authorization.Has(Claims.Config.DeviceBatch.ShowTimeline) && Model.DeviceBatches.Count > 0)
|
||||
{
|
||||
{
|
||||
@Html.ActionLinkButton("Timeline", MVC.Config.DeviceBatch.Timeline())
|
||||
}
|
||||
@if (Authorization.HasAll(Claims.Config.DeviceBatch.Create, Claims.Config.DeviceBatch.Configure))
|
||||
|
||||
Reference in New Issue
Block a user