124 lines
5.1 KiB
Plaintext
124 lines
5.1 KiB
Plaintext
@model Disco.Models.Repository.Device
|
|
<div class="actionBar">
|
|
@if (Model.CanDecommission())
|
|
{
|
|
@Html.ActionLinkButton("Decommission", MVC.API.Device.Decommission(Model.SerialNumber, true), "buttonDeviceDecommission")
|
|
<div id="dialogConfirmDecommission" 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 = $('#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>
|
|
}
|
|
@if (Model.CanRecommission())
|
|
{
|
|
@Html.ActionLinkButton("Recommission", MVC.API.Device.Recommission(Model.SerialNumber, true), "buttonDeviceRecommission")
|
|
<div id="dialogConfirmRecommission" 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 = $('#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>
|
|
}
|
|
@if (Model.CanDelete())
|
|
{
|
|
@Html.ActionLinkButton("Delete Device", MVC.API.Device.Delete(Model.SerialNumber, true), "buttonDeviceDelete")
|
|
<div id="dialogConfirmDelete" 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 = $('#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>
|
|
}
|
|
@if (Model.CanCreateJob())
|
|
{
|
|
Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
|
|
@Html.ActionLinkButton("Create Job", MVC.Job.Create(Model.SerialNumber, Model.AssignedUserId), "buttonCreateJob")
|
|
}
|
|
</div> |