Permissions & Authorization for Users #24

Initial Release; Includes Database and MVC refactoring
This commit is contained in:
Gary Sharp
2013-10-10 19:13:16 +11:00
parent 172ce5524a
commit a099d68915
458 changed files with 40221 additions and 12130 deletions
+101 -66
View File
@@ -1,6 +1,15 @@
@model Disco.Web.Models.Device.AddOfflineModel
@{
Authorization.Require(Claims.Device.Actions.EnrolDevices);
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Add Offline");
var hasAssetNumber = Authorization.Has(Claims.Device.Properties.AssetNumber);
var hasLocation = Authorization.Has(Claims.Device.Properties.Location);
var hasDeviceBatch = Authorization.Has(Claims.Device.Properties.DeviceBatch);
var hasDeviceProfile = Authorization.Has(Claims.Device.Properties.DeviceProfile);
var hasAssignUser = Authorization.Has(Claims.Device.Actions.AssignUser);
}
@using (Html.BeginForm())
{
@@ -8,86 +17,111 @@
<div class="form" style="width: 450px">
<table>
<tr>
<th>
Serial Number:
<th>Serial Number:
</th>
<td>
@Html.TextBoxFor(model => model.Device.SerialNumber)<br />
@Html.ValidationMessageFor(model => model.Device.SerialNumber)
</td>
</tr>
<tr>
<th>
Asset Number:
</th>
<td>@Html.TextBoxFor(model => model.Device.AssetNumber)<br />
@Html.ValidationMessageFor(model => model.Device.AssetNumber)
</td>
</tr>
<tr>
<th>
Location:
</th>
<td>@Html.TextBoxFor(model => model.Device.Location)<br />
@Html.ValidationMessageFor(model => model.Device.Location)
</td>
</tr>
<tr>
<th>
Device Batch:
</th>
<td>
@Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches.ToSelectListItems()) <br />
@Html.ValidationMessageFor(model => model.Device.DeviceBatchId)
</td>
</tr>
<tr>
<th>
Device Profile:
</th>
<td>
@Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId))<br />
@Html.ValidationMessageFor(model => model.Device.DeviceProfileId)
</td>
</tr>
<tr>
<th>
Assigned User:
</th>
<td>
@Html.TextBoxFor(model => model.Device.AssignedUserId)<br />
@Html.ValidationMessageFor(model => model.Device.AssignedUserId)
</td>
</tr>
@if (hasAssetNumber)
{
<tr>
<th>Asset Number:
</th>
<td>@Html.TextBoxFor(model => model.Device.AssetNumber)<br />
@Html.ValidationMessageFor(model => model.Device.AssetNumber)
</td>
</tr>
}
@if (hasLocation)
{
<tr>
<th>Location:
</th>
<td>@Html.TextBoxFor(model => model.Device.Location)<br />
@Html.ValidationMessageFor(model => model.Device.Location)
</td>
</tr>
}
@if (hasDeviceBatch)
{
<tr>
<th>Device Batch:
</th>
<td>
@Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches.ToSelectListItems())
<br />
@Html.ValidationMessageFor(model => model.Device.DeviceBatchId)
</td>
</tr>
}
@if (hasDeviceProfile)
{
<tr>
<th>Device Profile:
</th>
<td>
@Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId))<br />
@Html.ValidationMessageFor(model => model.Device.DeviceProfileId)
</td>
</tr>
}
@if (hasAssignUser)
{
<tr>
<th>Assigned User:
</th>
<td>
@Html.TextBoxFor(model => model.Device.AssignedUserId)<br />
@Html.ValidationMessageFor(model => model.Device.AssignedUserId)
</td>
</tr>
}
</table>
<p class="actions">
@if (!hasDeviceProfile)
{
@Html.Hidden("Device.DeviceProfileId", Model.DefaultDeviceProfileId)
}
<input type="submit" class="button" value="Add" />
</p>
<script type="text/javascript">
$(function () {
$SerialNumber = $('#Device_SerialNumber');
$AssetNumber = $('#Device_AssetNumber');
$Location = $('#Device_Location');
$AssignedUserId = $('#Device_AssignedUserId');
<script type="text/javascript">
$(function () {
var $SerialNumber = $('#Device_SerialNumber').focus();
$SerialNumber.focus().keydown(function (e) {
@if (hasAssignUser)
{<text>
$SerialNumber.keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
return false;
}
});
$AssetNumber.keydown(function (e) {
if (e.which == 13) {
$Location.focus();
return false;
}
});
$Location.keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
$('#Device_AssignedUserId').focus();
return false;
}
});</text>}
@if (hasAssetNumber)
{<text>
$('#Device_AssetNumber').keydown(function (e) {
if (e.which == 13) {
@if (hasLocation)
{<text>$('#Device_Location').focus(); return false;</text>}
else if (hasAssignUser)
{<text>$('#Device_AssignedUserId').focus(); return false;</text>}
}
});
</text>}
@if (hasLocation && hasAssignUser)
{<text>
$('#Device_Location').keydown(function (e) {
if (e.which == 13) {
$('#Device_AssignedUserId').focus();
return false;
}
});
</text>}
@if (hasAssignUser)
{<text>
var $AssignedUserId = $('#Device_AssignedUserId');
$AssignedUserId
.watermark('Search Users')
.focus(function () { $AssignedUserId.select() })
@@ -108,7 +142,8 @@
.append("<a><strong>" + item.DisplayName + "</strong><br>" + item.Id + " (" + item.Type + ")</a>")
.appendTo(ul);
};
</text>}
});
</script>
</script>
</div>
}
+349 -116
View File
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Device
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/AddOffline.cshtml")]
public partial class AddOffline : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.AddOfflineModel>
public partial class AddOffline : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.AddOfflineModel>
{
public AddOffline()
{
@@ -43,15 +45,24 @@ namespace Disco.Web.Views.Device
#line 2 "..\..\Views\Device\AddOffline.cshtml"
Authorization.Require(Claims.Device.Actions.EnrolDevices);
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Add Offline");
var hasAssetNumber = Authorization.Has(Claims.Device.Properties.AssetNumber);
var hasLocation = Authorization.Has(Claims.Device.Properties.Location);
var hasDeviceBatch = Authorization.Has(Claims.Device.Properties.DeviceBatch);
var hasDeviceProfile = Authorization.Has(Claims.Device.Properties.DeviceProfile);
var hasAssignUser = Authorization.Has(Claims.Device.Actions.AssignUser);
#line default
#line hidden
WriteLiteral("\r\n");
#line 5 "..\..\Views\Device\AddOffline.cshtml"
#line 14 "..\..\Views\Device\AddOffline.cshtml"
using (Html.BeginForm())
{
@@ -59,14 +70,14 @@ WriteLiteral("\r\n");
#line default
#line hidden
#line 7 "..\..\Views\Device\AddOffline.cshtml"
#line 16 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 7 "..\..\Views\Device\AddOffline.cshtml"
#line 16 "..\..\Views\Device\AddOffline.cshtml"
@@ -78,13 +89,13 @@ WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 450px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n S" +
"erial Number:\r\n </th>\r\n <td>\r\n");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>Serial Number:\r\n " +
" </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 15 "..\..\Views\Device\AddOffline.cshtml"
#line 23 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.SerialNumber));
@@ -95,132 +106,260 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 16 "..\..\Views\Device\AddOffline.cshtml"
#line 24 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.SerialNumber));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Asset Number:\r\n </th>\r\n <td" +
">");
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 23 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.AssetNumber));
#line 27 "..\..\Views\Device\AddOffline.cshtml"
#line default
#line hidden
#line 27 "..\..\Views\Device\AddOffline.cshtml"
if (hasAssetNumber)
{
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 24 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.AssetNumber));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Location:\r\n </th>\r\n <td>");
#line 31 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.Location));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
WriteLiteral(" <tr>\r\n <th>Asset Number:\r\n " +
"</th>\r\n <td>");
#line 32 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.Location));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Device Batch:\r\n </th>\r\n <td" +
">\r\n");
WriteLiteral(" ");
#line 40 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches.ToSelectListItems()));
#line default
#line hidden
WriteLiteral(" <br />\r\n");
WriteLiteral(" ");
#line 41 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.DeviceBatchId));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Device Profile:\r\n </th>\r\n <" +
"td>\r\n");
WriteLiteral(" ");
#line 49 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId)));
Write(Html.TextBoxFor(model => model.Device.AssetNumber));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
WriteLiteral(" ");
#line 50 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.DeviceProfileId));
#line 33 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.AssetNumber));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Assigned User:\r\n </th>\r\n <t" +
"d>\r\n");
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
WriteLiteral(" ");
#line 36 "..\..\Views\Device\AddOffline.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 37 "..\..\Views\Device\AddOffline.cshtml"
if (hasLocation)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>Location:\r\n </th" +
">\r\n <td>");
#line 42 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.Location));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 43 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.Location));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 46 "..\..\Views\Device\AddOffline.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 47 "..\..\Views\Device\AddOffline.cshtml"
if (hasDeviceBatch)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>Device Batch:\r\n " +
"</th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 53 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches.ToSelectListItems()));
#line default
#line hidden
WriteLiteral("\r\n <br />\r\n");
WriteLiteral(" ");
#line 55 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.DeviceBatchId));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 58 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.AssignedUserId));
}
#line default
#line hidden
WriteLiteral(" ");
#line 59 "..\..\Views\Device\AddOffline.cshtml"
if (hasDeviceProfile)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>Device Profile:\r\n " +
" </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 65 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId)));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
WriteLiteral(" ");
#line 59 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.AssignedUserId));
#line 66 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.DeviceProfileId));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n <p");
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 69 "..\..\Views\Device\AddOffline.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 70 "..\..\Views\Device\AddOffline.cshtml"
if (hasAssignUser)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>Assigned User:\r\n " +
" </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 76 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.AssignedUserId));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 77 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.AssignedUserId));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 80 "..\..\Views\Device\AddOffline.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n <p");
WriteLiteral(" class=\"actions\"");
WriteLiteral(">\r\n <input");
WriteLiteral(">\r\n");
#line 83 "..\..\Views\Device\AddOffline.cshtml"
#line default
#line hidden
#line 83 "..\..\Views\Device\AddOffline.cshtml"
if (!hasDeviceProfile)
{
#line default
#line hidden
#line 85 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.Hidden("Device.DeviceProfileId", Model.DefaultDeviceProfileId));
#line default
#line hidden
#line 85 "..\..\Views\Device\AddOffline.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n <input");
WriteLiteral(" type=\"submit\"");
@@ -228,35 +367,123 @@ WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Add\"");
WriteLiteral(" />\r\n </p>\r\n <script");
WriteLiteral(" />\r\n </p>\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
$SerialNumber = $('#Device_SerialNumber');
$AssetNumber = $('#Device_AssetNumber');
$Location = $('#Device_Location');
$AssignedUserId = $('#Device_AssignedUserId');
WriteLiteral(">\r\n $(function () {\r\n var $SerialNumber = $(\'#D" +
"evice_SerialNumber\').focus();\r\n\r\n");
$SerialNumber.focus().keydown(function (e) {
#line 94 "..\..\Views\Device\AddOffline.cshtml"
#line default
#line hidden
#line 94 "..\..\Views\Device\AddOffline.cshtml"
if (hasAssignUser)
{
#line default
#line hidden
WriteLiteral("\r\n $SerialNumber.keydown(function (e) {\r\n if (e" +
".which == 13) {\r\n $(\'#Device_AssignedUserId\').focus();\r\n " +
" return false;\r\n }\r\n });" +
"");
#line 101 "..\..\Views\Device\AddOffline.cshtml"
}
#line default
#line hidden
#line 102 "..\..\Views\Device\AddOffline.cshtml"
if (hasAssetNumber)
{
#line default
#line hidden
WriteLiteral("\r\n $(\'#Device_AssetNumber\').keydown(function (e) {\r\n " +
" if (e.which == 13) {\r\n");
#line 106 "..\..\Views\Device\AddOffline.cshtml"
#line default
#line hidden
#line 106 "..\..\Views\Device\AddOffline.cshtml"
if (hasLocation)
{
#line default
#line hidden
WriteLiteral("$(\'#Device_Location\').focus(); return false;");
#line 107 "..\..\Views\Device\AddOffline.cshtml"
}
else if (hasAssignUser)
{
#line default
#line hidden
WriteLiteral("$(\'#Device_AssignedUserId\').focus(); return false;");
#line 109 "..\..\Views\Device\AddOffline.cshtml"
}
#line default
#line hidden
WriteLiteral(" }\r\n });\r\n ");
#line 112 "..\..\Views\Device\AddOffline.cshtml"
}
#line default
#line hidden
#line 113 "..\..\Views\Device\AddOffline.cshtml"
if (hasLocation && hasAssignUser)
{
#line default
#line hidden
WriteLiteral(@"
$('#Device_Location').keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
return false;
}
});
$AssetNumber.keydown(function (e) {
if (e.which == 13) {
$Location.focus();
return false;
}
});
$Location.keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
$('#Device_AssignedUserId').focus();
return false;
}
});
");
#line 121 "..\..\Views\Device\AddOffline.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 122 "..\..\Views\Device\AddOffline.cshtml"
if (hasAssignUser)
{
#line default
#line hidden
WriteLiteral(@"
var $AssignedUserId = $('#Device_AssignedUserId');
$AssignedUserId
.watermark('Search Users')
.focus(function () { $AssignedUserId.select() })
@@ -264,7 +491,7 @@ WriteLiteral(@">
source: '");
#line 95 "..\..\Views\Device\AddOffline.cshtml"
#line 129 "..\..\Views\Device\AddOffline.cshtml"
Write(Url.Action(MVC.API.User.UpstreamUsers()));
@@ -286,13 +513,19 @@ WriteLiteral(@"',
.append(""<a><strong>"" + item.DisplayName + ""</strong><br>"" + item.Id + "" ("" + item.Type + "")</a>"")
.appendTo(ul);
};
});
</script>
</div>
");
");
#line 114 "..\..\Views\Device\AddOffline.cshtml"
#line 145 "..\..\Views\Device\AddOffline.cshtml"
}
#line default
#line hidden
WriteLiteral(" });\r\n </script>\r\n </div>\r\n");
#line 149 "..\..\Views\Device\AddOffline.cshtml"
}
@@ -1,4 +1,7 @@
@model Disco.Web.Models.Device.ShowModel
@{
Authorization.Require(Claims.Device.ShowAssignmentHistory);
}
<div id="DeviceDetailTab-AssignmentHistory" class="DevicePart">
@if (Model.Device.DeviceUserAssignments.Count > 0)
{
@@ -15,7 +18,14 @@
{
<tr>
<td>
@Html.ActionLink(dua.AssignedUser.ToString(), MVC.User.Show(dua.AssignedUserId))
@if (Authorization.Has(Claims.User.Show))
{
@Html.ActionLink(dua.AssignedUser.ToString(), MVC.User.Show(dua.AssignedUserId))
}
else
{
@dua.AssignedUser.ToString()
}
</td>
<td>
@CommonHelpers.FriendlyDate(dua.AssignedDate)
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,19 +28,29 @@ namespace Disco.Web.Views.Device.DeviceParts
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/DeviceParts/_AssignmentHistory.cshtml")]
public partial class AssignmentHistory : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ShowModel>
public partial class AssignmentHistory : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.ShowModel>
{
public AssignmentHistory()
{
}
public override void Execute()
{
WriteLiteral("<div");
#line 2 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
Authorization.Require(Claims.Device.ShowAssignmentHistory);
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" id=\"DeviceDetailTab-AssignmentHistory\"");
@@ -49,13 +59,13 @@ WriteLiteral(" class=\"DevicePart\"");
WriteLiteral(">\r\n");
#line 3 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
#line 6 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
#line default
#line hidden
#line 3 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
#line 6 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
if (Model.Device.DeviceUserAssignments.Count > 0)
{
@@ -71,13 +81,13 @@ WriteLiteral(">\r\n <tr>\r\n <th>User\r\n
" </th>\r\n </tr>\r\n");
#line 14 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
#line 17 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
#line default
#line hidden
#line 14 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
#line 17 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
foreach (var dua in Model.Device.DeviceUserAssignments.OrderByDescending(m => m.AssignedDate))
{
@@ -86,21 +96,58 @@ WriteLiteral(">\r\n <tr>\r\n <th>User\r\n
#line hidden
WriteLiteral(" <tr>\r\n <td>\r\n");
WriteLiteral(" ");
#line 18 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
Write(Html.ActionLink(dua.AssignedUser.ToString(), MVC.User.Show(dua.AssignedUserId)));
#line 21 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
#line default
#line hidden
#line 21 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
if (Authorization.Has(Claims.User.Show))
{
#line default
#line hidden
#line 23 "..\..\Views\Device\DeviceParts\_AssignmentHistory.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");
#line 23 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
}
else
{
#line default
#line hidden
#line 27 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
Write(dua.AssignedUser.ToString());
#line default
#line hidden
#line 27 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 21 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
#line 31 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
Write(CommonHelpers.FriendlyDate(dua.AssignedDate));
@@ -111,7 +158,7 @@ WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 24 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
#line 34 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
Write(CommonHelpers.FriendlyDate(dua.UnassignedDate, "Current"));
@@ -120,7 +167,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 27 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
#line 37 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
}
@@ -129,7 +176,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n");
WriteLiteral(" </table>\r\n");
#line 29 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
#line 39 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
}
else
{
@@ -144,7 +191,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Assignment History Available</span>\r\n");
#line 33 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
#line 43 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
}
@@ -154,7 +201,7 @@ WriteLiteral(" <script>\r\n $(\'#DeviceDetailTabItems\').append(\'<li>
"ilTab-AssignmentHistory\">Assignment History [");
#line 35 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
#line 45 "..\..\Views\Device\DeviceParts\_AssignmentHistory.cshtml"
Write(Model.Device.DeviceUserAssignments.Count);
@@ -1,4 +1,8 @@
@model Disco.Web.Models.Device.ShowModel
@{
Authorization.Require(Claims.Device.ShowCertificates);
var hasDownloadCert = Authorization.Has(Claims.Config.DeviceCertificate.DownloadCertificates);
}
<div id="DeviceDetailTab-Certificates" class="DevicePart">
<div class="genericData certificateTable">
@if (Model.Certificates.Count() > 0)
@@ -18,7 +22,14 @@
{
<tr>
<td>
@Html.ActionLink(item.Name, MVC.API.DeviceCertificate.Download(item.Id))
@if (hasDownloadCert)
{
@Html.ActionLink(item.Name, MVC.API.DeviceCertificate.Download(item.Id))
}
else
{
@item.Name
}
</td>
<td>
@item.Enabled
@@ -41,4 +52,4 @@
<script>
$('#DeviceDetailTabItems').append('<li><a href="#DeviceDetailTab-Certificates">Certificates [@(Model.Certificates.Count)]</a></li>');
</script>
</div>
</div>
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,19 +28,30 @@ namespace Disco.Web.Views.Device.DeviceParts
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
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 partial class Certificates : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.ShowModel>
{
public Certificates()
{
}
public override void Execute()
{
WriteLiteral("<div");
#line 2 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
Authorization.Require(Claims.Device.ShowCertificates);
var hasDownloadCert = Authorization.Has(Claims.Config.DeviceCertificate.DownloadCertificates);
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" id=\"DeviceDetailTab-Certificates\"");
@@ -53,13 +64,13 @@ WriteLiteral(" class=\"genericData certificateTable\"");
WriteLiteral(">\r\n");
#line 4 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
#line 8 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
#line default
#line hidden
#line 4 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
#line 8 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
if (Model.Certificates.Count() > 0)
{
@@ -84,13 +95,13 @@ WriteLiteral(@">
");
#line 17 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
#line 21 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
#line default
#line hidden
#line 17 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
#line 21 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
foreach (var item in Model.Certificates)
{
@@ -99,21 +110,58 @@ WriteLiteral(@">
#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 25 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
#line default
#line hidden
#line 25 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
if (hasDownloadCert)
{
#line default
#line hidden
#line 27 "..\..\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");
#line 27 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
}
else
{
#line default
#line hidden
#line 31 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
Write(item.Name);
#line default
#line hidden
#line 31 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 24 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
#line 35 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
Write(item.Enabled);
@@ -124,7 +172,7 @@ WriteLiteral("\r\n </td>\r\n <td>\
WriteLiteral(" ");
#line 27 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
#line 38 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
Write(CommonHelpers.FriendlyDate(item.AllocatedDate));
@@ -135,7 +183,7 @@ WriteLiteral("\r\n </td>\r\n <td>\
WriteLiteral(" ");
#line 30 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
#line 41 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
Write(CommonHelpers.FriendlyDate(item.ExpirationDate));
@@ -144,7 +192,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 33 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
#line 44 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
}
@@ -153,7 +201,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n
WriteLiteral(" </table>\r\n");
#line 35 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
#line 46 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
}
else
{
@@ -168,7 +216,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Certificates Allocated</span>\r\n");
#line 39 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
#line 50 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
}
@@ -178,13 +226,13 @@ WriteLiteral(" </div>\r\n <script>\r\n $(\'#DeviceDetailTabItems\')
"\"#DeviceDetailTab-Certificates\">Certificates [");
#line 42 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
#line 53 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
Write(Model.Certificates.Count);
#line default
#line hidden
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>");
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>\r\n");
}
}
@@ -1,4 +1,7 @@
@model Disco.Web.Models.Device.ShowModel
@{
Authorization.Require(Claims.Device.ShowDetails);
}
<div id="DeviceDetailTab-Details" class="DevicePart">
<div id="DeviceDetailTab-DetailsContainer">
<table class="tableData">
@@ -28,19 +28,29 @@ namespace Disco.Web.Views.Device.DeviceParts
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/DeviceParts/_Details.cshtml")]
public partial class Details : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ShowModel>
public partial class Details : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.ShowModel>
{
public Details()
{
}
public override void Execute()
{
WriteLiteral("<div");
#line 2 "..\..\Views\Device\DeviceParts\_Details.cshtml"
Authorization.Require(Claims.Device.ShowDetails);
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" id=\"DeviceDetailTab-Details\"");
@@ -58,7 +68,7 @@ WriteLiteral(">\r\n <tbody>\r\n <tr>\r\n
"ress</th>\r\n <td>");
#line 8 "..\..\Views\Device\DeviceParts\_Details.cshtml"
#line 11 "..\..\Views\Device\DeviceParts\_Details.cshtml"
Write(Model.Device.DeviceDetails.LanMacAddress() ?? "Unknown");
@@ -68,7 +78,7 @@ WriteLiteral("</td>\r\n </tr>\r\n <tr>\r\n
"MAC Address</th>\r\n <td>");
#line 12 "..\..\Views\Device\DeviceParts\_Details.cshtml"
#line 15 "..\..\Views\Device\DeviceParts\_Details.cshtml"
Write(Model.Device.DeviceDetails.WLanMacAddress() ?? "Unknown");
@@ -1,9 +1,12 @@
@model Disco.Web.Models.Device.ShowModel
@{
Authorization.Require(Claims.Device.ShowJobs);
}
<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>');
$('#DeviceDetailTabItems').append('<li><a href="#DeviceDetailTab-Jobs">Jobs [@(Model.Jobs.Items.Count)]</a></li>');
</script>
</div>
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,19 +28,29 @@ namespace Disco.Web.Views.Device.DeviceParts
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
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 partial class Jobs : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.ShowModel>
{
public Jobs()
{
}
public override void Execute()
{
WriteLiteral("<div");
#line 2 "..\..\Views\Device\DeviceParts\_Jobs.cshtml"
Authorization.Require(Claims.Device.ShowJobs);
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" id=\"DeviceDetailTab-Jobs\"");
@@ -55,7 +65,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 4 "..\..\Views\Device\DeviceParts\_Jobs.cshtml"
#line 7 "..\..\Views\Device\DeviceParts\_Jobs.cshtml"
Write(Html.Partial(MVC.Shared.Views._JobTable, Model.Jobs));
@@ -65,8 +75,8 @@ WriteLiteral("\r\n </div>\r\n <script>\r\n $(\'#DeviceDetailTabItem
"f=\"#DeviceDetailTab-Jobs\">Jobs [");
#line 7 "..\..\Views\Device\DeviceParts\_Jobs.cshtml"
Write(Model.Device.Jobs == null ? 0 : Model.Device.Jobs.Count);
#line 10 "..\..\Views\Device\DeviceParts\_Jobs.cshtml"
Write(Model.Jobs.Items.Count);
#line default
@@ -1,13 +1,23 @@
@model Disco.Web.Models.Device.ShowModel
@{
Authorization.Require(Claims.Device.ShowAttachments);
var canAddAttachments = Authorization.Has(Claims.Device.Actions.AddAttachments);
var canRemoveAnyAttachments = Authorization.Has(Claims.Device.Actions.RemoveAnyAttachments);
var canRemoveOwnAttachments = Authorization.Has(Claims.Device.Actions.RemoveOwnAttachments);
Html.BundleDeferred("~/Style/Shadowbox");
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
if (Authorization.Has(Claims.Device.Actions.AddAttachments))
{
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
}
}
<div id="DeviceDetailTab-Resources" class="DevicePart">
<table id="deviceShowResources">
<tr>
<td id="Attachments">
<td id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")">
<div class="attachmentOutput">
@if (Model.Device.DeviceAttachments != null)
{
@@ -21,30 +31,35 @@
{ @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>
</span><span class="author">@da.TechUser.ToString()</span>@if (canRemoveAnyAttachments || (canRemoveOwnAttachments && da.TechUserId == CurrentUser.Id))
{<text><span class="remove"></span></text>}<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>
@if (canAddAttachments)
{
<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 () {
$Attachments = $('#Attachments');
$attachmentOutput = $Attachments.find('.attachmentOutput');
@if (canAddAttachments)
{<text>
//#region Add Attachments
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,
@@ -57,6 +72,101 @@
}
});
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;
}
}
},
'UploadUrl=@(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)))'
);
$attachmentInput = $Attachments.find('.attachmentInput');
$attachmentInput.find('.photo').click(function () {
showDialog('/WebCam');
});
$attachmentInput.find('.upload').click(function () {
showDialog('/File');
});
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
function showDialog(navigationPath) {
$('#dialogUpload').dialog('open');
if (isLoaded) {
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
} else {
onLoadNavigation = navigationPath;
}
};
function addAttachment(id, quick) {
var data = { id: id };
$.ajax({
url: '@Url.Action(MVC.API.Device.Attachment())',
dataType: 'json',
data: data,
success: function (d) {
if (d.Result == 'OK') {
var a = d.Attachment;
@if (canRemoveAnyAttachments)
{<text>buildAttachment(a, true);</text>}
else if (canRemoveOwnAttachments)
{<text>buildAttachment(a, (a.AuthorId === '@(CurrentUser.Id)'));</text>}
else
{<text>buildAttachment(a, false);</text>}
} else {
alert('Unable to add attachment: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add attachment: ' + textStatus);
}
});
}
function buildAttachment(a, canRemove) {
var t = '<a><span class="icon"><img alt="Attachment Thumbnail" /></span><span class="comments"></span><span class="author"></span>';
if (canRemove)
t += '<span class="remove"></span>';
t += '<span class="timestamp"></span></a>';
var e = $(t);
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '@(Url.Action(MVC.API.Device.AttachmentDownload()))/' + a.Id);
e.find('.icon img').attr('src', '@(Url.Action(MVC.API.Device.AttachmentThumbnail()))/' + a.Id);
e.find('.comments').text(a.Comments);
e.find('.author').text(a.Author);
e.find('.timestamp').text(a.TimestampFuzzy).attr('title', a.TimestampFull);
if (canRemove)
e.find('.remove').click(removeAttachment);
if (!quick)
e.hide();
$attachmentOutput.append(e);
if (!quick)
e.show('slow');
if (a.MimeType.toLowerCase().indexOf('image/') == 0)
e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Comments });
}
//#endregion
</text>}
@if (canRemoveAnyAttachments || canRemoveOwnAttachments)
{<text>
//#region Remove Attachments
$attachmentOutput.find('span.remove').click(removeAttachment);
$('#dialogRemoveAttachment').dialog({
resizable: false,
height: 140,
@@ -64,117 +174,50 @@
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;
}
}
},
'UploadUrl=@(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)))'
);
function removeAttachment() {
$this = $(this).closest('a');
$attachmentInput = $Attachments.find('.attachmentInput');
$attachmentInput.find('.photo').click(function () {
showDialog('/WebCam');
});
$attachmentInput.find('.upload').click(function () {
showDialog('/File');
});
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
function showDialog(navigationPath) {
$('#dialogUpload').dialog('open');
if (isLoaded) {
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
} else {
onLoadNavigation = navigationPath;
}
};
function addAttachment(id, quick) {
var data = { id: id };
$.ajax({
url: '@Url.Action(MVC.API.Device.Attachment())',
dataType: 'json',
data: data,
success: function (d) {
if (d.Result == 'OK') {
var a = d.Attachment;
var e = $('<a><span class="icon"><img alt="Attachment Thumbnail" /></span><span class="comments"></span><span class="author"></span><span class="remove"></span><span class="timestamp"></span></a>');
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '@(Url.Action(MVC.API.Device.AttachmentDownload()))/' + a.Id);
e.find('.icon img').attr('src', '@(Url.Action(MVC.API.Device.AttachmentThumbnail()))/' + a.Id);
e.find('.comments').text(a.Comments);
e.find('.author').text(a.Author);
e.find('.timestamp').text(a.TimestampFuzzy).attr('title', a.TimestampFull);
e.find('.remove').click(removeAttachment);
if (!quick)
e.hide();
$attachmentOutput.append(e);
if (!quick)
e.show('slow');
if (a.MimeType.toLowerCase().indexOf('image/') == 0)
e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Comments });
} else {
alert('Unable to add attachment: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add attachment: ' + textStatus);
}
});
}
function removeAttachment() {
$this = $(this).closest('a');
var data = { id: $this.attr('data-attachmentid') };
var $dialogRemoveAttachment = $('#dialogRemoveAttachment');
$dialogRemoveAttachment.dialog("enable");
$dialogRemoveAttachment.dialog('option', 'buttons', {
"Remove": function () {
$dialogRemoveAttachment.dialog("disable");
$dialogRemoveAttachment.dialog("option", "buttons", null);
$.ajax({
url: '@Url.Action(MVC.API.Device.AttachmentRemove())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$this.hide(300).delay(300).queue(function () {
var $this = $(this);
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
Shadowbox.removeCache(this);
$this.remove();
});
} else {
alert('Unable to remove attachment: ' + d);
var data = { id: $this.attr('data-attachmentid') };
var $dialogRemoveAttachment = $('#dialogRemoveAttachment');
$dialogRemoveAttachment.dialog("enable");
$dialogRemoveAttachment.dialog('option', 'buttons', {
"Remove": function () {
$dialogRemoveAttachment.dialog("disable");
$dialogRemoveAttachment.dialog("option", "buttons", null);
$.ajax({
url: '@Url.Action(MVC.API.Device.AttachmentRemove())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$this.hide(300).delay(300).queue(function () {
var $this = $(this);
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
Shadowbox.removeCache(this);
$this.remove();
});
} else {
alert('Unable to remove attachment: ' + d);
}
$dialogRemoveAttachment.dialog("close");
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to remove attachment: ' + textStatus);
$dialogRemoveAttachment.dialog("close");
}
$dialogRemoveAttachment.dialog("close");
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to remove attachment: ' + textStatus);
$dialogRemoveAttachment.dialog("close");
}
});
},
"Cancel": function () {
$dialogRemoveAttachment.dialog("close");
}
});
});
},
"Cancel": function () {
$dialogRemoveAttachment.dialog("close");
}
});
$dialogRemoveAttachment.dialog('open');
$dialogRemoveAttachment.dialog('open');
return false;
}
return false;
}
//#endregion
</text>}
$attachmentOutput.children('a').each(function () {
$this = $(this);
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Device.DeviceParts
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/DeviceParts/_Resources.cshtml")]
public partial class Resources : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ShowModel>
public partial class Resources : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.ShowModel>
{
public Resources()
{
@@ -43,9 +45,19 @@ namespace Disco.Web.Views.Device.DeviceParts
#line 2 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Authorization.Require(Claims.Device.ShowAttachments);
var canAddAttachments = Authorization.Has(Claims.Device.Actions.AddAttachments);
var canRemoveAnyAttachments = Authorization.Has(Claims.Device.Actions.RemoveAnyAttachments);
var canRemoveOwnAttachments = Authorization.Has(Claims.Device.Actions.RemoveOwnAttachments);
Html.BundleDeferred("~/Style/Shadowbox");
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
if (Authorization.Has(Claims.Device.Actions.AddAttachments))
{
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
}
#line default
@@ -64,6 +76,16 @@ WriteLiteral(">\r\n <tr>\r\n <td");
WriteLiteral(" id=\"Attachments\"");
WriteAttribute("class", Tuple.Create(" class=\"", 796), Tuple.Create("\"", 871)
#line 20 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 804), Tuple.Create<System.Object, System.Int32>(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments"
#line default
#line hidden
, 804), false)
);
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"attachmentOutput\"");
@@ -71,13 +93,13 @@ WriteLiteral(" class=\"attachmentOutput\"");
WriteLiteral(">\r\n");
#line 12 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 22 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line default
#line hidden
#line 12 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 22 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (Model.Device.DeviceAttachments != null)
{
foreach (var da in Model.Device.DeviceAttachments)
@@ -88,20 +110,20 @@ WriteLiteral(">\r\n");
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 634), Tuple.Create("\"", 694)
WriteAttribute("href", Tuple.Create(" href=\"", 1141), Tuple.Create("\"", 1201)
#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 26 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1148), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentDownload(da.Id))
#line default
#line hidden
, 641), false)
, 1148), false)
);
WriteLiteral(" data-attachmentid=\"");
#line 16 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 26 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.Id);
@@ -112,7 +134,7 @@ WriteLiteral("\"");
WriteLiteral(" data-mimetype=\"");
#line 16 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 26 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.MimeType);
@@ -124,68 +146,68 @@ WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 800), Tuple.Create("\"", 820)
WriteAttribute("title", Tuple.Create(" title=\"", 1307), Tuple.Create("\"", 1327)
#line 17 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 808), Tuple.Create<System.Object, System.Int32>(da.Filename
#line 27 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1315), Tuple.Create<System.Object, System.Int32>(da.Filename
#line default
#line hidden
, 808), false)
, 1315), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 887), Tuple.Create("\"", 949)
WriteAttribute("src", Tuple.Create(" src=\"", 1394), Tuple.Create("\"", 1456)
#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 28 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1400), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id))
#line default
#line hidden
, 893), false)
, 1400), false)
);
WriteLiteral(" /></span>\r\n <span");
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1012), Tuple.Create("\"", 1032)
WriteAttribute("title", Tuple.Create(" title=\"", 1519), Tuple.Create("\"", 1539)
#line 19 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1020), Tuple.Create<System.Object, System.Int32>(da.Comments
#line 29 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1527), Tuple.Create<System.Object, System.Int32>(da.Comments
#line default
#line hidden
, 1020), false)
, 1527), false)
);
WriteLiteral(">\r\n");
#line 20 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 30 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line default
#line hidden
#line 20 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 30 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (!string.IsNullOrEmpty(da.DocumentTemplateId))
{
#line default
#line hidden
#line 21 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 31 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.DocumentTemplate.Description);
#line default
#line hidden
#line 21 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 31 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
else
{
@@ -193,14 +215,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 23 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 33 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.Comments);
#line default
#line hidden
#line 23 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 33 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
#line default
@@ -212,35 +234,52 @@ WriteLiteral(" class=\"author\"");
WriteLiteral(">");
#line 24 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 34 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.TechUser.ToString());
#line default
#line hidden
WriteLiteral("</span><span");
WriteLiteral("</span>");
WriteLiteral(" class=\"remove\"");
WriteLiteral("></span><span");
WriteLiteral(" class=\"timestamp\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1422), Tuple.Create("\"", 1460)
#line 24 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1430), Tuple.Create<System.Object, System.Int32>(da.Timestamp.ToFullDateTime()
#line 34 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (canRemoveAnyAttachments || (canRemoveOwnAttachments && da.TechUserId == CurrentUser.Id))
{
#line default
#line hidden
, 1430), false)
WriteLiteral("<span");
WriteLiteral(" class=\"remove\"");
WriteLiteral("></span>");
#line 35 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"timestamp\"");
WriteAttribute("title", Tuple.Create(" title=\"", 2125), Tuple.Create("\"", 2163)
#line 35 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 2133), Tuple.Create<System.Object, System.Int32>(da.Timestamp.ToFullDateTime()
#line default
#line hidden
, 2133), false)
);
WriteLiteral(">");
#line 24 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.Timestamp.ToFuzzy());
#line 35 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.Timestamp.ToFuzzy());
#line default
@@ -248,18 +287,34 @@ WriteLiteral(">");
WriteLiteral("</span>\r\n </a> \r\n");
#line 26 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 37 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </div>\r\n <div");
WriteLiteral(" </div>\r\n");
#line 40 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line default
#line hidden
#line 40 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (canAddAttachments)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"attachmentInput clearfix\"");
WriteLiteral(">\r\n <span");
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"action upload\"");
@@ -267,56 +322,93 @@ WriteLiteral("></span><span");
WriteLiteral(" class=\"action photo\"");
WriteLiteral("></span>\r\n </div>\r\n <script");
WriteLiteral("></span>\r\n </div>\r\n");
#line 45 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
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 " +
" \'");
WriteLiteral(@">
Shadowbox.init({
skipSetup: true,
modal: true
});
$(function () {
$Attachments = $('#Attachments');
$attachmentOutput = $Attachments.find('.attachmentOutput');
");
#line 70 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 55 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line default
#line hidden
#line 55 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (canAddAttachments)
{
#line default
#line hidden
WriteLiteral(@"
//#region Add Attachments
if (!document.DiscoFunctions) {
document.DiscoFunctions = {};
}
document.DiscoFunctions.addAttachment = addAttachment;
$('#dialogUpload').dialog({
autoOpen: false,
draggable: false,
modal: true,
resizable: false,
width: 860,
height: 550,
close: function () {
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
}
});
var onLoadNavigation = null;
var isLoaded = null;
Silverlight.createObject(
'");
#line 80 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap);
#line default
#line hidden
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;
$('#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;
}
}
}
},
'UploadUrl=");
},
'UploadUrl=");
#line 82 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)));
#line 92 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)));
#line default
@@ -324,124 +416,261 @@ WriteLiteral(@"',
WriteLiteral(@"'
);
$attachmentInput = $Attachments.find('.attachmentInput');
$attachmentInput.find('.photo').click(function () {
showDialog('/WebCam');
});
$attachmentInput.find('.upload').click(function () {
showDialog('/File');
});
$attachmentInput = $Attachments.find('.attachmentInput');
$attachmentInput.find('.photo').click(function () {
showDialog('/WebCam');
});
$attachmentInput.find('.upload').click(function () {
showDialog('/File');
});
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
function showDialog(navigationPath) {
$('#dialogUpload').dialog('open');
if (isLoaded) {
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
} else {
onLoadNavigation = navigationPath;
}
};
function addAttachment(id, quick) {
var data = { id: id };
$.ajax({
url: '");
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
function showDialog(navigationPath) {
$('#dialogUpload').dialog('open');
if (isLoaded) {
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
} else {
onLoadNavigation = navigationPath;
}
};
function addAttachment(id, quick) {
var data = { id: id };
$.ajax({
url: '");
#line 105 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.Attachment()));
#line 116 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.Attachment()));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
if (d.Result == 'OK') {
var a = d.Attachment;
var e = $('<a><span class=""icon""><img alt=""Attachment Thumbnail"" /></span><span class=""comments""></span><span class=""author""></span><span class=""remove""></span><span class=""timestamp""></span></a>');
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
dataType: 'json',
data: data,
success: function (d) {
if (d.Result == 'OK') {
var a = d.Attachment;
");
#line 114 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentDownload()));
#line 122 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line default
#line hidden
#line 122 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (canRemoveAnyAttachments)
{
#line default
#line hidden
WriteLiteral("buildAttachment(a, true);");
#line 123 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
else if (canRemoveOwnAttachments)
{
#line default
#line hidden
WriteLiteral("buildAttachment(a, (a.AuthorId === \'");
#line 125 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(CurrentUser.Id);
#line default
#line hidden
WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon img\').attr(\'src\', " +
"\'");
WriteLiteral("\'));");
#line 115 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentThumbnail()));
#line 125 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral("buildAttachment(a, false);");
#line 127 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
#line default
#line hidden
WriteLiteral("/\' + a.Id);\r\n e.find(\'.comments\').text(a.Comme" +
"nts);\r\n e.find(\'.author\').text(a.Author);\r\n " +
" e.find(\'.timestamp\').text(a.TimestampFuzzy).at" +
"tr(\'title\', a.TimestampFull);\r\n e.find(\'.remo" +
"ve\').click(removeAttachment);\r\n if (!quick)\r\n" +
" e.hide();\r\n " +
" $attachmentOutput.append(e);\r\n if (!qu" +
"ick)\r\n e.show(\'slow\');\r\n " +
" if (a.MimeType.toLowerCase().indexOf(\'image/\') == 0)\r\n " +
" e.shadowbox({ gallery: \'attachments\', player: \'" +
"img\', title: a.Comments });\r\n } else {\r\n " +
" alert(\'Unable to add attachment: \' + d.Result);\r\n " +
" }\r\n },\r\n " +
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to add attachment: \' + textStatus);\r\n " +
" }\r\n });\r\n }\r\n " +
" function removeAttachment() {\r\n $this = $(this)." +
"closest(\'a\');\r\n\r\n var data = { id: $this.attr(\'data-attac" +
"hmentid\') };\r\n var $dialogRemoveAttachment = $(\'#dialogRe" +
"moveAttachment\');\r\n $dialogRemoveAttachment.dialog(\"enabl" +
"e\");\r\n $dialogRemoveAttachment.dialog(\'option\', \'buttons\'" +
", {\r\n \"Remove\": function () {\r\n " +
" $dialogRemoveAttachment.dialog(\"disable\");\r\n " +
" $dialogRemoveAttachment.dialog(\"option\", \"buttons\", null);\r\n " +
" $.ajax({\r\n url: \'");
WriteLiteral(@"
} else {
alert('Unable to add attachment: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add attachment: ' + textStatus);
}
});
}
function buildAttachment(a, canRemove) {
var t = '<a><span");
WriteLiteral(" class=\"icon\"");
WriteLiteral("><img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteLiteral(" /></span><span");
WriteLiteral(" class=\"comments\"");
WriteLiteral("></span><span");
WriteLiteral(" class=\"author\"");
WriteLiteral("></span>\';\r\n if (canRemove)\r\n " +
" t += \'<span");
WriteLiteral(" class=\"remove\"");
WriteLiteral("></span>\';\r\n t += \'<span");
WriteLiteral(" class=\"timestamp\"");
WriteLiteral("></span></a>\';\r\n\r\n var e = $(t);\r\n\r\n " +
" e.attr(\'data-attachmentid\', a.Id).attr(\'data-mimetype\', a.MimeType).at" +
"tr(\'href\', \'");
#line 147 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentRemove()));
Write(Url.Action(MVC.API.Device.AttachmentDownload()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" data: data,\r\n success: function" +
" (d) {\r\n if (d == \'OK\') {\r\n " +
" $this.hide(300).delay(300).queue(function () {\r\n " +
" var $this = $(this);\r\n " +
" if ($this.attr(\'data-mimetype\').toLowerCase(" +
").indexOf(\'image/\') == 0)\r\n S" +
"hadowbox.removeCache(this);\r\n $th" +
"is.remove();\r\n });\r\n " +
" } else {\r\n ale" +
"rt(\'Unable to remove attachment: \' + d);\r\n " +
" }\r\n $dialogRemoveAttachment.dialog(\"clo" +
"se\");\r\n },\r\n " +
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to remove attachment: \' + textStatus);\r\n " +
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
" }\r\n });\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(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("/\' + a.Id);\r\n e.find(\'.icon img\').attr(\'src\', \'");
#line 148 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentThumbnail()));
#line default
#line hidden
WriteLiteral(@"/' + a.Id);
e.find('.comments').text(a.Comments);
e.find('.author').text(a.Author);
e.find('.timestamp').text(a.TimestampFuzzy).attr('title', a.TimestampFull);
if (canRemove)
e.find('.remove').click(removeAttachment);
if (!quick)
e.hide();
$attachmentOutput.append(e);
if (!quick)
e.show('slow');
if (a.MimeType.toLowerCase().indexOf('image/') == 0)
e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Comments });
}
//#endregion
");
#line 164 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 165 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
{
#line default
#line hidden
WriteLiteral(@"
//#region Remove Attachments
$attachmentOutput.find('span.remove').click(removeAttachment);
$('#dialogRemoveAttachment').dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false
});
function removeAttachment() {
$this = $(this).closest('a');
var data = { id: $this.attr('data-attachmentid') };
var $dialogRemoveAttachment = $('#dialogRemoveAttachment');
$dialogRemoveAttachment.dialog(""enable"");
$dialogRemoveAttachment.dialog('option', 'buttons', {
""Remove"": function () {
$dialogRemoveAttachment.dialog(""disable"");
$dialogRemoveAttachment.dialog(""option"", ""buttons"", null);
$.ajax({
url: '");
#line 188 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentRemove()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" data: data,\r\n succe" +
"ss: function (d) {\r\n if (d == \'OK\') {" +
"\r\n $this.hide(300).delay(300).que" +
"ue(function () {\r\n var $this " +
"= $(this);\r\n if ($this.attr(\'" +
"data-mimetype\').toLowerCase().indexOf(\'image/\') == 0)\r\n " +
" Shadowbox.removeCache(this);\r\n " +
" $this.remove();\r\n " +
" });\r\n } else {\r\n " +
" alert(\'Unable to remove attachment:" +
" \' + d);\r\n }\r\n " +
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
" },\r\n error: functi" +
"on (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to remove attachment: \' + textStatus);\r\n " +
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
" }\r\n });\r\n " +
" },\r\n \"Cancel\": function () {\r\n" +
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
" }\r\n });\r\n\r\n " +
" $dialogRemoveAttachment.dialog(\'open\');\r\n\r\n " +
" return false;\r\n }\r\n //#endr" +
"egion\r\n ");
#line 220 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
#line default
#line hidden
WriteLiteral(@"
$attachmentOutput.children('a').each(function () {
$this = $(this);
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
$this.shadowbox({ gallery: 'attachments', player: 'img', title: $this.find('.comments').text() });
});
});
</script>
</td>
</tr>
</table>
<div");
WriteLiteral(" id=\"dialogUpload\"");
@@ -468,7 +697,7 @@ WriteLiteral("></span>\r\n Are you sure?\r\n </p>\r\n </div
"id=\"DeviceDetailTab-ResourcesLink\">Attachments [");
#line 200 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 243 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Model.Device.DeviceAttachments == null ? 0 : Model.Device.DeviceAttachments.Count);
@@ -1,5 +1,7 @@
@model Disco.Web.Models.Device.ShowModel
@{
Authorization.Require(Claims.Device.Show);
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
}
<table id="Device_Show_Subjects">
@@ -23,19 +25,42 @@
</tr>
<tr>
<td>Asset:</td>
<td>@Html.TextBoxFor(m => m.Device.AssetNumber, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()</td>
<td>
@if (Authorization.Has(Claims.Device.Properties.AssetNumber))
{
@Html.TextBoxFor(m => m.Device.AssetNumber, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()
}
else
{
<span class="small discreet">@Model.Device.AssetNumber</span>
}
</td>
</tr>
<tr>
<td>Location:</td>
<td>@Html.TextBoxFor(m => m.Device.Location, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()</td>
<td>
@if (Authorization.Has(Claims.Device.Properties.Location))
{
@Html.TextBoxFor(m => m.Device.Location, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()
}
else
{
<span class="small discreet">@Model.Device.Location</span>
}
</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>
@if (Authorization.HasAny(Claims.Device.Properties.AssetNumber, Claims.Device.Properties.Location))
{
<script>
$(function () {
@if (Authorization.Has(Claims.Device.Properties.AssetNumber))
{<text>document.DiscoFunctions.PropertyChangeHelper($('#Device_AssetNumber'), 'Unknown', '@Url.Action(MVC.API.Device.UpdateAssetNumber(Model.Device.SerialNumber, null))', 'AssetNumber');</text>}
@if (Authorization.Has(Claims.Device.Properties.Location))
{<text>document.DiscoFunctions.PropertyChangeHelper($('#Device_Location'), 'Unknown', '@Url.Action(MVC.API.Device.UpdateLocation(Model.Device.SerialNumber, null))', 'Location');</text>}
});
</script>
}
</div>
<div id="Device_Show_Details_Dates" class="status">
<table class="none verticalHeadings">
@@ -146,7 +171,7 @@
{
<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>
<div id="Device_Show_User_Id" title="Id">@assignedUser.Id</div>
@if (!string.IsNullOrWhiteSpace(assignedUser.PhoneNumber))
{
<div id="Device_Show_User_PhoneNumber" title="Phone Number">@assignedUser.PhoneNumber</div>
@@ -165,11 +190,13 @@
</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=';
@if (Authorization.Has(Claims.Device.Actions.GenerateDocuments))
{
<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();
@@ -179,8 +206,9 @@
}
});
});
</script>
</div>
</script>
</div>
}
</div>
</td>
<td id="Device_Show_Policies" rowspan="2">
@@ -602,7 +630,7 @@
{
<li>
<input type="radio" id="Device_Show_Device_Actions_Decommission_Reason_@((int)decommissionReason)"
name="Device_Show_Device_Actions_Decommission_Reason" value="@((int)decommissionReason)" @((decommissionReason== Device.DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty)/>
name="Device_Show_Device_Actions_Decommission_Reason" value="@((int)decommissionReason)" @((decommissionReason == Device.DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty)/>
<label for="Device_Show_Device_Actions_Decommission_Reason_@((int)decommissionReason)">@(decommissionReason.ReasonMessage())</label>
</li>
}
@@ -627,7 +655,7 @@
"Decommission": function () {
var reasonId = buttonDialog.find('input:checked').val();
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
File diff suppressed because it is too large Load Diff
+9 -4
View File
@@ -1,7 +1,10 @@
@model Disco.Web.Models.Device.ImportModel
@{
Authorization.RequireAny(Claims.Device.Actions.Import, Claims.Device.Actions.Export);
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import/Export Devices");
}
@if (Authorization.Has(Claims.Device.Actions.Import)){
<div id="deviceImport">
@using (Html.BeginForm(MVC.API.Device.ImportParse(), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
@@ -185,8 +188,10 @@
});
</script>
</div>
<div class="actionBar">
@Html.ActionLinkButton("Export All Devices", MVC.API.Device.ExportAllDevices())
</div>
</div>
}
@if (Authorization.Has(Claims.Device.Actions.Export)){
<div class="actionBar">
@Html.ActionLinkButton("Export All Devices", MVC.API.Device.ExportAllDevices())
</div>
}
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Device
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/ImportExport.cshtml")]
public partial class ImportExport : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ImportModel>
public partial class ImportExport : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.ImportModel>
{
public ImportExport()
{
@@ -43,25 +45,36 @@ namespace Disco.Web.Views.Device
#line 2 "..\..\Views\Device\ImportExport.cshtml"
Authorization.RequireAny(Claims.Device.Actions.Import, Claims.Device.Actions.Export);
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import/Export Devices");
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral("\r\n");
#line 7 "..\..\Views\Device\ImportExport.cshtml"
if (Authorization.Has(Claims.Device.Actions.Import)){
#line default
#line hidden
WriteLiteral("<div");
WriteLiteral(" id=\"deviceImport\"");
WriteLiteral(">\r\n");
#line 6 "..\..\Views\Device\ImportExport.cshtml"
#line 9 "..\..\Views\Device\ImportExport.cshtml"
#line default
#line hidden
#line 6 "..\..\Views\Device\ImportExport.cshtml"
#line 9 "..\..\Views\Device\ImportExport.cshtml"
using (Html.BeginForm(MVC.API.Device.ImportParse(), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
@@ -69,14 +82,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 8 "..\..\Views\Device\ImportExport.cshtml"
#line 11 "..\..\Views\Device\ImportExport.cshtml"
Write(Html.ValidationSummary());
#line default
#line hidden
#line 8 "..\..\Views\Device\ImportExport.cshtml"
#line 11 "..\..\Views\Device\ImportExport.cshtml"
@@ -96,7 +109,7 @@ WriteLiteral(">\r\n <h2>Import Devices</h2>\r\n <table>\r\
WriteLiteral(" ");
#line 14 "..\..\Views\Device\ImportExport.cshtml"
#line 17 "..\..\Views\Device\ImportExport.cshtml"
Write(Html.LabelFor(m => m.ImportFile));
@@ -131,7 +144,7 @@ WriteLiteral(" value=\"Import\"");
WriteLiteral(" />\r\n </p>\r\n </div>\r\n");
#line 25 "..\..\Views\Device\ImportExport.cshtml"
#line 28 "..\..\Views\Device\ImportExport.cshtml"
}
@@ -196,7 +209,7 @@ WriteLiteral(" class=\"code\"");
WriteLiteral(">1</span> [");
#line 51 "..\..\Views\Device\ImportExport.cshtml"
#line 54 "..\..\Views\Device\ImportExport.cshtml"
Write(Html.ActionLink(Model.DeviceModels[0].ToString(), MVC.Config.DeviceModel.Index(Model.DeviceModels[0].Id)));
@@ -220,7 +233,7 @@ WriteLiteral(" class=\"code\"");
WriteLiteral(">1</span> [");
#line 56 "..\..\Views\Device\ImportExport.cshtml"
#line 59 "..\..\Views\Device\ImportExport.cshtml"
Write(Html.ActionLink(Model.DeviceProfiles[0].ToString(), MVC.Config.DeviceProfile.Index(Model.DeviceProfiles[0].Id)));
@@ -291,13 +304,13 @@ WriteLiteral(@">
");
#line 94 "..\..\Views\Device\ImportExport.cshtml"
#line 97 "..\..\Views\Device\ImportExport.cshtml"
#line default
#line hidden
#line 94 "..\..\Views\Device\ImportExport.cshtml"
#line 97 "..\..\Views\Device\ImportExport.cshtml"
foreach (var dm in Model.DeviceModels)
{
@@ -307,7 +320,7 @@ WriteLiteral(@">
WriteLiteral(" <tr>\r\n <td>");
#line 97 "..\..\Views\Device\ImportExport.cshtml"
#line 100 "..\..\Views\Device\ImportExport.cshtml"
Write(Html.ActionLink(dm.Id.ToString(), MVC.Config.DeviceModel.Index(dm.Id)));
@@ -316,7 +329,7 @@ WriteLiteral(" <tr>\r\n <td>")
WriteLiteral("</td>\r\n <td>");
#line 98 "..\..\Views\Device\ImportExport.cshtml"
#line 101 "..\..\Views\Device\ImportExport.cshtml"
Write(dm.ToString());
@@ -325,7 +338,7 @@ WriteLiteral("</td>\r\n <td>");
WriteLiteral("</td>\r\n <td>");
#line 99 "..\..\Views\Device\ImportExport.cshtml"
#line 102 "..\..\Views\Device\ImportExport.cshtml"
Write(dm.Manufacturer);
@@ -334,7 +347,7 @@ WriteLiteral("</td>\r\n <td>");
WriteLiteral("</td>\r\n <td>");
#line 100 "..\..\Views\Device\ImportExport.cshtml"
#line 103 "..\..\Views\Device\ImportExport.cshtml"
Write(dm.Model);
@@ -343,7 +356,7 @@ WriteLiteral("</td>\r\n <td>");
WriteLiteral("</td>\r\n </tr>\r\n");
#line 102 "..\..\Views\Device\ImportExport.cshtml"
#line 105 "..\..\Views\Device\ImportExport.cshtml"
}
@@ -374,13 +387,13 @@ WriteLiteral(@">
");
#line 118 "..\..\Views\Device\ImportExport.cshtml"
#line 121 "..\..\Views\Device\ImportExport.cshtml"
#line default
#line hidden
#line 118 "..\..\Views\Device\ImportExport.cshtml"
#line 121 "..\..\Views\Device\ImportExport.cshtml"
foreach (var dp in Model.DeviceProfiles)
{
@@ -390,7 +403,7 @@ WriteLiteral(@">
WriteLiteral(" <tr>\r\n <td>");
#line 121 "..\..\Views\Device\ImportExport.cshtml"
#line 124 "..\..\Views\Device\ImportExport.cshtml"
Write(Html.ActionLink(dp.Id.ToString(), MVC.Config.DeviceProfile.Index(dp.Id)));
@@ -399,7 +412,7 @@ WriteLiteral(" <tr>\r\n <td>")
WriteLiteral("</td>\r\n <td>");
#line 122 "..\..\Views\Device\ImportExport.cshtml"
#line 125 "..\..\Views\Device\ImportExport.cshtml"
Write(dp.Name);
@@ -408,7 +421,7 @@ WriteLiteral("</td>\r\n <td>");
WriteLiteral("</td>\r\n <td>");
#line 123 "..\..\Views\Device\ImportExport.cshtml"
#line 126 "..\..\Views\Device\ImportExport.cshtml"
Write(dp.ShortName);
@@ -417,7 +430,7 @@ WriteLiteral("</td>\r\n <td>");
WriteLiteral("</td>\r\n <td>");
#line 124 "..\..\Views\Device\ImportExport.cshtml"
#line 127 "..\..\Views\Device\ImportExport.cshtml"
Write(dp.Description);
@@ -426,7 +439,7 @@ WriteLiteral("</td>\r\n <td>");
WriteLiteral("</td>\r\n </tr>\r\n");
#line 126 "..\..\Views\Device\ImportExport.cshtml"
#line 129 "..\..\Views\Device\ImportExport.cshtml"
}
@@ -456,13 +469,13 @@ WriteLiteral(@">
");
#line 141 "..\..\Views\Device\ImportExport.cshtml"
#line 144 "..\..\Views\Device\ImportExport.cshtml"
#line default
#line hidden
#line 141 "..\..\Views\Device\ImportExport.cshtml"
#line 144 "..\..\Views\Device\ImportExport.cshtml"
foreach (var db in Model.DeviceBatches)
{
@@ -472,7 +485,7 @@ WriteLiteral(@">
WriteLiteral(" <tr>\r\n <td>");
#line 144 "..\..\Views\Device\ImportExport.cshtml"
#line 147 "..\..\Views\Device\ImportExport.cshtml"
Write(Html.ActionLink(db.Id.ToString(), MVC.Config.DeviceBatch.Index(db.Id)));
@@ -481,7 +494,7 @@ WriteLiteral(" <tr>\r\n <td>")
WriteLiteral("</td>\r\n <td>");
#line 145 "..\..\Views\Device\ImportExport.cshtml"
#line 148 "..\..\Views\Device\ImportExport.cshtml"
Write(db.Name);
@@ -490,7 +503,7 @@ WriteLiteral("</td>\r\n <td>");
WriteLiteral("</td>\r\n <td>");
#line 146 "..\..\Views\Device\ImportExport.cshtml"
#line 149 "..\..\Views\Device\ImportExport.cshtml"
Write(CommonHelpers.FriendlyDate(db.PurchaseDate));
@@ -499,7 +512,7 @@ WriteLiteral("</td>\r\n <td>");
WriteLiteral("</td>\r\n </tr>\r\n");
#line 148 "..\..\Views\Device\ImportExport.cshtml"
#line 151 "..\..\Views\Device\ImportExport.cshtml"
}
@@ -524,23 +537,45 @@ WriteLiteral(" </tbody>\r\n </table>\r\n </div>
"efault();\r\n if (!$showDeviceBatchesDialog)\r\n " +
" $showDeviceBatchesDialog = $(\'#showDeviceBatchesDialog\').dialog(dialogOpt" +
"ions);\r\n $showDeviceBatchesDialog.dialog(\'open\');\r\n " +
" });\r\n });\r\n </script>\r\n </div>\r\n\r\n <div");
" });\r\n });\r\n </script>\r\n </div>\r\n</div>\r\n");
#line 192 "..\..\Views\Device\ImportExport.cshtml"
}
#line default
#line hidden
#line 193 "..\..\Views\Device\ImportExport.cshtml"
if (Authorization.Has(Claims.Device.Actions.Export)){
#line default
#line hidden
WriteLiteral("<div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
WriteLiteral(" ");
#line 190 "..\..\Views\Device\ImportExport.cshtml"
Write(Html.ActionLinkButton("Export All Devices", MVC.API.Device.ExportAllDevices()));
#line 195 "..\..\Views\Device\ImportExport.cshtml"
Write(Html.ActionLinkButton("Export All Devices", MVC.API.Device.ExportAllDevices()));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n</div>\r\n");
WriteLiteral("\r\n</div>\r\n");
#line 197 "..\..\Views\Device\ImportExport.cshtml"
}
#line default
#line hidden
}
}
}
@@ -1,6 +1,8 @@
@model Disco.Web.Models.Device.ImportReviewModel
@using Disco.BI.DeviceBI.Importing
@{
Authorization.Require(Claims.Device.Actions.Import);
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import Devices", MVC.Device.ImportExport(), string.Format("File: {0}", Model.ImportFilename));
int importDeviceOkCount = Model.ImportDevices.Count(id => id.Errors.Count == 0);
+102 -98
View File
@@ -34,12 +34,14 @@ namespace Disco.Web.Views.Device
#line hidden
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/ImportReview.cshtml")]
public partial class ImportReview : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ImportReviewModel>
public partial class ImportReview : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.ImportReviewModel>
{
public ImportReview()
{
@@ -49,6 +51,8 @@ namespace Disco.Web.Views.Device
#line 3 "..\..\Views\Device\ImportReview.cshtml"
Authorization.Require(Claims.Device.Actions.Import);
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import Devices", MVC.Device.ImportExport(), string.Format("File: {0}", Model.ImportFilename));
int importDeviceOkCount = Model.ImportDevices.Count(id => id.Errors.Count == 0);
@@ -66,13 +70,13 @@ WriteLiteral(" id=\"deviceImportReview\"");
WriteLiteral(">\r\n");
#line 12 "..\..\Views\Device\ImportReview.cshtml"
#line 14 "..\..\Views\Device\ImportReview.cshtml"
#line default
#line hidden
#line 12 "..\..\Views\Device\ImportReview.cshtml"
#line 14 "..\..\Views\Device\ImportReview.cshtml"
if (Model.ImportDevices.Count > 0)
{
@@ -82,7 +86,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" <h2>Parsed ");
#line 14 "..\..\Views\Device\ImportReview.cshtml"
#line 16 "..\..\Views\Device\ImportReview.cshtml"
Write(Model.ImportDevices.Count);
@@ -91,7 +95,7 @@ WriteLiteral(" <h2>Parsed ");
WriteLiteral(" Device Record");
#line 14 "..\..\Views\Device\ImportReview.cshtml"
#line 16 "..\..\Views\Device\ImportReview.cshtml"
Write(Model.ImportDevices.Count != 1 ? "s" : null);
@@ -104,7 +108,7 @@ WriteLiteral(" <h4>\r\n");
WriteLiteral(" ");
#line 16 "..\..\Views\Device\ImportReview.cshtml"
#line 18 "..\..\Views\Device\ImportReview.cshtml"
Write(importDeviceOkCount);
@@ -113,7 +117,7 @@ WriteLiteral(" ");
WriteLiteral(" of ");
#line 16 "..\..\Views\Device\ImportReview.cshtml"
#line 18 "..\..\Views\Device\ImportReview.cshtml"
Write(Model.ImportDevices.Count);
@@ -122,7 +126,7 @@ WriteLiteral(" of ");
WriteLiteral(" Device");
#line 16 "..\..\Views\Device\ImportReview.cshtml"
#line 18 "..\..\Views\Device\ImportReview.cshtml"
Write(Model.ImportDevices.Count != 1 ? "s" : null);
@@ -131,7 +135,7 @@ WriteLiteral(" Device");
WriteLiteral(" are ready for import.\r\n </h4>\r\n");
#line 18 "..\..\Views\Device\ImportReview.cshtml"
#line 20 "..\..\Views\Device\ImportReview.cshtml"
if (importDeviceErrorCount > 0)
{
@@ -147,7 +151,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 21 "..\..\Views\Device\ImportReview.cshtml"
#line 23 "..\..\Views\Device\ImportReview.cshtml"
Write(importDeviceErrorCount);
@@ -156,7 +160,7 @@ WriteLiteral(" ");
WriteLiteral(" Record");
#line 21 "..\..\Views\Device\ImportReview.cshtml"
#line 23 "..\..\Views\Device\ImportReview.cshtml"
Write(importDeviceErrorCount != 1 ? "s" : null);
@@ -165,7 +169,7 @@ WriteLiteral(" Record");
WriteLiteral(" will be skipped if the import continues\r\n </h4>\r\n");
#line 23 "..\..\Views\Device\ImportReview.cshtml"
#line 25 "..\..\Views\Device\ImportReview.cshtml"
}
@@ -183,13 +187,13 @@ WriteLiteral(" class=\"none\"");
WriteLiteral(">\r\n");
#line 27 "..\..\Views\Device\ImportReview.cshtml"
#line 29 "..\..\Views\Device\ImportReview.cshtml"
#line default
#line hidden
#line 27 "..\..\Views\Device\ImportReview.cshtml"
#line 29 "..\..\Views\Device\ImportReview.cshtml"
if (importDeviceNewCount > 0)
{
@@ -214,7 +218,7 @@ WriteLiteral(" for=\"devicesNavigationNew\"");
WriteLiteral(">Show New Devices (");
#line 29 "..\..\Views\Device\ImportReview.cshtml"
#line 31 "..\..\Views\Device\ImportReview.cshtml"
Write(Model.ImportDevices.Count(id => id.Errors.Count == 0 && id.Device == null));
@@ -223,13 +227,13 @@ WriteLiteral(">Show New Devices (");
WriteLiteral(")</label>\r\n </li>");
#line 30 "..\..\Views\Device\ImportReview.cshtml"
#line 32 "..\..\Views\Device\ImportReview.cshtml"
}
#line default
#line hidden
#line 30 "..\..\Views\Device\ImportReview.cshtml"
#line 32 "..\..\Views\Device\ImportReview.cshtml"
if (importDeviceUpdateCount > 0)
{
@@ -254,7 +258,7 @@ WriteLiteral(" for=\"devicesNavigationUpdate\"");
WriteLiteral(">Show Updates (");
#line 32 "..\..\Views\Device\ImportReview.cshtml"
#line 34 "..\..\Views\Device\ImportReview.cshtml"
Write(Model.ImportDevices.Count(id => id.Errors.Count == 0 && id.Device != null));
@@ -263,13 +267,13 @@ WriteLiteral(">Show Updates (");
WriteLiteral(")</label>\r\n </li>");
#line 33 "..\..\Views\Device\ImportReview.cshtml"
#line 35 "..\..\Views\Device\ImportReview.cshtml"
}
#line default
#line hidden
#line 33 "..\..\Views\Device\ImportReview.cshtml"
#line 35 "..\..\Views\Device\ImportReview.cshtml"
if (importDeviceErrorCount > 0)
{
@@ -294,7 +298,7 @@ WriteLiteral(" for=\"devicesNavigationError\"");
WriteLiteral(">Show Errors (");
#line 35 "..\..\Views\Device\ImportReview.cshtml"
#line 37 "..\..\Views\Device\ImportReview.cshtml"
Write(Model.ImportDevices.Count(id => id.Errors.Count != 0));
@@ -303,7 +307,7 @@ WriteLiteral(">Show Errors (");
WriteLiteral(")</label>\r\n </li>");
#line 36 "..\..\Views\Device\ImportReview.cshtml"
#line 38 "..\..\Views\Device\ImportReview.cshtml"
}
@@ -341,7 +345,7 @@ WriteLiteral(@" </ul>
");
#line 66 "..\..\Views\Device\ImportReview.cshtml"
#line 68 "..\..\Views\Device\ImportReview.cshtml"
@@ -391,13 +395,13 @@ WriteLiteral(">Asset Number</th>\r\n </tr>\r\n </thead
"dy>\r\n");
#line 82 "..\..\Views\Device\ImportReview.cshtml"
#line 84 "..\..\Views\Device\ImportReview.cshtml"
#line default
#line hidden
#line 82 "..\..\Views\Device\ImportReview.cshtml"
#line 84 "..\..\Views\Device\ImportReview.cshtml"
foreach (var device in Model.ImportDevices)
{
bool isUpdate = device.Device != null;
@@ -408,15 +412,15 @@ WriteLiteral(">Asset Number</th>\r\n </tr>\r\n </thead
#line hidden
WriteLiteral(" <tr");
WriteAttribute("class", Tuple.Create(" class=\"", 4390), Tuple.Create("\"", 4428)
, Tuple.Create(Tuple.Create("", 4398), Tuple.Create("status", 4398), true)
WriteAttribute("class", Tuple.Create(" class=\"", 4454), Tuple.Create("\"", 4492)
, Tuple.Create(Tuple.Create("", 4462), Tuple.Create("status", 4462), true)
#line 86 "..\..\Views\Device\ImportReview.cshtml"
, Tuple.Create(Tuple.Create("", 4404), Tuple.Create<System.Object, System.Int32>(device.ImportStatus()
#line 88 "..\..\Views\Device\ImportReview.cshtml"
, Tuple.Create(Tuple.Create("", 4468), Tuple.Create<System.Object, System.Int32>(device.ImportStatus()
#line default
#line hidden
, 4404), false)
, 4468), false)
);
WriteLiteral(">\r\n <td");
@@ -428,7 +432,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 88 "..\..\Views\Device\ImportReview.cshtml"
#line 90 "..\..\Views\Device\ImportReview.cshtml"
Write((Model.ImportDevices.IndexOf(device) + 1));
@@ -443,7 +447,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 91 "..\..\Views\Device\ImportReview.cshtml"
#line 93 "..\..\Views\Device\ImportReview.cshtml"
Write(device.ImportStatus());
@@ -456,13 +460,13 @@ WriteLiteral(" class=\"serialNumber\"");
WriteLiteral(">\r\n");
#line 94 "..\..\Views\Device\ImportReview.cshtml"
#line 96 "..\..\Views\Device\ImportReview.cshtml"
#line default
#line hidden
#line 94 "..\..\Views\Device\ImportReview.cshtml"
#line 96 "..\..\Views\Device\ImportReview.cshtml"
if (device.Device == null)
{
@@ -470,14 +474,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 96 "..\..\Views\Device\ImportReview.cshtml"
#line 98 "..\..\Views\Device\ImportReview.cshtml"
Write(device.SerialNumber);
#line default
#line hidden
#line 96 "..\..\Views\Device\ImportReview.cshtml"
#line 98 "..\..\Views\Device\ImportReview.cshtml"
}
else
@@ -487,14 +491,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 100 "..\..\Views\Device\ImportReview.cshtml"
#line 102 "..\..\Views\Device\ImportReview.cshtml"
Write(Html.ActionLink(device.SerialNumber, MVC.Device.Show(device.SerialNumber), new { target = "_blank" }));
#line default
#line hidden
#line 100 "..\..\Views\Device\ImportReview.cshtml"
#line 102 "..\..\Views\Device\ImportReview.cshtml"
}
@@ -504,13 +508,13 @@ WriteLiteral(">\r\n");
WriteLiteral("\r\n");
#line 103 "..\..\Views\Device\ImportReview.cshtml"
#line 105 "..\..\Views\Device\ImportReview.cshtml"
#line default
#line hidden
#line 103 "..\..\Views\Device\ImportReview.cshtml"
#line 105 "..\..\Views\Device\ImportReview.cshtml"
if (device.Errors.TryGetValue("SerialNumber", out error))
{
@@ -524,7 +528,7 @@ WriteLiteral(" class=\"error\"");
WriteLiteral(">");
#line 105 "..\..\Views\Device\ImportReview.cshtml"
#line 107 "..\..\Views\Device\ImportReview.cshtml"
Write(error);
@@ -533,7 +537,7 @@ WriteLiteral(">");
WriteLiteral("</div>\r\n");
#line 106 "..\..\Views\Device\ImportReview.cshtml"
#line 108 "..\..\Views\Device\ImportReview.cshtml"
}
@@ -546,13 +550,13 @@ WriteLiteral(" class=\"model\"");
WriteLiteral(">\r\n");
#line 109 "..\..\Views\Device\ImportReview.cshtml"
#line 111 "..\..\Views\Device\ImportReview.cshtml"
#line default
#line hidden
#line 109 "..\..\Views\Device\ImportReview.cshtml"
#line 111 "..\..\Views\Device\ImportReview.cshtml"
if (device.Errors.TryGetValue("DeviceModelId", out error))
{
@@ -566,7 +570,7 @@ WriteLiteral(" class=\"error\"");
WriteLiteral(">");
#line 111 "..\..\Views\Device\ImportReview.cshtml"
#line 113 "..\..\Views\Device\ImportReview.cshtml"
Write(error);
@@ -575,7 +579,7 @@ WriteLiteral(">");
WriteLiteral("</div>\r\n");
#line 112 "..\..\Views\Device\ImportReview.cshtml"
#line 114 "..\..\Views\Device\ImportReview.cshtml"
}
else
{
@@ -591,33 +595,33 @@ WriteLiteral(" class=\"modelImage\"");
WriteLiteral(" alt=\"Model Image\"");
WriteAttribute("src", Tuple.Create(" src=\"", 5949), Tuple.Create("\"", 6048)
WriteAttribute("src", Tuple.Create(" src=\"", 6013), Tuple.Create("\"", 6112)
#line 117 "..\..\Views\Device\ImportReview.cshtml"
, Tuple.Create(Tuple.Create("", 5955), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(device.DeviceModel.Id, device.DeviceModel.ImageHash()))
#line 119 "..\..\Views\Device\ImportReview.cshtml"
, Tuple.Create(Tuple.Create("", 6019), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(device.DeviceModel.Id, device.DeviceModel.ImageHash()))
#line default
#line hidden
, 5955), false)
, 6019), false)
);
WriteLiteral(" />\r\n");
#line 118 "..\..\Views\Device\ImportReview.cshtml"
#line 120 "..\..\Views\Device\ImportReview.cshtml"
#line default
#line hidden
#line 118 "..\..\Views\Device\ImportReview.cshtml"
#line 120 "..\..\Views\Device\ImportReview.cshtml"
Write(device.DeviceModel.ToString());
#line default
#line hidden
#line 118 "..\..\Views\Device\ImportReview.cshtml"
#line 120 "..\..\Views\Device\ImportReview.cshtml"
}
else
@@ -633,7 +637,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Change</span>\r\n");
#line 123 "..\..\Views\Device\ImportReview.cshtml"
#line 125 "..\..\Views\Device\ImportReview.cshtml"
}
}
@@ -646,13 +650,13 @@ WriteLiteral(" class=\"profile\"");
WriteLiteral(">\r\n");
#line 126 "..\..\Views\Device\ImportReview.cshtml"
#line 128 "..\..\Views\Device\ImportReview.cshtml"
#line default
#line hidden
#line 126 "..\..\Views\Device\ImportReview.cshtml"
#line 128 "..\..\Views\Device\ImportReview.cshtml"
if (device.Errors.TryGetValue("DeviceProfileId", out error))
{
@@ -666,7 +670,7 @@ WriteLiteral(" class=\"error\"");
WriteLiteral(">");
#line 128 "..\..\Views\Device\ImportReview.cshtml"
#line 130 "..\..\Views\Device\ImportReview.cshtml"
Write(error);
@@ -675,7 +679,7 @@ WriteLiteral(">");
WriteLiteral("</div>\r\n");
#line 129 "..\..\Views\Device\ImportReview.cshtml"
#line 131 "..\..\Views\Device\ImportReview.cshtml"
}
else
{
@@ -686,14 +690,14 @@ WriteLiteral("</div>\r\n");
#line default
#line hidden
#line 134 "..\..\Views\Device\ImportReview.cshtml"
#line 136 "..\..\Views\Device\ImportReview.cshtml"
Write(device.DeviceProfile.ToString());
#line default
#line hidden
#line 134 "..\..\Views\Device\ImportReview.cshtml"
#line 136 "..\..\Views\Device\ImportReview.cshtml"
}
else
@@ -709,7 +713,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Change</span>\r\n");
#line 139 "..\..\Views\Device\ImportReview.cshtml"
#line 141 "..\..\Views\Device\ImportReview.cshtml"
}
}
@@ -722,13 +726,13 @@ WriteLiteral(" class=\"batch\"");
WriteLiteral(">\r\n");
#line 142 "..\..\Views\Device\ImportReview.cshtml"
#line 144 "..\..\Views\Device\ImportReview.cshtml"
#line default
#line hidden
#line 142 "..\..\Views\Device\ImportReview.cshtml"
#line 144 "..\..\Views\Device\ImportReview.cshtml"
if (device.Errors.TryGetValue("DeviceBatchId", out error))
{
@@ -742,7 +746,7 @@ WriteLiteral(" class=\"error\"");
WriteLiteral(">");
#line 144 "..\..\Views\Device\ImportReview.cshtml"
#line 146 "..\..\Views\Device\ImportReview.cshtml"
Write(error);
@@ -751,7 +755,7 @@ WriteLiteral(">");
WriteLiteral("</div>\r\n");
#line 145 "..\..\Views\Device\ImportReview.cshtml"
#line 147 "..\..\Views\Device\ImportReview.cshtml"
}
else
{
@@ -770,7 +774,7 @@ WriteLiteral("&lt;None&gt;");
WriteLiteral("\r\n");
#line 153 "..\..\Views\Device\ImportReview.cshtml"
#line 155 "..\..\Views\Device\ImportReview.cshtml"
}
else
{
@@ -779,14 +783,14 @@ WriteLiteral("\r\n");
#line default
#line hidden
#line 156 "..\..\Views\Device\ImportReview.cshtml"
#line 158 "..\..\Views\Device\ImportReview.cshtml"
Write(device.DeviceBatch.ToString());
#line default
#line hidden
#line 156 "..\..\Views\Device\ImportReview.cshtml"
#line 158 "..\..\Views\Device\ImportReview.cshtml"
}
}
@@ -803,7 +807,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Change</span>\r\n");
#line 162 "..\..\Views\Device\ImportReview.cshtml"
#line 164 "..\..\Views\Device\ImportReview.cshtml"
}
}
@@ -816,13 +820,13 @@ WriteLiteral(" class=\"assignedUser\"");
WriteLiteral(">\r\n");
#line 165 "..\..\Views\Device\ImportReview.cshtml"
#line 167 "..\..\Views\Device\ImportReview.cshtml"
#line default
#line hidden
#line 165 "..\..\Views\Device\ImportReview.cshtml"
#line 167 "..\..\Views\Device\ImportReview.cshtml"
if (device.Errors.TryGetValue("AssignedUserId", out error))
{
@@ -836,7 +840,7 @@ WriteLiteral(" class=\"error\"");
WriteLiteral(">");
#line 167 "..\..\Views\Device\ImportReview.cshtml"
#line 169 "..\..\Views\Device\ImportReview.cshtml"
Write(error);
@@ -845,7 +849,7 @@ WriteLiteral(">");
WriteLiteral("</div>\r\n");
#line 168 "..\..\Views\Device\ImportReview.cshtml"
#line 170 "..\..\Views\Device\ImportReview.cshtml"
}
else
{
@@ -864,7 +868,7 @@ WriteLiteral("&lt;None&gt;");
WriteLiteral("\r\n");
#line 176 "..\..\Views\Device\ImportReview.cshtml"
#line 178 "..\..\Views\Device\ImportReview.cshtml"
}
else
{
@@ -873,14 +877,14 @@ WriteLiteral("\r\n");
#line default
#line hidden
#line 179 "..\..\Views\Device\ImportReview.cshtml"
#line 181 "..\..\Views\Device\ImportReview.cshtml"
Write(device.AssignedUser.ToString());
#line default
#line hidden
#line 179 "..\..\Views\Device\ImportReview.cshtml"
#line 181 "..\..\Views\Device\ImportReview.cshtml"
}
}
@@ -897,7 +901,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Change</span>\r\n");
#line 185 "..\..\Views\Device\ImportReview.cshtml"
#line 187 "..\..\Views\Device\ImportReview.cshtml"
}
}
@@ -910,13 +914,13 @@ WriteLiteral(" class=\"location\"");
WriteLiteral(">\r\n");
#line 188 "..\..\Views\Device\ImportReview.cshtml"
#line 190 "..\..\Views\Device\ImportReview.cshtml"
#line default
#line hidden
#line 188 "..\..\Views\Device\ImportReview.cshtml"
#line 190 "..\..\Views\Device\ImportReview.cshtml"
if (device.Errors.TryGetValue("Location", out error))
{
@@ -930,7 +934,7 @@ WriteLiteral(" class=\"error\"");
WriteLiteral(">");
#line 190 "..\..\Views\Device\ImportReview.cshtml"
#line 192 "..\..\Views\Device\ImportReview.cshtml"
Write(error);
@@ -939,7 +943,7 @@ WriteLiteral(">");
WriteLiteral("</div>\r\n");
#line 191 "..\..\Views\Device\ImportReview.cshtml"
#line 193 "..\..\Views\Device\ImportReview.cshtml"
}
else
{
@@ -958,7 +962,7 @@ WriteLiteral("&lt;None&gt;");
WriteLiteral("\r\n");
#line 199 "..\..\Views\Device\ImportReview.cshtml"
#line 201 "..\..\Views\Device\ImportReview.cshtml"
}
else
{
@@ -967,14 +971,14 @@ WriteLiteral("\r\n");
#line default
#line hidden
#line 202 "..\..\Views\Device\ImportReview.cshtml"
#line 204 "..\..\Views\Device\ImportReview.cshtml"
Write(device.Location);
#line default
#line hidden
#line 202 "..\..\Views\Device\ImportReview.cshtml"
#line 204 "..\..\Views\Device\ImportReview.cshtml"
}
}
@@ -991,7 +995,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Change</span>\r\n");
#line 208 "..\..\Views\Device\ImportReview.cshtml"
#line 210 "..\..\Views\Device\ImportReview.cshtml"
}
}
@@ -1004,13 +1008,13 @@ WriteLiteral(" class=\"assetNumber\"");
WriteLiteral(">\r\n");
#line 211 "..\..\Views\Device\ImportReview.cshtml"
#line 213 "..\..\Views\Device\ImportReview.cshtml"
#line default
#line hidden
#line 211 "..\..\Views\Device\ImportReview.cshtml"
#line 213 "..\..\Views\Device\ImportReview.cshtml"
if (device.Errors.TryGetValue("AssetNumber", out error))
{
@@ -1024,7 +1028,7 @@ WriteLiteral(" class=\"error\"");
WriteLiteral(">");
#line 213 "..\..\Views\Device\ImportReview.cshtml"
#line 215 "..\..\Views\Device\ImportReview.cshtml"
Write(error);
@@ -1033,7 +1037,7 @@ WriteLiteral(">");
WriteLiteral("</div>\r\n");
#line 214 "..\..\Views\Device\ImportReview.cshtml"
#line 216 "..\..\Views\Device\ImportReview.cshtml"
}
else
{
@@ -1052,7 +1056,7 @@ WriteLiteral("&lt;None&gt;");
WriteLiteral("\r\n");
#line 222 "..\..\Views\Device\ImportReview.cshtml"
#line 224 "..\..\Views\Device\ImportReview.cshtml"
}
else
{
@@ -1061,14 +1065,14 @@ WriteLiteral("\r\n");
#line default
#line hidden
#line 225 "..\..\Views\Device\ImportReview.cshtml"
#line 227 "..\..\Views\Device\ImportReview.cshtml"
Write(device.AssetNumber);
#line default
#line hidden
#line 225 "..\..\Views\Device\ImportReview.cshtml"
#line 227 "..\..\Views\Device\ImportReview.cshtml"
}
}
@@ -1085,7 +1089,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Change</span>\r\n");
#line 231 "..\..\Views\Device\ImportReview.cshtml"
#line 233 "..\..\Views\Device\ImportReview.cshtml"
}
}
@@ -1094,7 +1098,7 @@ WriteLiteral(">No Change</span>\r\n");
WriteLiteral("</td>\r\n </tr>\r\n");
#line 234 "..\..\Views\Device\ImportReview.cshtml"
#line 236 "..\..\Views\Device\ImportReview.cshtml"
}
@@ -1103,7 +1107,7 @@ WriteLiteral("</td>\r\n </tr>\r\n");
WriteLiteral(" </tbody>\r\n </table>\r\n");
#line 237 "..\..\Views\Device\ImportReview.cshtml"
#line 239 "..\..\Views\Device\ImportReview.cshtml"
if (importDeviceOkCount > 0)
{
@@ -1120,7 +1124,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 241 "..\..\Views\Device\ImportReview.cshtml"
#line 243 "..\..\Views\Device\ImportReview.cshtml"
Write(Html.ActionLinkButton(string.Format("Import {0} Device{1}", importDeviceOkCount, importDeviceOkCount != 1 ? "s" : null), MVC.API.Device.ImportProcess(Model.ImportParseTaskId)));
@@ -1129,7 +1133,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n");
#line 243 "..\..\Views\Device\ImportReview.cshtml"
#line 245 "..\..\Views\Device\ImportReview.cshtml"
}
}
else
@@ -1141,7 +1145,7 @@ WriteLiteral("\r\n </div>\r\n");
WriteLiteral(" <h2>No Devices were found in this file</h2>\r\n");
#line 248 "..\..\Views\Device\ImportReview.cshtml"
#line 250 "..\..\Views\Device\ImportReview.cshtml"
}
+22 -7
View File
@@ -1,10 +1,25 @@
@{
ViewBag.Title = "Devices";
}
<h3>
Search for a Device</h3>
@Html.Partial(MVC.Shared.Views._SearchDialog, "devices")
<div class="actionBar">
@Html.ActionLinkButton("Import/Export Devices", MVC.Device.ImportExport())
@Html.ActionLinkButton("Add Offline Device", MVC.Device.AddOffline())
</div>
@if (Authorization.Has(Claims.Device.Search))
{
<h3>Search for a Device</h3>
@Html.Partial(MVC.Shared.Views._SearchDialog, "devices")
}
@if (Authorization.HasAny(Claims.Device.Actions.Import, Claims.Device.Actions.Export, Claims.Device.Actions.EnrolDevices))
{
<div class="actionBar">
@if (Authorization.HasAll(Claims.Device.Actions.Import, Claims.Device.Actions.Export))
{
@Html.ActionLinkButton("Import/Export Devices", MVC.Device.ImportExport())
}else if (Authorization.Has(Claims.Device.Actions.Import)){
@Html.ActionLinkButton("Import Devices", MVC.Device.ImportExport())
}else if (Authorization.Has(Claims.Device.Actions.Export)){
@Html.ActionLinkButton("Export All Devices", MVC.API.Device.ExportAllDevices())
}
@if (Authorization.Has(Claims.Device.Actions.EnrolDevices))
{
@Html.ActionLinkButton("Add Offline Device", MVC.Device.AddOffline())
}
</div>
}
+119 -15
View File
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Device
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/Index.cshtml")]
public partial class Index : System.Web.Mvc.WebViewPage<dynamic>
public partial class Index : Disco.Services.Web.WebViewPage<dynamic>
{
public Index()
{
@@ -48,43 +50,145 @@ namespace Disco.Web.Views.Device
#line default
#line hidden
WriteLiteral("\r\n<h3>\r\n Search for a Device</h3>\r\n");
WriteLiteral("\r\n");
#line 6 "..\..\Views\Device\Index.cshtml"
#line 4 "..\..\Views\Device\Index.cshtml"
if (Authorization.Has(Claims.Device.Search))
{
#line default
#line hidden
WriteLiteral(" <h3>Search for a Device</h3>\r\n");
#line 7 "..\..\Views\Device\Index.cshtml"
#line default
#line hidden
#line 7 "..\..\Views\Device\Index.cshtml"
Write(Html.Partial(MVC.Shared.Views._SearchDialog, "devices"));
#line default
#line hidden
WriteLiteral("\r\n<div");
#line 7 "..\..\Views\Device\Index.cshtml"
}
#line default
#line hidden
#line 9 "..\..\Views\Device\Index.cshtml"
if (Authorization.HasAny(Claims.Device.Actions.Import, Claims.Device.Actions.Export, Claims.Device.Actions.EnrolDevices))
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 8 "..\..\Views\Device\Index.cshtml"
Write(Html.ActionLinkButton("Import/Export Devices", MVC.Device.ImportExport()));
#line 12 "..\..\Views\Device\Index.cshtml"
#line default
#line hidden
#line 12 "..\..\Views\Device\Index.cshtml"
if (Authorization.HasAll(Claims.Device.Actions.Import, Claims.Device.Actions.Export))
{
#line default
#line hidden
#line 14 "..\..\Views\Device\Index.cshtml"
Write(Html.ActionLinkButton("Import/Export Devices", MVC.Device.ImportExport()));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 9 "..\..\Views\Device\Index.cshtml"
Write(Html.ActionLinkButton("Add Offline Device", MVC.Device.AddOffline()));
#line 14 "..\..\Views\Device\Index.cshtml"
}else if (Authorization.Has(Claims.Device.Actions.Import)){
#line default
#line hidden
#line 16 "..\..\Views\Device\Index.cshtml"
Write(Html.ActionLinkButton("Import Devices", MVC.Device.ImportExport()));
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n");
#line 16 "..\..\Views\Device\Index.cshtml"
}else if (Authorization.Has(Claims.Device.Actions.Export)){
#line default
#line hidden
#line 18 "..\..\Views\Device\Index.cshtml"
Write(Html.ActionLinkButton("Export All Devices", MVC.API.Device.ExportAllDevices()));
#line default
#line hidden
#line 18 "..\..\Views\Device\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 20 "..\..\Views\Device\Index.cshtml"
if (Authorization.Has(Claims.Device.Actions.EnrolDevices))
{
#line default
#line hidden
#line 22 "..\..\Views\Device\Index.cshtml"
Write(Html.ActionLinkButton("Add Offline Device", MVC.Device.AddOffline()));
#line default
#line hidden
#line 22 "..\..\Views\Device\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
#line 25 "..\..\Views\Device\Index.cshtml"
}
#line default
#line hidden
}
}
}
+46 -27
View File
@@ -17,38 +17,57 @@
<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();
if ($tabs.children().length > 1) {
$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);
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);
}
}
}
}, 1);
}
});
}, 1);
}
});
} else {
$tabs.hide();
}
});
</script>
<div id="DeviceDetailTabs">
<ul id="DeviceDetailTabItems"></ul>
@Html.Partial(MVC.Device.Views.DeviceParts._Jobs, Model)
@Html.Partial(MVC.Device.Views.DeviceParts._Details, 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)
@if (Authorization.Has(Claims.Device.ShowJobs))
{
@Html.Partial(MVC.Device.Views.DeviceParts._Jobs, Model)
}
@if (Authorization.Has(Claims.Device.ShowDetails))
{
@Html.Partial(MVC.Device.Views.DeviceParts._Details, Model)
}
@if (Authorization.Has(Claims.Device.ShowAssignmentHistory))
{
@Html.Partial(MVC.Device.Views.DeviceParts._AssignmentHistory, Model)
}
@if (Authorization.Has(Claims.Device.ShowAttachments))
{
@Html.Partial(MVC.Device.Views.DeviceParts._Resources, Model)
}
@if (Authorization.Has(Claims.Device.ShowCertificates))
{
@Html.Partial(MVC.Device.Views.DeviceParts._Certificates, Model)
}
</div>
</div>
+148 -79
View File
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Device
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/Show.cshtml")]
public partial class Show : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ShowModel>
public partial class Show : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.ShowModel>
{
public Show()
{
@@ -101,36 +103,27 @@ WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(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);
}
}
}, 1);
}
});
});
</script>
<div");
WriteLiteral(">\r\n $(function () {\r\n var $tabs = $(\'#DeviceDetailTabs\');\r\n " +
" if ($tabs.children().length > 1) {\r\n $tabs.tabs({\r\n " +
" activate: function (event, ui) {\r\n window.s" +
"etTimeout(function () {\r\n var $window = $(window);\r\n " +
" var tabHeight = $tabs.height();\r\n " +
" var tabOffset = $tabs.offset();\r\n var windowS" +
"crollTop = $window.scrollTop();\r\n var windowHeight = " +
"$window.height();\r\n\r\n var tabTopNotShown = windowScro" +
"llTop - tabOffset.top;\r\n if (tabTopNotShown > 0) {\r\n " +
" $(\'html\').animate({ scrollTop: tabOffset.top }, 1" +
"25);\r\n } else {\r\n var " +
"tabBottomNotShown = ((windowScrollTop + windowHeight) - (tabHeight + tabOffset.t" +
"op)) * -1;\r\n if (tabBottomNotShown > 0) {\r\n " +
" if (tabHeight > windowHeight)\r\n " +
" $(\'html\').animate({ scrollTop: tabOffset.top }, 125);\r\n " +
" else\r\n $(" +
"\'html\').animate({ scrollTop: windowScrollTop + tabBottomNotShown }, 125);\r\n " +
" }\r\n }\r\n " +
" }, 1);\r\n }\r\n });\r\n } else {\r\n " +
" $tabs.hide();\r\n }\r\n });\r\n </script>\r\n <di" +
"v");
WriteLiteral(" id=\"DeviceDetailTabs\"");
@@ -140,60 +133,136 @@ WriteLiteral(" id=\"DeviceDetailTabItems\"");
WriteLiteral("></ul>\r\n");
WriteLiteral(" ");
#line 48 "..\..\Views\Device\Show.cshtml"
Write(Html.Partial(MVC.Device.Views.DeviceParts._Jobs, Model));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 49 "..\..\Views\Device\Show.cshtml"
Write(Html.Partial(MVC.Device.Views.DeviceParts._Details, Model));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 50 "..\..\Views\Device\Show.cshtml"
Write(Html.Partial(MVC.Device.Views.DeviceParts._AssignmentHistory, Model));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 51 "..\..\Views\Device\Show.cshtml"
Write(Html.Partial(MVC.Device.Views.DeviceParts._Resources, Model));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 52 "..\..\Views\Device\Show.cshtml"
Write(Html.Partial(MVC.Device.Views.DeviceParts._Certificates, Model));
#line default
#line hidden
#line 52 "..\..\Views\Device\Show.cshtml"
if (Authorization.Has(Claims.Device.ShowJobs))
{
#line default
#line hidden
#line 54 "..\..\Views\Device\Show.cshtml"
Write(Html.Partial(MVC.Device.Views.DeviceParts._Jobs, Model));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n</div>\r\n");
#line 54 "..\..\Views\Device\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 56 "..\..\Views\Device\Show.cshtml"
if (Authorization.Has(Claims.Device.ShowDetails))
{
#line default
#line hidden
#line 58 "..\..\Views\Device\Show.cshtml"
Write(Html.Partial(MVC.Device.Views.DeviceParts._Details, Model));
#line default
#line hidden
#line 58 "..\..\Views\Device\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 60 "..\..\Views\Device\Show.cshtml"
if (Authorization.Has(Claims.Device.ShowAssignmentHistory))
{
#line default
#line hidden
#line 62 "..\..\Views\Device\Show.cshtml"
Write(Html.Partial(MVC.Device.Views.DeviceParts._AssignmentHistory, Model));
#line default
#line hidden
#line 62 "..\..\Views\Device\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 64 "..\..\Views\Device\Show.cshtml"
if (Authorization.Has(Claims.Device.ShowAttachments))
{
#line default
#line hidden
#line 66 "..\..\Views\Device\Show.cshtml"
Write(Html.Partial(MVC.Device.Views.DeviceParts._Resources, Model));
#line default
#line hidden
#line 66 "..\..\Views\Device\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 68 "..\..\Views\Device\Show.cshtml"
if (Authorization.Has(Claims.Device.ShowCertificates))
{
#line default
#line hidden
#line 70 "..\..\Views\Device\Show.cshtml"
Write(Html.Partial(MVC.Device.Views.DeviceParts._Certificates, Model));
#line default
#line hidden
#line 70 "..\..\Views\Device\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n</div>\r\n");
}
}
+14 -15
View File
@@ -1,30 +1,26 @@
@model IEnumerable<Disco.Models.BI.Search.DeviceSearchResultItem>
@{
var canShowDevices = Authorization.Has(Claims.Device.Show);
}
<div class="genericData deviceTable">
@if (Model != null && Model.Count() > 0)
{
<table class="genericData deviceTable">
<thead>
<tr>
<th>
Serial#
<th>Serial#
</th>
<th>
Asset#
<th>Asset#
</th>
<th>
Name
<th>Name
</th>
<th>
Model
<th>Model
</th>
<th>
Profile
<th>Profile
</th>
<th>
Assigned User
<th>Assigned User
</th>
<th>
Jobs
<th>Jobs
</th>
</tr>
</thead>
@@ -33,7 +29,10 @@
{
<tr class="@(item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty)">
<td>
@Html.ActionLink(item.SerialNumber, MVC.Device.Show(item.SerialNumber))
@if (canShowDevices)
{@Html.ActionLink(item.SerialNumber, MVC.Device.Show(item.SerialNumber))}
else
{@item.SerialNumber}
</td>
<td>
@item.AssetNumber
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,32 +28,42 @@ namespace Disco.Web.Views.Device
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/_DeviceTable.cshtml")]
public partial class DeviceTable : System.Web.Mvc.WebViewPage<IEnumerable<Disco.Models.BI.Search.DeviceSearchResultItem>>
public partial class DeviceTable : Disco.Services.Web.WebViewPage<IEnumerable<Disco.Models.BI.Search.DeviceSearchResultItem>>
{
public DeviceTable()
{
}
public override void Execute()
{
WriteLiteral("<div");
#line 2 "..\..\Views\Device\_DeviceTable.cshtml"
var canShowDevices = Authorization.Has(Claims.Device.Show);
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" class=\"genericData deviceTable\"");
WriteLiteral(">\r\n");
#line 3 "..\..\Views\Device\_DeviceTable.cshtml"
#line 6 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
#line 3 "..\..\Views\Device\_DeviceTable.cshtml"
#line 6 "..\..\Views\Device\_DeviceTable.cshtml"
if (Model != null && Model.Count() > 0)
{
@@ -67,26 +77,19 @@ WriteLiteral(" class=\"genericData deviceTable\"");
WriteLiteral(@">
<thead>
<tr>
<th>
Serial#
<th>Serial#
</th>
<th>
Asset#
<th>Asset#
</th>
<th>
Name
<th>Name
</th>
<th>
Model
<th>Model
</th>
<th>
Profile
<th>Profile
</th>
<th>
Assigned User
<th>Assigned User
</th>
<th>
Jobs
<th>Jobs
</th>
</tr>
</thead>
@@ -94,13 +97,13 @@ WriteLiteral(@">
");
#line 32 "..\..\Views\Device\_DeviceTable.cshtml"
#line 28 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
#line 32 "..\..\Views\Device\_DeviceTable.cshtml"
#line 28 "..\..\Views\Device\_DeviceTable.cshtml"
foreach (var item in Model)
{
@@ -109,33 +112,66 @@ WriteLiteral(@">
#line hidden
WriteLiteral(" <tr");
WriteAttribute("class", Tuple.Create(" class=\"", 1005), Tuple.Create("\"", 1082)
WriteAttribute("class", Tuple.Create(" class=\"", 895), Tuple.Create("\"", 972)
#line 34 "..\..\Views\Device\_DeviceTable.cshtml"
, Tuple.Create(Tuple.Create("", 1013), Tuple.Create<System.Object, System.Int32>(item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty
#line 30 "..\..\Views\Device\_DeviceTable.cshtml"
, Tuple.Create(Tuple.Create("", 903), Tuple.Create<System.Object, System.Int32>(item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty
#line default
#line hidden
, 1013), false)
, 903), false)
);
WriteLiteral(">\r\n <td>\r\n");
WriteLiteral(" ");
#line 36 "..\..\Views\Device\_DeviceTable.cshtml"
Write(Html.ActionLink(item.SerialNumber, MVC.Device.Show(item.SerialNumber)));
#line 32 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
#line 32 "..\..\Views\Device\_DeviceTable.cshtml"
if (canShowDevices)
{
#line default
#line hidden
#line 33 "..\..\Views\Device\_DeviceTable.cshtml"
Write(Html.ActionLink(item.SerialNumber, MVC.Device.Show(item.SerialNumber)));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
#line 33 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
{
#line default
#line hidden
#line 35 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.SerialNumber);
#line default
#line hidden
#line 35 "..\..\Views\Device\_DeviceTable.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 39 "..\..\Views\Device\_DeviceTable.cshtml"
#line 38 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.AssetNumber);
@@ -144,13 +180,13 @@ WriteLiteral(" ");
WriteLiteral("\r\n");
#line 40 "..\..\Views\Device\_DeviceTable.cshtml"
#line 39 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
#line 40 "..\..\Views\Device\_DeviceTable.cshtml"
#line 39 "..\..\Views\Device\_DeviceTable.cshtml"
if (item.DecommissionedDate.HasValue)
{
@@ -165,7 +201,7 @@ WriteLiteral(">(Decommissioned\r\n");
WriteLiteral(" ");
#line 42 "..\..\Views\Device\_DeviceTable.cshtml"
#line 41 "..\..\Views\Device\_DeviceTable.cshtml"
Write(CommonHelpers.FriendlyDate(item.DecommissionedDate.Value));
@@ -174,7 +210,7 @@ WriteLiteral(" ");
WriteLiteral(")</span> ");
#line 42 "..\..\Views\Device\_DeviceTable.cshtml"
#line 41 "..\..\Views\Device\_DeviceTable.cshtml"
}
@@ -183,13 +219,13 @@ WriteLiteral(")</span> ");
WriteLiteral(" </td>\r\n <td>\r\n");
#line 45 "..\..\Views\Device\_DeviceTable.cshtml"
#line 44 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
#line 45 "..\..\Views\Device\_DeviceTable.cshtml"
#line 44 "..\..\Views\Device\_DeviceTable.cshtml"
if (string.IsNullOrWhiteSpace(item.ComputerName))
{
@@ -203,7 +239,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">Unknown</span>\r\n");
#line 48 "..\..\Views\Device\_DeviceTable.cshtml"
#line 47 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
{
@@ -212,14 +248,14 @@ WriteLiteral(">Unknown</span>\r\n");
#line default
#line hidden
#line 51 "..\..\Views\Device\_DeviceTable.cshtml"
#line 50 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.ComputerName);
#line default
#line hidden
#line 51 "..\..\Views\Device\_DeviceTable.cshtml"
#line 50 "..\..\Views\Device\_DeviceTable.cshtml"
}
@@ -229,13 +265,13 @@ WriteLiteral(">Unknown</span>\r\n");
WriteLiteral(" </td>\r\n <td>\r\n");
#line 55 "..\..\Views\Device\_DeviceTable.cshtml"
#line 54 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
#line 55 "..\..\Views\Device\_DeviceTable.cshtml"
#line 54 "..\..\Views\Device\_DeviceTable.cshtml"
if (item.DeviceModelDescription != null)
{
@@ -245,7 +281,7 @@ WriteLiteral(" </td>\r\n <td>\r\n"
WriteLiteral(" <span>");
#line 57 "..\..\Views\Device\_DeviceTable.cshtml"
#line 56 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.DeviceModelDescription);
@@ -254,7 +290,7 @@ WriteLiteral(" <span>");
WriteLiteral("</span>\r\n");
#line 58 "..\..\Views\Device\_DeviceTable.cshtml"
#line 57 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
{
@@ -269,7 +305,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">Unknown</span> \r\n");
#line 62 "..\..\Views\Device\_DeviceTable.cshtml"
#line 61 "..\..\Views\Device\_DeviceTable.cshtml"
}
@@ -280,7 +316,7 @@ WriteLiteral(" </td>\r\n <td>\r\n"
WriteLiteral(" ");
#line 65 "..\..\Views\Device\_DeviceTable.cshtml"
#line 64 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.DeviceProfileDescription);
@@ -289,13 +325,13 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n <td>\r\n");
#line 68 "..\..\Views\Device\_DeviceTable.cshtml"
#line 67 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
#line 68 "..\..\Views\Device\_DeviceTable.cshtml"
#line 67 "..\..\Views\Device\_DeviceTable.cshtml"
if (string.IsNullOrEmpty(item.AssignedUserId))
{
@@ -309,7 +345,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">N/A</span> \r\n");
#line 71 "..\..\Views\Device\_DeviceTable.cshtml"
#line 70 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
{
@@ -320,7 +356,7 @@ WriteLiteral(">N/A</span> \r\n");
WriteLiteral(" <span>");
#line 74 "..\..\Views\Device\_DeviceTable.cshtml"
#line 73 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.AssignedUserDescription);
@@ -329,7 +365,7 @@ WriteLiteral(" <span>");
WriteLiteral("</span>\r\n");
#line 75 "..\..\Views\Device\_DeviceTable.cshtml"
#line 74 "..\..\Views\Device\_DeviceTable.cshtml"
}
@@ -340,7 +376,7 @@ WriteLiteral(" </td>\r\n <td>\r\n"
WriteLiteral(" ");
#line 78 "..\..\Views\Device\_DeviceTable.cshtml"
#line 77 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.JobCount);
@@ -349,7 +385,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 81 "..\..\Views\Device\_DeviceTable.cshtml"
#line 80 "..\..\Views\Device\_DeviceTable.cshtml"
}
@@ -358,7 +394,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n
WriteLiteral(" </tbody>\r\n </table>\r\n");
#line 84 "..\..\Views\Device\_DeviceTable.cshtml"
#line 83 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
{
@@ -373,7 +409,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Devices Found</span>\r\n");
#line 88 "..\..\Views\Device\_DeviceTable.cshtml"
#line 87 "..\..\Views\Device\_DeviceTable.cshtml"
}
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,6 +28,8 @@ namespace Disco.Web.Views.Device
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;