Update: New Device UI
This commit is contained in:
@@ -0,0 +1,478 @@
|
||||
@model Disco.Web.Models.Device.ShowModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), string.Format("{0} ({1})", Model.Device.ComputerName, Model.Device.SerialNumber));
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
|
||||
}
|
||||
<table class="deviceShow">
|
||||
<tr>
|
||||
<td class="details">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Computer Name:
|
||||
</th>
|
||||
<td class="value">
|
||||
@if (string.IsNullOrWhiteSpace(Model.Device.ComputerName))
|
||||
{
|
||||
<span class="smallMessage"><Unknown/Not Allocated></span>
|
||||
}
|
||||
else
|
||||
{
|
||||
@Model.Device.ComputerName
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Asset Number:
|
||||
</th>
|
||||
<td class="value">
|
||||
@Html.TextBoxFor(m => m.Device.AssetNumber)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $ajaxSave = $('#Device_AssetNumber').next('.ajaxSave');
|
||||
$('#Device_AssetNumber').watermark('Asset Number').keydown(function (e) {
|
||||
$ajaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).change(function () {
|
||||
var $this = $(this);
|
||||
$ajaxSave.hide();
|
||||
var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
|
||||
var data = { AssetNumber: $this.val() };
|
||||
$.getJSON('@(Url.Action(@MVC.API.Device.UpdateAssetNumber(Model.Device.SerialNumber)))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Asset Number:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
}).blur(function () {
|
||||
$ajaxSave.hide();
|
||||
}).focus(function () {
|
||||
$(this).select();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Location:
|
||||
</th>
|
||||
<td class="value">
|
||||
@Html.TextBoxFor(m => m.Device.Location)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $ajaxSave = $('#Device_Location').next('.ajaxSave');
|
||||
$('#Device_Location').watermark('Location').keydown(function (e) {
|
||||
$ajaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).change(function () {
|
||||
var $this = $(this);
|
||||
$ajaxSave.hide();
|
||||
var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
|
||||
var data = { Location: $this.val() };
|
||||
$.getJSON('@(Url.Action(@MVC.API.Device.UpdateLocation(Model.Device.SerialNumber)))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Location:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
}).blur(function () {
|
||||
$ajaxSave.hide();
|
||||
}).focus(function () {
|
||||
$(this).select();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Batch:
|
||||
</th>
|
||||
<td class="value">
|
||||
@Html.DropDownListFor(m => m.Device.DeviceBatchId, Model.DeviceBatches.ToSelectListItems(Model.Device.DeviceBatchId))
|
||||
@AjaxHelpers.AjaxLoader() <span id="deviceBatchDetails" class="icon16" title="Batch Details"></span>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $DeviceBatchId = $('#Device_DeviceBatchId');
|
||||
var $DeviceBatchDetails = $('#deviceBatchDetails');
|
||||
var $DeviceBatchSummary = $('#deviceBatchSummary');
|
||||
var initUpdate = false;
|
||||
var jsonDate = function (json, unknownValue) {
|
||||
if (json && json.indexOf('') == 0) {
|
||||
return $.datepicker.formatDate('yy-mm-dd', new Date(parseInt(json.substr(6, json.length - 8))));
|
||||
} else
|
||||
return unknownValue;
|
||||
}
|
||||
var updateDetails = function (deviceBatchId) {
|
||||
$.getJSON('@(Url.Action(MVC.API.DeviceBatch.Index()))/' + deviceBatchId, function (response, result) {
|
||||
if (result == 'success') {
|
||||
if (response.Supplier)
|
||||
$DeviceBatchSummary.find('.supplier').text(response.Supplier);
|
||||
else
|
||||
$DeviceBatchSummary.find('.supplier').text('Unknown');
|
||||
|
||||
$DeviceBatchSummary.find('.purchaseDate').text(jsonDate(response.PurchaseDate, 'Unknown'));
|
||||
$DeviceBatchSummary.find('.warrantyValidUntil').text(jsonDate(response.WarrantyValidUntil, 'Unknown'));
|
||||
|
||||
if (response.InsuranceSupplier)
|
||||
$DeviceBatchSummary.find('.insuranceSupplier').text(response.InsuranceSupplier);
|
||||
else
|
||||
$DeviceBatchSummary.find('.insuranceSupplier').text('Unknown');
|
||||
|
||||
$DeviceBatchSummary.find('.insuredUntil').text(jsonDate(response.InsuredUntil, 'Unknown'));
|
||||
|
||||
if (initUpdate){
|
||||
$DeviceBatchSummary.show();
|
||||
$DeviceBatchDetails.show();
|
||||
initUpdate = false;
|
||||
}else{
|
||||
$DeviceBatchSummary.slideDown('fast');
|
||||
$DeviceBatchDetails.fadeIn();
|
||||
}
|
||||
} else {
|
||||
alert('Unable to load Device Batch details:\n' + response);
|
||||
}
|
||||
});
|
||||
};
|
||||
$DeviceBatchDetails.click(function () {
|
||||
window.location.href = '@(Url.Action(MVC.Config.DeviceBatch.Index(null)))/' + $DeviceBatchId.val();
|
||||
});
|
||||
$DeviceBatchId.change(function () {
|
||||
var $this = $(this);
|
||||
var $ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
$DeviceBatchSummary.hide();
|
||||
$DeviceBatchDetails.hide();
|
||||
var data = { DeviceBatchId: $this.val() };
|
||||
$.getJSON('@(Url.Action(MVC.API.Device.UpdateDeviceBatchId(Model.Device.SerialNumber)))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Device Batch:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
if ($DeviceBatchId.val())
|
||||
updateDetails($DeviceBatchId.val());
|
||||
}
|
||||
});
|
||||
});
|
||||
$DeviceBatchSummary.hide();
|
||||
if ($DeviceBatchId.val()){
|
||||
initUpdate = true;
|
||||
updateDetails($DeviceBatchId.val());
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div id="deviceBatchSummary">
|
||||
<table class="sub">
|
||||
<tr>
|
||||
<th style="width: 50px">
|
||||
<strong>Purchased:</strong>
|
||||
</th>
|
||||
<td>
|
||||
Supplier: <span class="supplier"></span>
|
||||
<br />
|
||||
On: <span class="purchaseDate"></span>
|
||||
</td>
|
||||
<th style="width: 50px">
|
||||
<strong>Warranty:</strong>
|
||||
</th>
|
||||
<td>
|
||||
Valid Until: <span class="warrantyValidUntil"></span>
|
||||
</td>
|
||||
<th style="width: 50px">
|
||||
<strong>Insurance:</strong>
|
||||
</th>
|
||||
<td>
|
||||
Supplier: <span class="insuranceSupplier"></span>
|
||||
<br />
|
||||
Until: <span class="insuredUntil"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Profile:
|
||||
</th>
|
||||
<td class="value">
|
||||
@if (Model.Device.DecommissionedDate.HasValue)
|
||||
{
|
||||
@Model.Device.DeviceProfile.ToString()
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.DropDownListFor(m => m.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.Device.DeviceProfile))
|
||||
@AjaxHelpers.AjaxLoader()<span id="deviceProfileDetails" class="icon16" title="Profile Details"></span>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#Device_DeviceProfileId').change(function () {
|
||||
var $this = $(this);
|
||||
var $ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
var data = { DeviceProfileId: $this.val() };
|
||||
$.getJSON('@(Url.Action(MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber)))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Device Profile:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#deviceProfileDetails').click(function(){
|
||||
window.location.href = '@(Url.Action(MVC.Config.DeviceProfile.Index(null)))/' + $('#Device_DeviceProfileId').val();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Created:
|
||||
</th>
|
||||
<td class="value">
|
||||
@CommonHelpers.FriendlyDate(Model.Device.CreatedDate)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Enrolment:
|
||||
</th>
|
||||
<td class="value">
|
||||
First:
|
||||
@CommonHelpers.FriendlyDate(Model.Device.EnrolledDate)
|
||||
@if (Model.Device.AllowUnauthenticatedEnrol)
|
||||
{
|
||||
<a class="unlocked16" href="@Url.Action(MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, "false", true))" title="Unauthenticated Enrolment is Allowed">
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="locked16" href="@Url.Action(MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, "true", true))" title="Unauthenticated Enrolment is Blocked">
|
||||
</a>
|
||||
}
|
||||
<br />
|
||||
Last:
|
||||
@CommonHelpers.FriendlyDate(Model.Device.LastEnrolDate)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Decommissioned:
|
||||
</th>
|
||||
<td class="value">
|
||||
@CommonHelpers.FriendlyDate(Model.Device.DecommissionedDate)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Last Network Logon:
|
||||
</th>
|
||||
<td class="value">
|
||||
<span id="lastNetworkLogonDate" class="nowrap">@CommonHelpers.FriendlyDate(Model.Device.LastNetworkLogonDate)</span>
|
||||
@if (!string.IsNullOrEmpty(Model.Device.ComputerName))
|
||||
{
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var span = $('#lastNetworkLogonDate');
|
||||
$('<span>').addClass('ajaxHelperIcon ajaxLoading ajaxShowInitially').attr('title', 'Loading...').appendTo(span);
|
||||
|
||||
$.getJSON('@(Url.Action(MVC.API.Device.LastNetworkLogonDate(Model.Device.SerialNumber)))', function (response, result) {
|
||||
if (result != 'success') {
|
||||
alert('Unable to retrieve latest network logon date:\n' + response);
|
||||
$('<span>').addClass('smallMessage').text('[may not be current]').appendTo(span);
|
||||
} else {
|
||||
span.find('.ajaxLoading').hide();
|
||||
span.attr('title', response.Formatted).text(response.Friendly);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
@if (!Model.Device.DecommissionedDate.HasValue)
|
||||
{
|
||||
<tr>
|
||||
<th class="name">
|
||||
Assigned User:
|
||||
</th>
|
||||
<td class="value">
|
||||
@Html.TextBoxFor(m => m.Device.AssignedUser, new { userId = Model.Device.AssignedUserId })
|
||||
@AjaxHelpers.AjaxRemove()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<br />
|
||||
<a href="#" id="Device_AssignedUser_History_Trigger" class="smallLink">Show Assignment
|
||||
History (<span id="Device_AssignedUser_History_RecordCount"></span>)</a> <span id="Device_AssignedUser_History_None"
|
||||
class="smallMessage" style="display: none">No Assignment History Available</span>
|
||||
<div id="dialogRemoveAssignedUser" title="Remove this Device Assignment?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Are you sure?</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
// Common Objects
|
||||
var $assignedUser = $('#Device_AssignedUser');
|
||||
var $ajaxLoading = $assignedUser.nextAll('.ajaxLoading').first();
|
||||
var $ajaxRemove = $assignedUser.nextAll('.ajaxRemove').first();
|
||||
|
||||
// Assign User
|
||||
$assignedUser
|
||||
.watermark('No Assigned User')
|
||||
.focus(function () { $assignedUser.select() })
|
||||
.autocomplete({
|
||||
source: '@(Url.Action(MVC.API.User.UpstreamUsers()))',
|
||||
minLength: 2,
|
||||
focus: function (e, ui) {
|
||||
$assignedUser.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
|
||||
return false;
|
||||
},
|
||||
select: function (e, ui) {
|
||||
updateAssignedUser(ui.item.Id);
|
||||
$assignedUser.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.data('ui-autocomplete')._renderItem = function (ul, item) {
|
||||
return $("<li></li>")
|
||||
.data("item.autocomplete", item)
|
||||
.append("<a><strong>" + item.DisplayName + "</strong><br>" + item.Id + " (" + item.Type + ")</a>")
|
||||
.appendTo(ul);
|
||||
};
|
||||
|
||||
var $dialogRemoveAssignedUser = $('#dialogRemoveAssignedUser');
|
||||
$dialogRemoveAssignedUser.dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Remove": function () {
|
||||
updateAssignedUser('');
|
||||
$assignedUser.val('');
|
||||
$dialogRemoveAssignedUser.dialog("close");
|
||||
},
|
||||
"Cancel": function () {
|
||||
$dialogRemoveAssignedUser.dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Un-Assign User
|
||||
if ($assignedUser.val() != '')
|
||||
$ajaxRemove.show();
|
||||
$ajaxRemove.click(function () {
|
||||
$dialogRemoveAssignedUser.dialog('open');
|
||||
return false;
|
||||
});
|
||||
|
||||
// History
|
||||
var deviceUserAssignmentCount = @(Model.Device.DeviceUserAssignments.Count);
|
||||
if (deviceUserAssignmentCount > 0) {
|
||||
$('#Device_AssignedUser_History_Trigger').click(function () {
|
||||
$(this).hide();
|
||||
$('#Device_AssignedUser_History_Host').show();
|
||||
$('#Device_AssignedUser_History').slideDown('slow');
|
||||
return false;
|
||||
});
|
||||
var recordCountText = deviceUserAssignmentCount + ' record';
|
||||
if (deviceUserAssignmentCount != 1)
|
||||
recordCountText += 's';
|
||||
$('#Device_AssignedUser_History_RecordCount').text(recordCountText)
|
||||
}
|
||||
else {
|
||||
$('#Device_AssignedUser_History_Trigger').hide();
|
||||
$('#Device_AssignedUser_History_None').show();
|
||||
};
|
||||
|
||||
function updateAssignedUser(userId) {
|
||||
$ajaxLoading.show();
|
||||
$ajaxRemove.hide();
|
||||
var data = { AssignedUserId: userId };
|
||||
$.getJSON('@(Url.Action(MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber)))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Assigned User:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
if (userId != '')
|
||||
$ajaxRemove.fadeIn('fast');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
<tr id="Device_AssignedUser_History_Host" style="@(Model.Device.DecommissionedDate.HasValue ? "" : "display: none")">
|
||||
<td colspan="2">
|
||||
<div id="Device_AssignedUser_History" style="@(Model.Device.DecommissionedDate.HasValue ? "" : "display: none")">
|
||||
<h2>
|
||||
Assigned User History</h2>
|
||||
@Html.Partial(MVC.Device.Views._DeviceUserAssignmentHistoryTable, Model.Device)
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Generate Documents:
|
||||
</th>
|
||||
<td class="value" colspan="3">
|
||||
@Html.DropDownList("DocumentTemplates", Model.DocumentTemplatesSelectListItems)
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var generatePdfUrl = '@Url.Action(MVC.API.Device.GeneratePdf(Model.Device.SerialNumber, null))?DocumentTemplateId=';
|
||||
var $documentTemplates = $('#DocumentTemplates');
|
||||
$documentTemplates.change(function () {
|
||||
var v = $documentTemplates.val();
|
||||
if (v) {
|
||||
window.location.href = generatePdfUrl + v;
|
||||
$documentTemplates.val('');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="model">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="subtleHighlight">
|
||||
<img alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))" />
|
||||
<h2>
|
||||
<a href="@(Url.Action(MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId)))">@Model.Device.DeviceModel.ToString()</a></h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>
|
||||
Certificates</h2>
|
||||
@Html.Partial(MVC.Device.Views._CertificateTable, Model.Certificates)
|
||||
<h2>
|
||||
Attachments</h2>
|
||||
@Html.Partial(MVC.Device.Views.DeviceParts.Resources, Model)
|
||||
<h2>
|
||||
Jobs</h2>
|
||||
@Html.Partial(MVC.Shared.Views._JobTable, Model.Jobs)
|
||||
@Html.Partial(MVC.Device.Views._DeviceActions, Model.Device)
|
||||
@@ -0,0 +1,37 @@
|
||||
@model Disco.Web.Models.Device.ShowModel
|
||||
<div id="DeviceDetailTab-AssignmentHistory" class="DevicePart">
|
||||
@if (Model.Device.DeviceUserAssignments.Count > 0)
|
||||
{
|
||||
<table class="genericData">
|
||||
<tr>
|
||||
<th>User
|
||||
</th>
|
||||
<th>Assigned
|
||||
</th>
|
||||
<th>Unassigned
|
||||
</th>
|
||||
</tr>
|
||||
@foreach (var dua in Model.Device.DeviceUserAssignments.OrderByDescending(m => m.AssignedDate))
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.ActionLink(dua.AssignedUser.ToString(), MVC.User.Show(dua.AssignedUserId))
|
||||
</td>
|
||||
<td>
|
||||
@CommonHelpers.FriendlyDate(dua.AssignedDate)
|
||||
</td>
|
||||
<td>
|
||||
@CommonHelpers.FriendlyDate(dua.UnassignedDate, "Current")
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="smallMessage">No Assignment History Available</span>
|
||||
}
|
||||
<script>
|
||||
$('#DeviceDetailTabItems').append('<li><a href="#DeviceDetailTab-AssignmentHistory">Assignment History [@(Model.Device.DeviceUserAssignments.Count)]</a></li>');
|
||||
</script>
|
||||
</div>
|
||||
+38
-50
@@ -9,7 +9,7 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Views.Device
|
||||
namespace Disco.Web.Views.Device.DeviceParts
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -32,29 +32,31 @@ namespace Disco.Web.Views.Device
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/_CertificateTable.cshtml")]
|
||||
public partial class CertificateTable : System.Web.Mvc.WebViewPage<IEnumerable<Disco.Models.Repository.DeviceCertificate>>
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/DeviceParts/AssignmentHistory.cshtml")]
|
||||
public partial class AssignmentHistory : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ShowModel>
|
||||
{
|
||||
public CertificateTable()
|
||||
public AssignmentHistory()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
WriteLiteral("<div");
|
||||
|
||||
WriteLiteral(" class=\"genericData certificateTable\"");
|
||||
WriteLiteral(" id=\"DeviceDetailTab-AssignmentHistory\"");
|
||||
|
||||
WriteLiteral(" class=\"DevicePart\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 3 "..\..\Views\Device\_CertificateTable.cshtml"
|
||||
#line 3 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 3 "..\..\Views\Device\_CertificateTable.cshtml"
|
||||
if (Model.Count() > 0)
|
||||
#line 3 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
if (Model.Device.DeviceUserAssignments.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
@@ -62,34 +64,21 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <table");
|
||||
|
||||
WriteLiteral(" class=\"genericData certificateTable\"");
|
||||
WriteLiteral(" class=\"genericData\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
<tr>
|
||||
<th>
|
||||
Name
|
||||
</th>
|
||||
<th>
|
||||
Enabled
|
||||
</th>
|
||||
<th>
|
||||
Allocated
|
||||
</th>
|
||||
<th>
|
||||
Expires
|
||||
</th>
|
||||
</tr>
|
||||
");
|
||||
WriteLiteral(">\r\n <tr>\r\n <th>User\r\n </th>\r\n " +
|
||||
" <th>Assigned\r\n </th>\r\n <th>Unassigned\r\n " +
|
||||
" </th>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 20 "..\..\Views\Device\_CertificateTable.cshtml"
|
||||
#line 14 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 20 "..\..\Views\Device\_CertificateTable.cshtml"
|
||||
foreach (var item in Model)
|
||||
#line 14 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
foreach (var dua in Model.Device.DeviceUserAssignments.OrderByDescending(m => m.AssignedDate))
|
||||
{
|
||||
|
||||
|
||||
@@ -100,8 +89,8 @@ WriteLiteral(" <tr>\r\n <td>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 24 "..\..\Views\Device\_CertificateTable.cshtml"
|
||||
Write(Html.ActionLink(item.Name, MVC.API.DeviceCertificate.Download(item.Id)));
|
||||
#line 18 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
Write(Html.ActionLink(dua.AssignedUser.ToString(), MVC.User.Show(dua.AssignedUserId)));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -111,8 +100,8 @@ WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 27 "..\..\Views\Device\_CertificateTable.cshtml"
|
||||
Write(item.Enabled);
|
||||
#line 21 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(dua.AssignedDate));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -122,19 +111,8 @@ WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 30 "..\..\Views\Device\_CertificateTable.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(item.AllocatedDate));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 33 "..\..\Views\Device\_CertificateTable.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(item.ExpirationDate));
|
||||
#line 24 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(dua.UnassignedDate, "Current"));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -142,7 +120,7 @@ WriteLiteral(" ");
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 36 "..\..\Views\Device\_CertificateTable.cshtml"
|
||||
#line 27 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +129,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||
WriteLiteral(" </table>\r\n");
|
||||
|
||||
|
||||
#line 38 "..\..\Views\Device\_CertificateTable.cshtml"
|
||||
#line 29 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -163,16 +141,26 @@ WriteLiteral(" <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">No Certificates Allocated</span>\r\n");
|
||||
WriteLiteral(">No Assignment History Available</span>\r\n");
|
||||
|
||||
|
||||
#line 42 "..\..\Views\Device\_CertificateTable.cshtml"
|
||||
#line 33 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n");
|
||||
WriteLiteral(" <script>\r\n $(\'#DeviceDetailTabItems\').append(\'<li><a href=\"#DeviceDeta" +
|
||||
"ilTab-AssignmentHistory\">Assignment History [");
|
||||
|
||||
|
||||
#line 35 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
Write(Model.Device.DeviceUserAssignments.Count);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
@model Disco.Web.Models.Device.ShowModel
|
||||
<div id="DeviceDetailTab-Certificates" class="DevicePart">
|
||||
<div class="genericData certificateTable">
|
||||
@if (Model.Certificates.Count() > 0)
|
||||
{
|
||||
<table class="genericData certificateTable">
|
||||
<tr>
|
||||
<th>Name
|
||||
</th>
|
||||
<th>Enabled
|
||||
</th>
|
||||
<th>Allocated
|
||||
</th>
|
||||
<th>Expires
|
||||
</th>
|
||||
</tr>
|
||||
@foreach (var item in Model.Certificates)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.ActionLink(item.Name, MVC.API.DeviceCertificate.Download(item.Id))
|
||||
</td>
|
||||
<td>
|
||||
@item.Enabled
|
||||
</td>
|
||||
<td>
|
||||
@CommonHelpers.FriendlyDate(item.AllocatedDate)
|
||||
</td>
|
||||
<td>
|
||||
@CommonHelpers.FriendlyDate(item.ExpirationDate)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="smallMessage">No Certificates Allocated</span>
|
||||
}
|
||||
</div>
|
||||
<script>
|
||||
$('#DeviceDetailTabItems').append('<li><a href="#DeviceDetailTab-Certificates">Certificates [@(Model.Certificates.Count)]</a></li>');
|
||||
</script>
|
||||
</div>
|
||||
@@ -0,0 +1,192 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18033
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Views.Device.DeviceParts
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/DeviceParts/Certificates.cshtml")]
|
||||
public partial class Certificates : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ShowModel>
|
||||
{
|
||||
public Certificates()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
WriteLiteral("<div");
|
||||
|
||||
WriteLiteral(" id=\"DeviceDetailTab-Certificates\"");
|
||||
|
||||
WriteLiteral(" class=\"DevicePart\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"genericData certificateTable\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 4 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 4 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
if (Model.Certificates.Count() > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <table");
|
||||
|
||||
WriteLiteral(" class=\"genericData certificateTable\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
<tr>
|
||||
<th>Name
|
||||
</th>
|
||||
<th>Enabled
|
||||
</th>
|
||||
<th>Allocated
|
||||
</th>
|
||||
<th>Expires
|
||||
</th>
|
||||
</tr>
|
||||
");
|
||||
|
||||
|
||||
#line 17 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 17 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
foreach (var item in Model.Certificates)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 21 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
Write(Html.ActionLink(item.Name, MVC.API.DeviceCertificate.Download(item.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 24 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
Write(item.Enabled);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 27 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(item.AllocatedDate));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 30 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(item.ExpirationDate));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 33 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </table>\r\n");
|
||||
|
||||
|
||||
#line 35 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">No Certificates Allocated</span>\r\n");
|
||||
|
||||
|
||||
#line 39 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n <script>\r\n $(\'#DeviceDetailTabItems\').append(\'<li><a href=" +
|
||||
"\"#DeviceDetailTab-Certificates\">Certificates [");
|
||||
|
||||
|
||||
#line 42 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
Write(Model.Certificates.Count);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,9 @@
|
||||
@model Disco.Web.Models.Device.ShowModel
|
||||
<div id="DeviceDetailTab-Jobs" class="DevicePart">
|
||||
<div id="DeviceDetailTab-JobsContainer">
|
||||
@Html.Partial(MVC.Shared.Views._JobTable, Model.Jobs)
|
||||
</div>
|
||||
<script>
|
||||
$('#DeviceDetailTabItems').append('<li><a href="#DeviceDetailTab-Jobs">Jobs [@(Model.Device.Jobs == null ? 0 : Model.Device.Jobs.Count)]</a></li>');
|
||||
</script>
|
||||
</div>
|
||||
@@ -0,0 +1,79 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18033
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Views.Device.DeviceParts
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/DeviceParts/Jobs.cshtml")]
|
||||
public partial class Jobs : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ShowModel>
|
||||
{
|
||||
public Jobs()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
WriteLiteral("<div");
|
||||
|
||||
WriteLiteral(" id=\"DeviceDetailTab-Jobs\"");
|
||||
|
||||
WriteLiteral(" class=\"DevicePart\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"DeviceDetailTab-JobsContainer\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 4 "..\..\Views\Device\DeviceParts\Jobs.cshtml"
|
||||
Write(Html.Partial(MVC.Shared.Views._JobTable, Model.Jobs));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n <script>\r\n $(\'#DeviceDetailTabItems\').append(\'<li><a hre" +
|
||||
"f=\"#DeviceDetailTab-Jobs\">Jobs [");
|
||||
|
||||
|
||||
#line 7 "..\..\Views\Device\DeviceParts\Jobs.cshtml"
|
||||
Write(Model.Device.Jobs == null ? 0 : Model.Device.Jobs.Count);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -2,78 +2,82 @@
|
||||
@{
|
||||
Html.BundleDeferred("~/Style/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
|
||||
}
|
||||
<table id="deviceShowResources">
|
||||
<tr>
|
||||
<td id="Attachments">
|
||||
<div class="attachmentOutput">
|
||||
@if (Model.Device.DeviceAttachments != null)
|
||||
{
|
||||
foreach (var da in Model.Device.DeviceAttachments)
|
||||
<div id="DeviceDetailTab-Resources" class="DevicePart">
|
||||
<table id="deviceShowResources">
|
||||
<tr>
|
||||
<td id="Attachments">
|
||||
<div class="attachmentOutput">
|
||||
@if (Model.Device.DeviceAttachments != null)
|
||||
{
|
||||
<a href="@Url.Action(MVC.API.Device.AttachmentDownload(da.Id))" data-attachmentid="@da.Id" data-mimetype="@da.MimeType">
|
||||
<span class="icon" title="@da.Filename">
|
||||
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id)))" /></span>
|
||||
<span class="comments" title="@da.Comments">
|
||||
@{if (!string.IsNullOrEmpty(da.DocumentTemplateId))
|
||||
{ @da.DocumentTemplate.Description}
|
||||
else
|
||||
{ @da.Comments }}
|
||||
</span><span class="author">@da.TechUser.ToString()</span><span class="remove"></span><span class="timestamp" title="@da.Timestamp.ToFullDateTime()">@da.Timestamp.ToFuzzy()</span>
|
||||
</a>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="attachmentInput clearfix">
|
||||
<span class="action upload"></span><span class="action photo"></span>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
Shadowbox.init({
|
||||
skipSetup: true,
|
||||
modal: true
|
||||
});
|
||||
$(function () {
|
||||
if (!document.DiscoFunctions) {
|
||||
document.DiscoFunctions = {};
|
||||
}
|
||||
document.DiscoFunctions.addAttachment = addAttachment;
|
||||
|
||||
$Attachments = $('#Attachments');
|
||||
$attachmentOutput = $Attachments.find('.attachmentOutput');
|
||||
|
||||
$attachmentOutput.find('span.remove').click(removeAttachment);
|
||||
|
||||
$('#dialogUpload').dialog({ autoOpen: false,
|
||||
draggable: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
width: 860,
|
||||
height: 550,
|
||||
close: function () {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
|
||||
foreach (var da in Model.Device.DeviceAttachments)
|
||||
{
|
||||
<a href="@Url.Action(MVC.API.Device.AttachmentDownload(da.Id))" data-attachmentid="@da.Id" data-mimetype="@da.MimeType">
|
||||
<span class="icon" title="@da.Filename">
|
||||
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id)))" /></span>
|
||||
<span class="comments" title="@da.Comments">
|
||||
@{if (!string.IsNullOrEmpty(da.DocumentTemplateId))
|
||||
{ @da.DocumentTemplate.Description}
|
||||
else
|
||||
{ @da.Comments }}
|
||||
</span><span class="author">@da.TechUser.ToString()</span><span class="remove"></span><span class="timestamp" title="@da.Timestamp.ToFullDateTime()">@da.Timestamp.ToFuzzy()</span>
|
||||
</a>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="attachmentInput clearfix">
|
||||
<span class="action upload"></span><span class="action photo"></span>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
Shadowbox.init({
|
||||
skipSetup: true,
|
||||
modal: true
|
||||
});
|
||||
$(function () {
|
||||
if (!document.DiscoFunctions) {
|
||||
document.DiscoFunctions = {};
|
||||
}
|
||||
document.DiscoFunctions.addAttachment = addAttachment;
|
||||
|
||||
$('#dialogRemoveAttachment').dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
$Attachments = $('#Attachments');
|
||||
$attachmentOutput = $Attachments.find('.attachmentOutput');
|
||||
|
||||
var onLoadNavigation = null;
|
||||
var isLoaded = null;
|
||||
Silverlight.createObject(
|
||||
'@(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap)',
|
||||
$attachmentOutput.find('span.remove').click(removeAttachment);
|
||||
|
||||
$('#dialogUpload').dialog({
|
||||
autoOpen: false,
|
||||
draggable: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
width: 860,
|
||||
height: 550,
|
||||
close: function () {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
|
||||
}
|
||||
});
|
||||
|
||||
$('#dialogRemoveAttachment').dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
var onLoadNavigation = null;
|
||||
var isLoaded = null;
|
||||
Silverlight.createObject(
|
||||
'@(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap)',
|
||||
$('#silverlightHostUploadAttachment').get(0),
|
||||
'silverlightUploadAttachment',
|
||||
{ width: '840px', height: '500px', background: 'white', version: '4.0.60310.0' },
|
||||
{ onLoad: function () {
|
||||
if (onLoadNavigation) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
|
||||
isLoaded = true;
|
||||
{
|
||||
onLoad: function () {
|
||||
if (onLoadNavigation) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
|
||||
isLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'UploadUrl=@(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)))'
|
||||
);
|
||||
@@ -168,7 +172,7 @@
|
||||
});
|
||||
|
||||
$dialogRemoveAttachment.dialog('open');
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -178,16 +182,21 @@
|
||||
$this.shadowbox({ gallery: 'attachments', player: 'img', title: $this.find('.comments').text() });
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="dialogUpload" title="Upload Attachment">
|
||||
<div id="silverlightHostUploadAttachment">
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="dialogUpload" title="Upload Attachment">
|
||||
<div id="silverlightHostUploadAttachment">
|
||||
</div>
|
||||
</div>
|
||||
<div id="dialogRemoveAttachment" title="Remove this Attachment?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Are you sure?
|
||||
</p>
|
||||
</div>
|
||||
<script>
|
||||
$('#DeviceDetailTabItems').append('<li><a href="#DeviceDetailTab-Resources" id="DeviceDetailTab-ResourcesLink">Attachments [@(Model.Device.DeviceAttachments == null ? 0 : Model.Device.DeviceAttachments.Count)]</a></li>');
|
||||
</script>
|
||||
</div>
|
||||
<div id="dialogRemoveAttachment" title="Remove this Attachment?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Are you sure?</p>
|
||||
</div>
|
||||
@@ -45,57 +45,64 @@ namespace Disco.Web.Views.Device.DeviceParts
|
||||
|
||||
Html.BundleDeferred("~/Style/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<table");
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"DeviceDetailTab-Resources\"");
|
||||
|
||||
WriteLiteral(" class=\"DevicePart\"");
|
||||
|
||||
WriteLiteral(">\r\n <table");
|
||||
|
||||
WriteLiteral(" id=\"deviceShowResources\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <td");
|
||||
WriteLiteral(">\r\n <tr>\r\n <td");
|
||||
|
||||
WriteLiteral(" id=\"Attachments\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"attachmentOutput\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 10 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
|
||||
#line 12 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 10 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
if (Model.Device.DeviceAttachments != null)
|
||||
{
|
||||
foreach (var da in Model.Device.DeviceAttachments)
|
||||
#line 12 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
if (Model.Device.DeviceAttachments != null)
|
||||
{
|
||||
foreach (var da in Model.Device.DeviceAttachments)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 476), Tuple.Create("\"", 536)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 634), Tuple.Create("\"", 694)
|
||||
|
||||
#line 14 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 483), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentDownload(da.Id))
|
||||
#line 16 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 641), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentDownload(da.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 483), false)
|
||||
, 641), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" data-attachmentid=\"");
|
||||
|
||||
|
||||
#line 14 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.Id);
|
||||
#line 16 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.Id);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -105,108 +112,108 @@ WriteLiteral("\"");
|
||||
WriteLiteral(" data-mimetype=\"");
|
||||
|
||||
|
||||
#line 14 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.MimeType);
|
||||
#line 16 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.MimeType);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"icon\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 638), Tuple.Create("\"", 658)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 800), Tuple.Create("\"", 820)
|
||||
|
||||
#line 15 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 646), Tuple.Create<System.Object, System.Int32>(da.Filename
|
||||
#line 17 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 808), Tuple.Create<System.Object, System.Int32>(da.Filename
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 646), false)
|
||||
, 808), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <img");
|
||||
WriteLiteral(">\r\n <img");
|
||||
|
||||
WriteLiteral(" alt=\"Attachment Thumbnail\"");
|
||||
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 721), Tuple.Create("\"", 783)
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 887), Tuple.Create("\"", 949)
|
||||
|
||||
#line 16 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 727), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id))
|
||||
#line 18 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 893), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 727), false)
|
||||
, 893), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" /></span>\r\n <span");
|
||||
WriteLiteral(" /></span>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"comments\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 842), Tuple.Create("\"", 862)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 1012), Tuple.Create("\"", 1032)
|
||||
|
||||
#line 17 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 850), Tuple.Create<System.Object, System.Int32>(da.Comments
|
||||
#line 19 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1020), Tuple.Create<System.Object, System.Int32>(da.Comments
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 850), false)
|
||||
, 1020), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 18 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
|
||||
#line 20 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 18 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
if (!string.IsNullOrEmpty(da.DocumentTemplateId))
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 19 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.DocumentTemplate.Description);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 19 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
#line 20 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
if (!string.IsNullOrEmpty(da.DocumentTemplateId))
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 21 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.Comments);
|
||||
Write(da.DocumentTemplate.Description);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 21 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </span><span");
|
||||
|
||||
#line 23 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.Comments);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 23 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </span><span");
|
||||
|
||||
WriteLiteral(" class=\"author\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 22 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.TechUser.ToString());
|
||||
#line 24 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.TechUser.ToString());
|
||||
|
||||
|
||||
#line default
|
||||
@@ -219,40 +226,40 @@ WriteLiteral("></span><span");
|
||||
|
||||
WriteLiteral(" class=\"timestamp\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 1232), Tuple.Create("\"", 1270)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 1422), Tuple.Create("\"", 1460)
|
||||
|
||||
#line 22 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1240), Tuple.Create<System.Object, System.Int32>(da.Timestamp.ToFullDateTime()
|
||||
#line 24 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1430), Tuple.Create<System.Object, System.Int32>(da.Timestamp.ToFullDateTime()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1240), false)
|
||||
, 1430), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 22 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.Timestamp.ToFuzzy());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span>\r\n </a> \r\n");
|
||||
|
||||
|
||||
#line 24 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
}
|
||||
}
|
||||
Write(da.Timestamp.ToFuzzy());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n <div");
|
||||
WriteLiteral("</span>\r\n </a> \r\n");
|
||||
|
||||
|
||||
#line 26 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"attachmentInput clearfix\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"action upload\"");
|
||||
|
||||
@@ -260,52 +267,35 @@ WriteLiteral("></span><span");
|
||||
|
||||
WriteLiteral(" class=\"action photo\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </div>\r\n <script");
|
||||
WriteLiteral("></span>\r\n </div>\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
Shadowbox.init({
|
||||
skipSetup: true,
|
||||
modal: true
|
||||
});
|
||||
$(function () {
|
||||
if (!document.DiscoFunctions) {
|
||||
document.DiscoFunctions = {};
|
||||
}
|
||||
document.DiscoFunctions.addAttachment = addAttachment;
|
||||
|
||||
$Attachments = $('#Attachments');
|
||||
$attachmentOutput = $Attachments.find('.attachmentOutput');
|
||||
|
||||
$attachmentOutput.find('span.remove').click(removeAttachment);
|
||||
|
||||
$('#dialogUpload').dialog({ autoOpen: false,
|
||||
draggable: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
width: 860,
|
||||
height: 550,
|
||||
close: function () {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
|
||||
}
|
||||
});
|
||||
|
||||
$('#dialogRemoveAttachment').dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
var onLoadNavigation = null;
|
||||
var isLoaded = null;
|
||||
Silverlight.createObject(
|
||||
'");
|
||||
WriteLiteral(">\r\n Shadowbox.init({\r\n skipSetup: true," +
|
||||
"\r\n modal: true\r\n });\r\n " +
|
||||
" $(function () {\r\n if (!document.DiscoFunctions) {\r\n " +
|
||||
" document.DiscoFunctions = {};\r\n " +
|
||||
" }\r\n document.DiscoFunctions.addAttachment = addAttachmen" +
|
||||
"t;\r\n\r\n $Attachments = $(\'#Attachments\');\r\n " +
|
||||
" $attachmentOutput = $Attachments.find(\'.attachmentOutput\');\r\n\r\n " +
|
||||
" $attachmentOutput.find(\'span.remove\').click(removeAttachment);\r\n" +
|
||||
"\r\n $(\'#dialogUpload\').dialog({\r\n " +
|
||||
" autoOpen: false,\r\n draggable: false,\r\n " +
|
||||
" modal: true,\r\n resizable: false,\r\n " +
|
||||
" width: 860,\r\n height: 550,\r\n" +
|
||||
" close: function () {\r\n " +
|
||||
" silverlightUploadAttachment.content.Navigator.Navigate(\'/Hidden\');\r\n " +
|
||||
" }\r\n });\r\n\r\n $(\'#" +
|
||||
"dialogRemoveAttachment\').dialog({\r\n resizable: false," +
|
||||
"\r\n height: 140,\r\n modal: t" +
|
||||
"rue,\r\n autoOpen: false\r\n });\r\n" +
|
||||
"\r\n var onLoadNavigation = null;\r\n " +
|
||||
"var isLoaded = null;\r\n Silverlight.createObject(\r\n " +
|
||||
" \'");
|
||||
|
||||
|
||||
#line 67 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap);
|
||||
#line 70 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -314,17 +304,18 @@ WriteLiteral(@"',
|
||||
$('#silverlightHostUploadAttachment').get(0),
|
||||
'silverlightUploadAttachment',
|
||||
{ width: '840px', height: '500px', background: 'white', version: '4.0.60310.0' },
|
||||
{ onLoad: function () {
|
||||
if (onLoadNavigation) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
|
||||
isLoaded = true;
|
||||
{
|
||||
onLoad: function () {
|
||||
if (onLoadNavigation) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
|
||||
isLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'UploadUrl=");
|
||||
|
||||
|
||||
#line 78 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
#line 82 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)));
|
||||
|
||||
|
||||
@@ -356,7 +347,7 @@ WriteLiteral(@"'
|
||||
url: '");
|
||||
|
||||
|
||||
#line 101 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
#line 105 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Device.Attachment()));
|
||||
|
||||
|
||||
@@ -374,7 +365,7 @@ WriteLiteral(@"',
|
||||
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
|
||||
|
||||
|
||||
#line 110 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
#line 114 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Device.AttachmentDownload()));
|
||||
|
||||
|
||||
@@ -384,7 +375,7 @@ WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon
|
||||
"\'");
|
||||
|
||||
|
||||
#line 111 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
#line 115 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Device.AttachmentThumbnail()));
|
||||
|
||||
|
||||
@@ -417,7 +408,7 @@ WriteLiteral("/\' + a.Id);\r\n e.find(\'.comm
|
||||
" $.ajax({\r\n url: \'");
|
||||
|
||||
|
||||
#line 143 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
#line 147 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Device.AttachmentRemove()));
|
||||
|
||||
|
||||
@@ -443,36 +434,47 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n
|
||||
" },\r\n \"Cancel\": function () {\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
|
||||
" }\r\n });\r\n\r\n $dialogR" +
|
||||
"emoveAttachment.dialog(\'open\');\r\n \r\n " +
|
||||
" return false;\r\n }\r\n\r\n $attachmentOutput" +
|
||||
".children(\'a\').each(function () {\r\n $this = $(this);\r\n " +
|
||||
" if ($this.attr(\'data-mimetype\').toLowerCase().indexOf(\'imag" +
|
||||
"e/\') == 0)\r\n $this.shadowbox({ gallery: \'attachments\'" +
|
||||
", player: \'img\', title: $this.find(\'.comments\').text() });\r\n " +
|
||||
"});\r\n });\r\n </script>\r\n </td>\r\n </tr>\r\n</tab" +
|
||||
"le>\r\n<div");
|
||||
"emoveAttachment.dialog(\'open\');\r\n\r\n return false;\r\n " +
|
||||
" }\r\n\r\n $attachmentOutput.children(\'a\').each(func" +
|
||||
"tion () {\r\n $this = $(this);\r\n if " +
|
||||
"($this.attr(\'data-mimetype\').toLowerCase().indexOf(\'image/\') == 0)\r\n " +
|
||||
" $this.shadowbox({ gallery: \'attachments\', player: \'img\', title: " +
|
||||
"$this.find(\'.comments\').text() });\r\n });\r\n });" +
|
||||
"\r\n </script>\r\n </td>\r\n </tr>\r\n </table>\r\n " +
|
||||
" <div");
|
||||
|
||||
WriteLiteral(" id=\"dialogUpload\"");
|
||||
|
||||
WriteLiteral(" title=\"Upload Attachment\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"silverlightHostUploadAttachment\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n</div>\r\n<div");
|
||||
WriteLiteral(">\r\n </div>\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"dialogRemoveAttachment\"");
|
||||
|
||||
WriteLiteral(" title=\"Remove this Attachment?\"");
|
||||
|
||||
WriteLiteral(">\r\n <p>\r\n <span");
|
||||
WriteLiteral(">\r\n <p>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||
|
||||
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
|
||||
|
||||
WriteLiteral("></span>\r\n Are you sure?</p>\r\n</div>");
|
||||
WriteLiteral("></span>\r\n Are you sure?\r\n </p>\r\n </div>\r\n <script>\r\n " +
|
||||
" $(\'#DeviceDetailTabItems\').append(\'<li><a href=\"#DeviceDetailTab-Resources\" " +
|
||||
"id=\"DeviceDetailTab-ResourcesLink\">Attachments [");
|
||||
|
||||
|
||||
#line 200 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Model.Device.DeviceAttachments == null ? 0 : Model.Device.DeviceAttachments.Count);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,717 @@
|
||||
@model Disco.Web.Models.Device.ShowModel
|
||||
@{
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
|
||||
}
|
||||
<table id="Device_Show_Subjects">
|
||||
<tr>
|
||||
<td id="Device_Show_Details">
|
||||
<div>
|
||||
<div id="Device_Show_Details_Asset">
|
||||
<table class="none verticalHeadings">
|
||||
<tr>
|
||||
<td><span title="Computer Name">Name:</span>
|
||||
</td>
|
||||
<td>@if (string.IsNullOrWhiteSpace(Model.Device.ComputerName))
|
||||
{
|
||||
<span id="Device_Show_Details_Asset_NameUnknown" title="Computer Name" class="smallMessage"><Unknown/Not Allocated></span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h4 id="Device_Show_Details_Asset_Name" title="Computer Name">@Model.Device.ComputerName</h4>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Asset:</td>
|
||||
<td>@Html.TextBoxFor(m => m.Device.AssetNumber, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Location:</td>
|
||||
<td>@Html.TextBoxFor(m => m.Device.Location, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script>
|
||||
$(function () {
|
||||
document.DiscoFunctions.PropertyChangeHelper($('#Device_AssetNumber'), 'Unknown', '@Url.Action(MVC.API.Device.UpdateAssetNumber(Model.Device.SerialNumber, null))', 'AssetNumber');
|
||||
document.DiscoFunctions.PropertyChangeHelper($('#Device_Location'), 'Unknown', '@Url.Action(MVC.API.Device.UpdateLocation(Model.Device.SerialNumber, null))', 'Location');
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<div id="Device_Show_Details_Dates" class="status">
|
||||
<table class="none verticalHeadings">
|
||||
<tr>
|
||||
<td>Created:
|
||||
</td>
|
||||
<td><span id="Device_Show_Details_Dates_Created">@CommonHelpers.FriendlyDate(Model.Device.CreatedDate)</span></td>
|
||||
</tr>
|
||||
@if (Model.Device.DecommissionedDate.HasValue)
|
||||
{
|
||||
<tr>
|
||||
<td>Decommissioned:
|
||||
</td>
|
||||
<td><span id="Device_Show_Details_Dates_Decommissioned">@CommonHelpers.FriendlyDate(Model.Device.DecommissionedDate)</span></td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
<tr>
|
||||
<td>Enrolled:
|
||||
</td>
|
||||
<td>
|
||||
@if (Model.Device.EnrolledDate.HasValue)
|
||||
{
|
||||
<text>First: </text><span id="Device_Show_Details_Asset_Enrolled_First">@CommonHelpers.FriendlyDate(Model.Device.EnrolledDate)</span>
|
||||
if (Model.Device.LastEnrolDate.HasValue && Model.Device.EnrolledDate.Value != Model.Device.LastEnrolDate.Value)
|
||||
{
|
||||
<br /><text>Last: </text><span id="Device_Show_Details_Asset_Enrolled_Last">@CommonHelpers.FriendlyDate(Model.Device.LastEnrolDate)</span>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<span id="Device_Show_Details_Asset_Enrolled_Never" class="smallMessage">Never</span>
|
||||
}
|
||||
@if (Model.Device.AllowUnauthenticatedEnrol)
|
||||
{
|
||||
<span id="Device_Show_Details_Asset_Enrolled_Trusted" title="Trusted Unauthenticated Enrolment is Allowed"></span>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<div id="Device_Show_Details_Status" class="status">
|
||||
<table class="none verticalHeadings">
|
||||
<tr>
|
||||
<td><span title="Last Network Logon Date">Last Seen:</span>
|
||||
</td>
|
||||
<td>@{
|
||||
string lastSeenClass = null;
|
||||
if (Model.Device.LastNetworkLogonDate.HasValue)
|
||||
{
|
||||
if (Model.Device.LastNetworkLogonDate.Value < DateTime.Now.AddDays(-30))
|
||||
{
|
||||
lastSeenClass = "error";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Model.Device.LastNetworkLogonDate.Value < DateTime.Now.AddDays(-7))
|
||||
{
|
||||
lastSeenClass = "alert";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<span id="Device_Show_Details_Status_LastSeen" class="@lastSeenClass">@CommonHelpers.FriendlyDate(Model.Device.LastNetworkLogonDate)</span></td>
|
||||
@if (!string.IsNullOrEmpty(Model.Device.ComputerName))
|
||||
{
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var updated = false;
|
||||
var span = $('#Device_Show_Details_Status_LastSeen');
|
||||
var spanProgress = null;
|
||||
|
||||
$.getJSON('@(Url.Action(MVC.API.Device.LastNetworkLogonDate(Model.Device.SerialNumber)))', function (response, result) {
|
||||
|
||||
updated = true;
|
||||
if (spanProgress)
|
||||
spanProgress.hide();
|
||||
|
||||
if (result != 'success') {
|
||||
alert('Unable to retrieve latest network logon date:\n' + response);
|
||||
$('<span>').addClass('smallMessage').text('[may not be current]').appendTo(span);
|
||||
} else {
|
||||
span.attr('title', response.Formatted).text(response.Friendly);
|
||||
}
|
||||
});
|
||||
window.setTimeout(function () {
|
||||
if (!updated) {
|
||||
spanProgress = $('<span>').addClass('ajaxHelperIcon ajaxLoading ajaxShowInitially').attr('title', 'Loading...').appendTo(span);
|
||||
}
|
||||
}, 250);
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="status">
|
||||
@{
|
||||
var assignedUser = Model.Device.AssignedUser;
|
||||
}
|
||||
<table class="none verticalHeadings">
|
||||
<tr>
|
||||
<td>Assignment:
|
||||
</td>
|
||||
<td>
|
||||
@if (assignedUser != null)
|
||||
{
|
||||
<div id="Device_Show_User">
|
||||
<div id="Device_Show_User_DisplayName" title="Display Name">@Html.ActionLink(assignedUser.DisplayName, MVC.User.Show(assignedUser.Id))</div>
|
||||
<div id="Device_Show_User_Id" title="Id">@assignedUser.Id <span id="Device_Show_User_Type" title="Type">[@(assignedUser.Type)]</span></div>
|
||||
@if (!string.IsNullOrWhiteSpace(assignedUser.PhoneNumber))
|
||||
{
|
||||
<div id="Device_Show_User_PhoneNumber" title="Phone Number">@assignedUser.PhoneNumber</div>
|
||||
}
|
||||
@if (!string.IsNullOrWhiteSpace(assignedUser.EmailAddress))
|
||||
{
|
||||
<div id="Device_Show_User_EmailAddress" title="Email Address"><a href="mailto:@(Model.Device.AssignedUser.EmailAddress)">@assignedUser.EmailAddress</a></div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="smallMessage">Not Assigned</span>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="Device_Show_GenerateDocument_Container" class="status">
|
||||
@Html.DropDownList("Device_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems)
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var generatePdfUrl = '@Url.Action(MVC.API.Device.GeneratePdf(Model.Device.SerialNumber.ToString(), null))?DocumentTemplateId=';
|
||||
var $documentTemplates = $('#Device_Show_GenerateDocument');
|
||||
$documentTemplates.change(function () {
|
||||
var v = $documentTemplates.val();
|
||||
if (v) {
|
||||
window.location.href = generatePdfUrl + v;
|
||||
$documentTemplates.val('').blur();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td id="Device_Show_Policies" rowspan="2">
|
||||
<div>
|
||||
<div id="Device_Show_Policies_Profile">
|
||||
<h2 title="Device Profile">@Html.ActionLink(Model.Device.DeviceProfile.Name, MVC.Config.DeviceProfile.Index(Model.Device.DeviceProfileId))</h2>
|
||||
<table class="none verticalHeadings">
|
||||
<tr>
|
||||
<td><span title="Distribution Type">Distribution:</span>
|
||||
</td>
|
||||
<td>@Model.Device.DeviceProfile.DistributionType.ToString()
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span title="Address">Address:</span>
|
||||
</td>
|
||||
<td>@{
|
||||
if (Model.DeviceProfileDefaultOrganisationAddress != null)
|
||||
{
|
||||
<span id="Device_Show_Policies_Profile_Address">@Model.DeviceProfileDefaultOrganisationAddress.Name</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span id="Device_Show_Policies_Profile_Address_None" class="smallMessage">None</span>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span title="Provision Active Directory Account">Provision Account:</span>
|
||||
</td>
|
||||
<td>@(Model.Device.DeviceProfile.ProvisionADAccount ? "Active Directory" : "No")
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span title="Allocate Certificates">Allocate Certificate:</span>
|
||||
</td>
|
||||
<td>@(Model.DeviceProfileCertificateProvider != null ? Model.DeviceProfileCertificateProvider.Name : "No")
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@if (Model.Device.CanUpdateDeviceProfile())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Update Profile", MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber, null, true), "Device_Show_Policies_Profile_Actions_Update_Button")
|
||||
|
||||
<div id="Device_Show_Policies_Profile_Actions_Update_Dialog" class="dialog" title="Assign to Device Profile">
|
||||
<div>
|
||||
<ul class="none">
|
||||
@foreach (var dp in Model.DeviceProfiles.OrderBy(i => i.Name))
|
||||
{
|
||||
<li>
|
||||
<input type="radio" data-deviceprofileid="@dp.Id" name="DeviceProfile" id="DeviceProfile_@(dp.Id)" /><label for="DeviceProfile_@(dp.Id)" title="Distribution: @(dp.DistributionType)">@dp.Name</label></li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
var currentProfile = '@(Model.Device.DeviceProfileId)';
|
||||
var button = $('#Device_Show_Policies_Profile_Actions_Update_Button');
|
||||
var buttonDialog = null;
|
||||
var dialogInputs = null;
|
||||
var dialogContainers = null;
|
||||
|
||||
button.click(function () {
|
||||
|
||||
if (!buttonDialog) {
|
||||
buttonDialog = $('#Device_Show_Policies_Profile_Actions_Update_Dialog')
|
||||
.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
maxHeight: 450,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Update Profile": function () {
|
||||
var deviceProfileId = dialogInputs.filter(':checked').attr('data-deviceprofileid');
|
||||
|
||||
if (deviceProfileId) {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = button.attr('href') + '&DeviceProfileId=' + deviceProfileId;
|
||||
} else {
|
||||
alert('A device profile must be selected');
|
||||
}
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
dialogInputs = buttonDialog.find('input');
|
||||
dialogContainers = dialogInputs.closest('li');
|
||||
|
||||
dialogInputs.change(function () {
|
||||
dialogContainers.removeClass('selected');
|
||||
$(this).closest('li').addClass('selected');
|
||||
});
|
||||
}
|
||||
|
||||
dialogInputs.filter('[data-deviceprofileid=' + currentProfile + ']').prop('checked', true).change();
|
||||
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</div>
|
||||
<div id="Device_Show_Policies_Batch" class="status">
|
||||
@if (Model.Device.DeviceBatchId.HasValue)
|
||||
{
|
||||
<h2 title="Device Batch">@Html.ActionLink(Model.Device.DeviceBatch.Name, MVC.Config.DeviceBatch.Index(Model.Device.DeviceBatchId.Value))</h2>
|
||||
<table class="none verticalHeadings">
|
||||
<tr>
|
||||
<td><span title="Purchased Date">Purchased:</span>
|
||||
</td>
|
||||
<td>@CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.PurchaseDate)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span title="Supplier">Supplier:</span>
|
||||
</td>
|
||||
<td>@(Model.Device.DeviceBatch.Supplier ?? "Unknown")
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span title="Warranty Valid Until">Warranty Until:</span>
|
||||
</td>
|
||||
<td class="@(Model.Device.DeviceBatch.WarrantyValidUntil.HasValue && Model.Device.DeviceBatch.WarrantyValidUntil.Value < DateTime.Now ? "alert" : null)">@CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.WarrantyValidUntil, "Unknown", null)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span title="Insurance Supplier">Insurance Supplier:</span>
|
||||
</td>
|
||||
<td>@(Model.Device.DeviceBatch.InsuranceSupplier ?? "Unknown")
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span title="Insured Until">Insured Until:</span>
|
||||
</td>
|
||||
<td class="@(Model.Device.DeviceBatch.InsuredUntil.HasValue && Model.Device.DeviceBatch.InsuredUntil.Value < DateTime.Now ? "alert" : null)">@CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.InsuredUntil, "Unknown", null)
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h2>Batch: <em>Not Associated</em></h2>
|
||||
}
|
||||
@if (Model.Device.CanUpdateDeviceBatch())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Update Batch", MVC.API.Device.UpdateDeviceBatchId(Model.Device.SerialNumber, null, true), "Device_Show_Policies_Batch_Actions_Update_Button")
|
||||
|
||||
<div id="Device_Show_Policies_Batch_Actions_Update_Dialog" class="dialog" title="Assign to Device Batch">
|
||||
<div>
|
||||
<ul class="none">
|
||||
@foreach (var db in Model.DeviceBatches.OrderBy(i => i.Name))
|
||||
{
|
||||
<li>
|
||||
<input type="radio" data-devicebatchid="@db.Id" name="DeviceBatch" id="DeviceBatch_@(db.Id)" /><label for="DeviceBatch_@(db.Id)" title="Purchased: @(db.PurchaseDate.ToFuzzy())">@db.Name</label></li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
var currentBatch = '@(Model.Device.DeviceBatchId)';
|
||||
var button = $('#Device_Show_Policies_Batch_Actions_Update_Button');
|
||||
var buttonDialog = null;
|
||||
var dialogInputs = null;
|
||||
var dialogContainers = null;
|
||||
|
||||
button.click(function () {
|
||||
|
||||
if (!buttonDialog) {
|
||||
buttonDialog = $('#Device_Show_Policies_Batch_Actions_Update_Dialog')
|
||||
.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
maxHeight: 450,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Update Batch": function () {
|
||||
var deviceBatchId = dialogInputs.filter(':checked').attr('data-devicebatchid');
|
||||
|
||||
if (deviceBatchId) {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = button.attr('href') + '&DeviceBatchId=' + deviceBatchId;
|
||||
} else {
|
||||
alert('A device batch must be selected');
|
||||
}
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
dialogInputs = buttonDialog.find('input');
|
||||
dialogContainers = dialogInputs.closest('li');
|
||||
|
||||
dialogInputs.change(function () {
|
||||
dialogContainers.removeClass('selected');
|
||||
$(this).closest('li').addClass('selected');
|
||||
});
|
||||
}
|
||||
|
||||
dialogInputs.filter('[data-devicebatchid=' + currentBatch + ']').prop('checked', true).change();
|
||||
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td id="Device_Show_Aspects" rowspan="2">
|
||||
<div>
|
||||
<div id="Device_Show_Aspects_Model" class="clearfix">
|
||||
<h2 id="Device_Show_Aspects_Model_Description" title="Model Description">@Html.ActionLink(Model.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId))</h2>
|
||||
<img id="Device_Show_Aspects_Model_Image" alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))" />
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="Device_Show_Subjects_Actions">
|
||||
<td id="Device_Show_Device_Actions">
|
||||
@if (Model.Device.CanCreateJob())
|
||||
{
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
|
||||
@Html.ActionLinkSmallButton("Create Job", MVC.Job.Create(Model.Device.SerialNumber, Model.Device.AssignedUserId), "buttonCreateJob")
|
||||
}
|
||||
@if (Model.Device.CanUpdateAssignment())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Update Assignment", MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber, null, true), "Device_Show_User_Actions_Assign_Button")
|
||||
<div id="Device_Show_User_Actions_Assign_Dialog" class="dialog" title="Assign this Device?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Assign to User:
|
||||
<input id="Device_Show_User_Actions_Assign_UserId" type="text" />
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#Device_Show_User_Actions_Assign_Button');
|
||||
var buttonDialog = null;
|
||||
var inputUserId = null;
|
||||
|
||||
var dialogButtons = {
|
||||
@{
|
||||
if (assignedUser != null)
|
||||
{
|
||||
<text>
|
||||
"Unassign": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = button.attr('href');
|
||||
},
|
||||
</text>
|
||||
}
|
||||
}
|
||||
"Assign": function () {
|
||||
var $this = $(this);
|
||||
var userId = inputUserId.val();
|
||||
if (userId) {
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = button.attr('href') + '&AssignedUserId=' + userId;
|
||||
} else {
|
||||
alert('Enter a user to assign this device');
|
||||
}
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
|
||||
button.click(function () {
|
||||
if (!buttonDialog) {
|
||||
buttonDialog = $('#Device_Show_User_Actions_Assign_Dialog')
|
||||
.dialog({
|
||||
resizable: false,
|
||||
height: 160,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: dialogButtons
|
||||
});
|
||||
inputUserId = $('#Device_Show_User_Actions_Assign_UserId');
|
||||
inputUserId.focus(function () { inputUserId.select() })
|
||||
.autocomplete({
|
||||
source: '@(Url.Action(MVC.API.User.UpstreamUsers()))',
|
||||
minLength: 2,
|
||||
select: function (e, ui) {
|
||||
inputUserId.val(ui.item.Id);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
inputUserId.data('ui-autocomplete')._renderItem = function (ul, item) {
|
||||
return $("<li>")
|
||||
.data("item.autocomplete", item)
|
||||
.append("<a><strong>" + item.DisplayName + "</strong><br>" + item.Id + " (" + item.Type + ")</a>")
|
||||
.appendTo(ul);
|
||||
};
|
||||
}
|
||||
buttonDialog.dialog('open');
|
||||
inputUserId.focus();
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@if (Model.Device.CanUpdateTrustEnrol())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Trust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, true.ToString(), true), "Device_Show_Device_Actions_TrustEnrol_Button")
|
||||
<div id="Device_Show_Device_Actions_TrustEnrol_Dialog" title="Trust this Device?">
|
||||
<div class="ui-widget">
|
||||
<div class="ui-state-highlight ui-corner-all" style="padding: 6px;">
|
||||
<div style="padding-bottom: 6px;">
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
This action will allow a device <em>claiming</em> to have the Serial Number '@(Model.Device.SerialNumber)' to be enrolled without authentication.
|
||||
</div>
|
||||
<strong>Are you sure you want to allow an unauthenticated enrolment?</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="smallMessage" style="margin-top: 10px; font-size: 1em;">
|
||||
Devices flagged as 'trusted' are allowed a single-use device enrolment without providing authentication (for example: Active Directory Computer Account).<br />
|
||||
Once a devices enrol, their trust setting is reset and additional enrolments need to be authenticated (domain joined) or manually trusted again.
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#Device_Show_Device_Actions_TrustEnrol_Button');
|
||||
var buttonDialog = $('#Device_Show_Device_Actions_TrustEnrol_Dialog');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
width: 400,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Trust": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@if (Model.Device.CanUpdateUntrustEnrol())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Untrust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, false.ToString(), true), "Device_Show_Device_Actions_UntrustEnrol_Button")
|
||||
<div id="Device_Show_Device_Actions_UntrustEnrol_Dialog" title="Untrust this Device?">
|
||||
<div style="padding-bottom: 6px;">
|
||||
<span class="ui-icon ui-icon-info" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
This action will require the device to enrol with authentication (for example: domain joined).
|
||||
</div>
|
||||
<strong>Are you sure you want to require an authenticated enrolment?</strong>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#Device_Show_Device_Actions_UntrustEnrol_Button');
|
||||
var buttonDialog = $('#Device_Show_Device_Actions_UntrustEnrol_Dialog');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
width: 400,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Untrust": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@if (Model.Device.CanDecommission())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Decommission", MVC.API.Device.Decommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Decommission_Button")
|
||||
<div id="Device_Show_Device_Actions_Decommission_Dialog" class="dialog" title="Decommission this Device?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Are you sure?
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#Device_Show_Device_Actions_Decommission_Button');
|
||||
var buttonDialog = null;
|
||||
|
||||
button.click(function () {
|
||||
|
||||
if (!buttonDialog) {
|
||||
buttonDialog = $('#Device_Show_Device_Actions_Decommission_Dialog')
|
||||
.dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Decommission": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = button.attr('href');
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@if (Model.Device.CanRecommission())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Recommission", MVC.API.Device.Recommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Recommission_Button")
|
||||
<div id="Device_Show_Device_Actions_Recommission_Dialog" title="Recommission this Device?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Are you sure?
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#Device_Show_Device_Actions_Recommission_Button');
|
||||
var buttonDialog = $('#Device_Show_Device_Actions_Recommission_Dialog');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Recommission": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@if (Model.Device.CanDelete())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Delete Device", MVC.API.Device.Delete(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Delete_Button")
|
||||
<div id="Device_Show_Device_Actions_Delete_Dialog" title="Delete this Device?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
This item will be permanently deleted and cannot be recovered.<br />
|
||||
Jobs linked to this Device (but not to a User) will be deleted also.<br />
|
||||
Are you sure?
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#Device_Show_Device_Actions_Delete_Button');
|
||||
var buttonDialog = $('#Device_Show_Device_Actions_Delete_Dialog');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
height: 200,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Delete": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,478 +1,53 @@
|
||||
@model Disco.Web.Models.Device.ShowModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), string.Format("{0} ({1})", Model.Device.ComputerName, Model.Device.SerialNumber));
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), string.Format("Device: {0}", Model.Device.SerialNumber));
|
||||
|
||||
var deviceStatus = Model.Device.Status();
|
||||
}
|
||||
<table class="deviceShow">
|
||||
<tr>
|
||||
<td class="details">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Computer Name:
|
||||
</th>
|
||||
<td class="value">
|
||||
@if (string.IsNullOrWhiteSpace(Model.Device.ComputerName))
|
||||
{
|
||||
<span class="smallMessage"><Unknown/Not Allocated></span>
|
||||
<div id="Device_Show">
|
||||
<div id="Device_Show_Status">
|
||||
<span class="icon DeviceStatus@(deviceStatus.Replace(" ", string.Empty))"></span>@deviceStatus
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#Device_Show_Status').appendTo('#layout_PageHeading')
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
@Html.Partial(MVC.Device.Views.DeviceParts._Subject, Model)
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $tabs = $('#DeviceDetailTabs');
|
||||
$tabs.tabs({
|
||||
activate: function (event, ui) {
|
||||
window.setTimeout(function () {
|
||||
var $window = $(window);
|
||||
var tabHeight = $tabs.height();
|
||||
var tabOffset = $tabs.offset();
|
||||
var windowScrollTop = $window.scrollTop();
|
||||
var windowHeight = $window.height();
|
||||
|
||||
var tabTopNotShown = windowScrollTop - tabOffset.top;
|
||||
if (tabTopNotShown > 0) {
|
||||
$('html').animate({ scrollTop: tabOffset.top }, 125);
|
||||
} else {
|
||||
var tabBottomNotShown = ((windowScrollTop + windowHeight) - (tabHeight + tabOffset.top)) * -1;
|
||||
if (tabBottomNotShown > 0) {
|
||||
if (tabHeight > windowHeight)
|
||||
$('html').animate({ scrollTop: tabOffset.top }, 125);
|
||||
else
|
||||
$('html').animate({ scrollTop: windowScrollTop + tabBottomNotShown }, 125);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@Model.Device.ComputerName
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Asset Number:
|
||||
</th>
|
||||
<td class="value">
|
||||
@Html.TextBoxFor(m => m.Device.AssetNumber)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $ajaxSave = $('#Device_AssetNumber').next('.ajaxSave');
|
||||
$('#Device_AssetNumber').watermark('Asset Number').keydown(function (e) {
|
||||
$ajaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).change(function () {
|
||||
var $this = $(this);
|
||||
$ajaxSave.hide();
|
||||
var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
|
||||
var data = { AssetNumber: $this.val() };
|
||||
$.getJSON('@(Url.Action(@MVC.API.Device.UpdateAssetNumber(Model.Device.SerialNumber)))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Asset Number:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
}).blur(function () {
|
||||
$ajaxSave.hide();
|
||||
}).focus(function () {
|
||||
$(this).select();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Location:
|
||||
</th>
|
||||
<td class="value">
|
||||
@Html.TextBoxFor(m => m.Device.Location)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $ajaxSave = $('#Device_Location').next('.ajaxSave');
|
||||
$('#Device_Location').watermark('Location').keydown(function (e) {
|
||||
$ajaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).change(function () {
|
||||
var $this = $(this);
|
||||
$ajaxSave.hide();
|
||||
var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
|
||||
var data = { Location: $this.val() };
|
||||
$.getJSON('@(Url.Action(@MVC.API.Device.UpdateLocation(Model.Device.SerialNumber)))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Location:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
}).blur(function () {
|
||||
$ajaxSave.hide();
|
||||
}).focus(function () {
|
||||
$(this).select();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Batch:
|
||||
</th>
|
||||
<td class="value">
|
||||
@Html.DropDownListFor(m => m.Device.DeviceBatchId, Model.DeviceBatches.ToSelectListItems(Model.Device.DeviceBatchId))
|
||||
@AjaxHelpers.AjaxLoader() <span id="deviceBatchDetails" class="icon16" title="Batch Details"></span>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $DeviceBatchId = $('#Device_DeviceBatchId');
|
||||
var $DeviceBatchDetails = $('#deviceBatchDetails');
|
||||
var $DeviceBatchSummary = $('#deviceBatchSummary');
|
||||
var initUpdate = false;
|
||||
var jsonDate = function (json, unknownValue) {
|
||||
if (json && json.indexOf('') == 0) {
|
||||
return $.datepicker.formatDate('yy-mm-dd', new Date(parseInt(json.substr(6, json.length - 8))));
|
||||
} else
|
||||
return unknownValue;
|
||||
}
|
||||
var updateDetails = function (deviceBatchId) {
|
||||
$.getJSON('@(Url.Action(MVC.API.DeviceBatch.Index()))/' + deviceBatchId, function (response, result) {
|
||||
if (result == 'success') {
|
||||
if (response.Supplier)
|
||||
$DeviceBatchSummary.find('.supplier').text(response.Supplier);
|
||||
else
|
||||
$DeviceBatchSummary.find('.supplier').text('Unknown');
|
||||
|
||||
$DeviceBatchSummary.find('.purchaseDate').text(jsonDate(response.PurchaseDate, 'Unknown'));
|
||||
$DeviceBatchSummary.find('.warrantyValidUntil').text(jsonDate(response.WarrantyValidUntil, 'Unknown'));
|
||||
|
||||
if (response.InsuranceSupplier)
|
||||
$DeviceBatchSummary.find('.insuranceSupplier').text(response.InsuranceSupplier);
|
||||
else
|
||||
$DeviceBatchSummary.find('.insuranceSupplier').text('Unknown');
|
||||
|
||||
$DeviceBatchSummary.find('.insuredUntil').text(jsonDate(response.InsuredUntil, 'Unknown'));
|
||||
|
||||
if (initUpdate){
|
||||
$DeviceBatchSummary.show();
|
||||
$DeviceBatchDetails.show();
|
||||
initUpdate = false;
|
||||
}else{
|
||||
$DeviceBatchSummary.slideDown('fast');
|
||||
$DeviceBatchDetails.fadeIn();
|
||||
}
|
||||
} else {
|
||||
alert('Unable to load Device Batch details:\n' + response);
|
||||
}
|
||||
});
|
||||
};
|
||||
$DeviceBatchDetails.click(function () {
|
||||
window.location.href = '@(Url.Action(MVC.Config.DeviceBatch.Index(null)))/' + $DeviceBatchId.val();
|
||||
});
|
||||
$DeviceBatchId.change(function () {
|
||||
var $this = $(this);
|
||||
var $ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
$DeviceBatchSummary.hide();
|
||||
$DeviceBatchDetails.hide();
|
||||
var data = { DeviceBatchId: $this.val() };
|
||||
$.getJSON('@(Url.Action(MVC.API.Device.UpdateDeviceBatchId(Model.Device.SerialNumber)))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Device Batch:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
if ($DeviceBatchId.val())
|
||||
updateDetails($DeviceBatchId.val());
|
||||
}
|
||||
});
|
||||
});
|
||||
$DeviceBatchSummary.hide();
|
||||
if ($DeviceBatchId.val()){
|
||||
initUpdate = true;
|
||||
updateDetails($DeviceBatchId.val());
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div id="deviceBatchSummary">
|
||||
<table class="sub">
|
||||
<tr>
|
||||
<th style="width: 50px">
|
||||
<strong>Purchased:</strong>
|
||||
</th>
|
||||
<td>
|
||||
Supplier: <span class="supplier"></span>
|
||||
<br />
|
||||
On: <span class="purchaseDate"></span>
|
||||
</td>
|
||||
<th style="width: 50px">
|
||||
<strong>Warranty:</strong>
|
||||
</th>
|
||||
<td>
|
||||
Valid Until: <span class="warrantyValidUntil"></span>
|
||||
</td>
|
||||
<th style="width: 50px">
|
||||
<strong>Insurance:</strong>
|
||||
</th>
|
||||
<td>
|
||||
Supplier: <span class="insuranceSupplier"></span>
|
||||
<br />
|
||||
Until: <span class="insuredUntil"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Profile:
|
||||
</th>
|
||||
<td class="value">
|
||||
@if (Model.Device.DecommissionedDate.HasValue)
|
||||
{
|
||||
@Model.Device.DeviceProfile.ToString()
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.DropDownListFor(m => m.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.Device.DeviceProfile))
|
||||
@AjaxHelpers.AjaxLoader()<span id="deviceProfileDetails" class="icon16" title="Profile Details"></span>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#Device_DeviceProfileId').change(function () {
|
||||
var $this = $(this);
|
||||
var $ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
var data = { DeviceProfileId: $this.val() };
|
||||
$.getJSON('@(Url.Action(MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber)))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Device Profile:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#deviceProfileDetails').click(function(){
|
||||
window.location.href = '@(Url.Action(MVC.Config.DeviceProfile.Index(null)))/' + $('#Device_DeviceProfileId').val();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Created:
|
||||
</th>
|
||||
<td class="value">
|
||||
@CommonHelpers.FriendlyDate(Model.Device.CreatedDate)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Enrolment:
|
||||
</th>
|
||||
<td class="value">
|
||||
First:
|
||||
@CommonHelpers.FriendlyDate(Model.Device.EnrolledDate)
|
||||
@if (Model.Device.AllowUnauthenticatedEnrol)
|
||||
{
|
||||
<a class="unlocked16" href="@Url.Action(MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, "false", true))" title="Unauthenticated Enrolment is Allowed">
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="locked16" href="@Url.Action(MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, "true", true))" title="Unauthenticated Enrolment is Blocked">
|
||||
</a>
|
||||
}
|
||||
<br />
|
||||
Last:
|
||||
@CommonHelpers.FriendlyDate(Model.Device.LastEnrolDate)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Decommissioned:
|
||||
</th>
|
||||
<td class="value">
|
||||
@CommonHelpers.FriendlyDate(Model.Device.DecommissionedDate)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Last Network Logon:
|
||||
</th>
|
||||
<td class="value">
|
||||
<span id="lastNetworkLogonDate" class="nowrap">@CommonHelpers.FriendlyDate(Model.Device.LastNetworkLogonDate)</span>
|
||||
@if (!string.IsNullOrEmpty(Model.Device.ComputerName))
|
||||
{
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var span = $('#lastNetworkLogonDate');
|
||||
$('<span>').addClass('ajaxHelperIcon ajaxLoading ajaxShowInitially').attr('title', 'Loading...').appendTo(span);
|
||||
|
||||
$.getJSON('@(Url.Action(MVC.API.Device.LastNetworkLogonDate(Model.Device.SerialNumber)))', function (response, result) {
|
||||
if (result != 'success') {
|
||||
alert('Unable to retrieve latest network logon date:\n' + response);
|
||||
$('<span>').addClass('smallMessage').text('[may not be current]').appendTo(span);
|
||||
} else {
|
||||
span.find('.ajaxLoading').hide();
|
||||
span.attr('title', response.Formatted).text(response.Friendly);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
@if (!Model.Device.DecommissionedDate.HasValue)
|
||||
{
|
||||
<tr>
|
||||
<th class="name">
|
||||
Assigned User:
|
||||
</th>
|
||||
<td class="value">
|
||||
@Html.TextBoxFor(m => m.Device.AssignedUser, new { userId = Model.Device.AssignedUserId })
|
||||
@AjaxHelpers.AjaxRemove()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<br />
|
||||
<a href="#" id="Device_AssignedUser_History_Trigger" class="smallLink">Show Assignment
|
||||
History (<span id="Device_AssignedUser_History_RecordCount"></span>)</a> <span id="Device_AssignedUser_History_None"
|
||||
class="smallMessage" style="display: none">No Assignment History Available</span>
|
||||
<div id="dialogRemoveAssignedUser" title="Remove this Device Assignment?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Are you sure?</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
// Common Objects
|
||||
var $assignedUser = $('#Device_AssignedUser');
|
||||
var $ajaxLoading = $assignedUser.nextAll('.ajaxLoading').first();
|
||||
var $ajaxRemove = $assignedUser.nextAll('.ajaxRemove').first();
|
||||
|
||||
// Assign User
|
||||
$assignedUser
|
||||
.watermark('No Assigned User')
|
||||
.focus(function () { $assignedUser.select() })
|
||||
.autocomplete({
|
||||
source: '@(Url.Action(MVC.API.User.UpstreamUsers()))',
|
||||
minLength: 2,
|
||||
focus: function (e, ui) {
|
||||
$assignedUser.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
|
||||
return false;
|
||||
},
|
||||
select: function (e, ui) {
|
||||
updateAssignedUser(ui.item.Id);
|
||||
$assignedUser.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.data('ui-autocomplete')._renderItem = function (ul, item) {
|
||||
return $("<li></li>")
|
||||
.data("item.autocomplete", item)
|
||||
.append("<a><strong>" + item.DisplayName + "</strong><br>" + item.Id + " (" + item.Type + ")</a>")
|
||||
.appendTo(ul);
|
||||
};
|
||||
|
||||
var $dialogRemoveAssignedUser = $('#dialogRemoveAssignedUser');
|
||||
$dialogRemoveAssignedUser.dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Remove": function () {
|
||||
updateAssignedUser('');
|
||||
$assignedUser.val('');
|
||||
$dialogRemoveAssignedUser.dialog("close");
|
||||
},
|
||||
"Cancel": function () {
|
||||
$dialogRemoveAssignedUser.dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Un-Assign User
|
||||
if ($assignedUser.val() != '')
|
||||
$ajaxRemove.show();
|
||||
$ajaxRemove.click(function () {
|
||||
$dialogRemoveAssignedUser.dialog('open');
|
||||
return false;
|
||||
});
|
||||
|
||||
// History
|
||||
var deviceUserAssignmentCount = @(Model.Device.DeviceUserAssignments.Count);
|
||||
if (deviceUserAssignmentCount > 0) {
|
||||
$('#Device_AssignedUser_History_Trigger').click(function () {
|
||||
$(this).hide();
|
||||
$('#Device_AssignedUser_History_Host').show();
|
||||
$('#Device_AssignedUser_History').slideDown('slow');
|
||||
return false;
|
||||
});
|
||||
var recordCountText = deviceUserAssignmentCount + ' record';
|
||||
if (deviceUserAssignmentCount != 1)
|
||||
recordCountText += 's';
|
||||
$('#Device_AssignedUser_History_RecordCount').text(recordCountText)
|
||||
}
|
||||
else {
|
||||
$('#Device_AssignedUser_History_Trigger').hide();
|
||||
$('#Device_AssignedUser_History_None').show();
|
||||
};
|
||||
|
||||
function updateAssignedUser(userId) {
|
||||
$ajaxLoading.show();
|
||||
$ajaxRemove.hide();
|
||||
var data = { AssignedUserId: userId };
|
||||
$.getJSON('@(Url.Action(MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber)))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Assigned User:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
if (userId != '')
|
||||
$ajaxRemove.fadeIn('fast');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
}, 1);
|
||||
}
|
||||
<tr id="Device_AssignedUser_History_Host" style="@(Model.Device.DecommissionedDate.HasValue ? "" : "display: none")">
|
||||
<td colspan="2">
|
||||
<div id="Device_AssignedUser_History" style="@(Model.Device.DecommissionedDate.HasValue ? "" : "display: none")">
|
||||
<h2>
|
||||
Assigned User History</h2>
|
||||
@Html.Partial(MVC.Device.Views._DeviceUserAssignmentHistoryTable, Model.Device)
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Generate Documents:
|
||||
</th>
|
||||
<td class="value" colspan="3">
|
||||
@Html.DropDownList("DocumentTemplates", Model.DocumentTemplatesSelectListItems)
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var generatePdfUrl = '@Url.Action(MVC.API.Device.GeneratePdf(Model.Device.SerialNumber, null))?DocumentTemplateId=';
|
||||
var $documentTemplates = $('#DocumentTemplates');
|
||||
$documentTemplates.change(function () {
|
||||
var v = $documentTemplates.val();
|
||||
if (v) {
|
||||
window.location.href = generatePdfUrl + v;
|
||||
$documentTemplates.val('');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="model">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="subtleHighlight">
|
||||
<img alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))" />
|
||||
<h2>
|
||||
<a href="@(Url.Action(MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId)))">@Model.Device.DeviceModel.ToString()</a></h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>
|
||||
Certificates</h2>
|
||||
@Html.Partial(MVC.Device.Views._CertificateTable, Model.Certificates)
|
||||
<h2>
|
||||
Attachments</h2>
|
||||
@Html.Partial(MVC.Device.Views.DeviceParts.Resources, Model)
|
||||
<h2>
|
||||
Jobs</h2>
|
||||
@Html.Partial(MVC.Shared.Views._JobTable, Model.Jobs)
|
||||
@Html.Partial(MVC.Device.Views._DeviceActions, Model.Device)
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div id="DeviceDetailTabs">
|
||||
<ul id="DeviceDetailTabItems"></ul>
|
||||
@Html.Partial(MVC.Device.Views.DeviceParts.Jobs, Model)
|
||||
@Html.Partial(MVC.Device.Views.DeviceParts.AssignmentHistory, Model)
|
||||
@Html.Partial(MVC.Device.Views.DeviceParts.Resources, Model)
|
||||
@Html.Partial(MVC.Device.Views.DeviceParts.Certificates, Model)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,326 +0,0 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18033
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Views.Device
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/_DeviceActions.cshtml")]
|
||||
public partial class DeviceActions : System.Web.Mvc.WebViewPage<Disco.Models.Repository.Device>
|
||||
{
|
||||
public DeviceActions()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
WriteLiteral("<div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 3 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 3 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
if (Model.CanDecommission())
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 5 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
Write(Html.ActionLinkButton("Decommission", MVC.API.Device.Decommission(Model.SerialNumber, true), "buttonDeviceDecommission"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 5 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"dialogConfirmDecommission\"");
|
||||
|
||||
WriteLiteral(" title=\"Decommission this Device?\"");
|
||||
|
||||
WriteLiteral(">\r\n <p>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||
|
||||
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
|
||||
|
||||
WriteLiteral("></span>\r\n Are you sure?</p>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var button = $('#buttonDeviceDecommission');
|
||||
var buttonDialog = $('#dialogConfirmDecommission');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
""Decommission"": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog(""disable"");
|
||||
$this.dialog(""option"", ""buttons"", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog(""close"");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
|
||||
#line 40 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 41 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
if (Model.CanRecommission())
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 43 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
Write(Html.ActionLinkButton("Recommission", MVC.API.Device.Recommission(Model.SerialNumber, true), "buttonDeviceRecommission"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 43 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"dialogConfirmRecommission\"");
|
||||
|
||||
WriteLiteral(" title=\"Recommission this Device?\"");
|
||||
|
||||
WriteLiteral(">\r\n <p>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||
|
||||
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
|
||||
|
||||
WriteLiteral("></span>\r\n Are you sure?</p>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var button = $('#buttonDeviceRecommission');
|
||||
var buttonDialog = $('#dialogConfirmRecommission');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
""Recommission"": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog(""disable"");
|
||||
$this.dialog(""option"", ""buttons"", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog(""close"");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
|
||||
#line 78 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 79 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
if (Model.CanDelete())
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 81 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
Write(Html.ActionLinkButton("Delete Device", MVC.API.Device.Delete(Model.SerialNumber, true), "buttonDeviceDelete"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 81 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"dialogConfirmDelete\"");
|
||||
|
||||
WriteLiteral(" title=\"Delete this Device?\"");
|
||||
|
||||
WriteLiteral(">\r\n <p>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||
|
||||
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
|
||||
|
||||
WriteLiteral("></span>\r\n This item will be permanently deleted and cannot be rec" +
|
||||
"overed.<br />\r\n Jobs linked to this Device (but not to a User) wi" +
|
||||
"ll be deleted also.<br />\r\n Are you sure?</p>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var button = $('#buttonDeviceDelete');
|
||||
var buttonDialog = $('#dialogConfirmDelete');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
height: 200,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
""Delete"": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog(""disable"");
|
||||
$this.dialog(""option"", ""buttons"", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog(""close"");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
|
||||
#line 118 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 119 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
if (Model.CanCreateJob())
|
||||
{
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 122 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
Write(Html.ActionLinkButton("Create Job", MVC.Job.Create(Model.SerialNumber, Model.AssignedUserId), "buttonCreateJob"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 122 "..\..\Views\Device\_DeviceActions.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -1,142 +0,0 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18033
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Views.Device
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/_DeviceUserAssignmentHistoryTable.cshtml")]
|
||||
public partial class DeviceUserAssignmentHistoryTable : System.Web.Mvc.WebViewPage<Disco.Models.Repository.Device>
|
||||
{
|
||||
public DeviceUserAssignmentHistoryTable()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
|
||||
if (Model.DeviceUserAssignments.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <table");
|
||||
|
||||
WriteLiteral(" class=\"genericData smallTable\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <th>\r\n User\r\n </th>\r\n " +
|
||||
" <th>\r\n Assigned\r\n </th>\r\n <th>\r\n " +
|
||||
" Unassigned\r\n </th>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 16 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 16 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
|
||||
foreach (var dua in Model.DeviceUserAssignments.OrderByDescending(m => m.AssignedDate))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 20 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
|
||||
Write(Html.ActionLink(dua.AssignedUser.ToString(), MVC.User.Show(dua.AssignedUserId)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 23 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(dua.AssignedDate));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 26 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(dua.UnassignedDate, "Current"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 29 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </table>\r\n");
|
||||
|
||||
|
||||
#line 31 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">No Assignment History Available</span>\r\n");
|
||||
|
||||
|
||||
#line 35 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
Reference in New Issue
Block a user