#138 add/remove individual device flags UI
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Disco.Models.BI.Config;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Services.Documents;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using System.Collections.Generic;
|
||||
@@ -22,6 +23,9 @@ namespace Disco.Models.UI.Device
|
||||
|
||||
List<Repository.DocumentTemplate> DocumentTemplates { get; set; }
|
||||
List<DocumentTemplatePackage> DocumentTemplatePackages { get; set; }
|
||||
|
||||
List<DeviceFlag> AvailableDeviceFlags { get; set; }
|
||||
|
||||
Dictionary<string, string> AssignedUserDetails { get; set; }
|
||||
bool HasAssignedUserPhoto { get; set; }
|
||||
}
|
||||
|
||||
@@ -404,6 +404,118 @@
|
||||
background-color: inherit;
|
||||
border: 1px solid #fff;
|
||||
}
|
||||
#Device_Show_Details_Actions_AddFlag_Dialog {
|
||||
height: 400px;
|
||||
}
|
||||
#Device_Show_Details_Actions_AddFlag_Dialog .flagPicker {
|
||||
position: absolute;
|
||||
width: 250px;
|
||||
height: 300px;
|
||||
overflow-y: auto;
|
||||
background-color: #fcfcfc;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
#Device_Show_Details_Actions_AddFlag_Dialog .flagPicker > div {
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 6px 0 6px 6px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#Device_Show_Details_Actions_AddFlag_Dialog .flagPicker > div:hover {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
#Device_Show_Details_Actions_AddFlag_Dialog .flagPicker > div.selected,
|
||||
#Device_Show_Details_Actions_AddFlag_Dialog .flagPicker > div.selected:hover {
|
||||
background-color: #eee;
|
||||
}
|
||||
#Device_Show_Details_Actions_AddFlag_Dialog .details {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 280px;
|
||||
top: 1em;
|
||||
}
|
||||
#Device_Show_Details_Actions_AddFlag_Dialog .details h4 {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
#Device_Show_Details_Actions_AddFlag_Dialog .details textarea {
|
||||
min-width: 280px;
|
||||
height: 200px;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags {
|
||||
border: solid 1px #d8d8d8;
|
||||
border-collapse: collapse;
|
||||
table-layout: fixed;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags td {
|
||||
border: solid 1px #d8d8d8;
|
||||
background-color: #fff;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags th {
|
||||
background-color: #eee;
|
||||
border: solid 1px #d8d8d8;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags i.fa-edit {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
margin-top: 4px;
|
||||
font-size: 1.1em;
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
color: #335A87;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags i.fa-edit:hover {
|
||||
color: #5e8cc2;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags td:hover i.fa-edit {
|
||||
display: inline-block;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags th.name {
|
||||
width: 200px;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags tr.removed td {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags td.name {
|
||||
vertical-align: middle;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags td.name .fa-stack {
|
||||
line-height: 1.6em;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags td.added,
|
||||
#DeviceDetailTab-Flags #deviceFlags td.removed {
|
||||
vertical-align: middle;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags td.added .expressionResult,
|
||||
#DeviceDetailTab-Flags #deviceFlags td.removed .expressionResult {
|
||||
margin-top: 4px;
|
||||
font-style: italic;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags td.comments {
|
||||
vertical-align: middle;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags td.comments .editable {
|
||||
position: relative;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags td.comments .commentsRaw {
|
||||
display: none;
|
||||
}
|
||||
#DeviceDetailTab-Flags #deviceFlags td.removed.na {
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
#DeviceDetailTab-Flags > .none {
|
||||
text-align: center;
|
||||
padding: 30px 0;
|
||||
font-style: italic;
|
||||
background-color: #fff;
|
||||
}
|
||||
#Device_Show_Flags_Actions_EditComments_Dialog h4 {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
#Device_Show_Flags_Actions_EditComments_Dialog_Comments {
|
||||
width: 280px;
|
||||
}
|
||||
#Devices_Export .Devices_Export_Type_Target {
|
||||
margin-top: 10px;
|
||||
display: none;
|
||||
|
||||
@@ -393,6 +393,143 @@
|
||||
}
|
||||
}
|
||||
|
||||
#Device_Show_Details_Actions_AddFlag_Dialog {
|
||||
height: 400px;
|
||||
|
||||
.flagPicker {
|
||||
position: absolute;
|
||||
width: 250px;
|
||||
height: 300px;
|
||||
overflow-y: auto;
|
||||
background-color: #fcfcfc;
|
||||
border: 1px solid #ccc;
|
||||
|
||||
& > div {
|
||||
background-color: @white;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 6px 0 6px 6px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background-color: @TableDataBorderColour;
|
||||
}
|
||||
|
||||
&.selected, &.selected:hover {
|
||||
background-color: @TableDataDarkBackgroundColour;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.details {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 280px;
|
||||
top: 1em;
|
||||
|
||||
h4 {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
textarea {
|
||||
min-width: 280px;
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#DeviceDetailTab-Flags {
|
||||
#deviceFlags {
|
||||
.tableDataDark;
|
||||
table-layout: fixed;
|
||||
|
||||
i.fa-edit {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
margin-top: 4px;
|
||||
font-size: 1.1em;
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
color: @HyperLinkColour;
|
||||
|
||||
&:hover {
|
||||
color: @HyperLinkHoverColour;
|
||||
}
|
||||
}
|
||||
|
||||
td:hover i.fa-edit {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
th.name {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
th.added {
|
||||
}
|
||||
|
||||
th.removed {
|
||||
}
|
||||
|
||||
tr.removed td {
|
||||
background-color: @TableDataBorderColour;
|
||||
}
|
||||
|
||||
td.name {
|
||||
vertical-align: middle;
|
||||
|
||||
.fa-stack {
|
||||
line-height: 1.6em;
|
||||
}
|
||||
}
|
||||
|
||||
td.added, td.removed {
|
||||
vertical-align: middle;
|
||||
|
||||
.expressionResult {
|
||||
margin-top: 4px;
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
|
||||
td.comments {
|
||||
vertical-align: middle;
|
||||
|
||||
.editable {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.commentsRaw {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
td.removed {
|
||||
&.na {
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& > .none {
|
||||
text-align: center;
|
||||
padding: 30px 0;
|
||||
font-style: italic;
|
||||
background-color: @white;
|
||||
}
|
||||
}
|
||||
|
||||
#Device_Show_Flags_Actions_EditComments_Dialog {
|
||||
h4 {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
#Device_Show_Flags_Actions_EditComments_Dialog_Comments {
|
||||
width: 280px;
|
||||
}
|
||||
|
||||
#Devices_Export {
|
||||
.Devices_Export_Type_Target {
|
||||
margin-top: 10px;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -4,6 +4,7 @@ using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Models.UI.Device;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Devices.DeviceFlags;
|
||||
using Disco.Services.Exporting;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
using Disco.Services.Plugins.Features.DetailsProvider;
|
||||
@@ -12,6 +13,7 @@ using Disco.Services.Users;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
@@ -226,16 +228,18 @@ namespace Disco.Web.Controllers
|
||||
Database.Configuration.LazyLoadingEnabled = true;
|
||||
|
||||
m.Device = Database.Devices
|
||||
.Include("DeviceModel")
|
||||
.Include("DeviceProfile")
|
||||
.Include("DeviceBatch")
|
||||
.Include("DeviceDetails")
|
||||
.Include("DeviceUserAssignments.AssignedUser.UserFlagAssignments")
|
||||
.Include("AssignedUser.UserFlagAssignments")
|
||||
.Include("AssignedUser.UserDetails")
|
||||
.Include("DeviceCertificates")
|
||||
.Include("DeviceAttachments.TechUser")
|
||||
.Include("DeviceAttachments.DocumentTemplate")
|
||||
.Include(d => d.DeviceModel)
|
||||
.Include(d => d.DeviceProfile)
|
||||
.Include(d => d.DeviceBatch)
|
||||
.Include(d => d.DeviceDetails)
|
||||
.Include(d => d.DeviceUserAssignments.Select(a => a.AssignedUser.UserFlagAssignments))
|
||||
.Include(d => d.AssignedUser.UserFlagAssignments)
|
||||
.Include(d => d.AssignedUser.UserDetails)
|
||||
.Include(d => d.DeviceCertificates)
|
||||
.Include(d => d.DeviceAttachments.Select(a => a.TechUser))
|
||||
.Include(d => d.DeviceAttachments.Select(a => a.DocumentTemplate))
|
||||
.Include(d => d.DeviceFlagAssignments.Select(a => a.AddedUser))
|
||||
.Include(d => d.DeviceFlagAssignments.Select(a => a.RemovedUser))
|
||||
.FirstOrDefault(d => d.SerialNumber == id);
|
||||
|
||||
if (m.Device == null)
|
||||
@@ -310,6 +314,16 @@ namespace Disco.Web.Controllers
|
||||
m.DeviceProfileWirelessProfileProviders = m.Device.DeviceProfile.GetWirelessProfileProviders().ToList();
|
||||
}
|
||||
|
||||
if (Authorization.Has(Claims.Device.ShowFlagAssignments))
|
||||
{
|
||||
var usedFlags = m.Device.DeviceFlagAssignments
|
||||
.Where(a => !a.RemovedDate.HasValue)
|
||||
.Select(a => a.DeviceFlagId)
|
||||
.Distinct().ToList();
|
||||
|
||||
m.AvailableDeviceFlags = DeviceFlagService.GetDeviceFlags().Where(f => !usedFlags.Contains(f.Id)).ToList();
|
||||
}
|
||||
|
||||
if (Authorization.Has(Claims.User.ShowDetails))
|
||||
{
|
||||
// Populate Custom Details
|
||||
|
||||
@@ -10,6 +10,7 @@ using Disco.Services.Users;
|
||||
using Disco.Services.Users.UserFlags;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
|
||||
@@ -54,15 +55,15 @@ namespace Disco.Web.Controllers
|
||||
}
|
||||
|
||||
m.User = Database.Users
|
||||
.Include("DeviceUserAssignments.Device.DeviceModel")
|
||||
.Include("DeviceUserAssignments.Device.DeviceProfile")
|
||||
.Include("DeviceUserAssignments.Device.DeviceBatch")
|
||||
.Include("DeviceUserAssignments.Device.DeviceDetails")
|
||||
.Include("UserAttachments.TechUser")
|
||||
.Include("UserAttachments.DocumentTemplate")
|
||||
.Include("UserFlagAssignments.AddedUser")
|
||||
.Include("UserFlagAssignments.RemovedUser")
|
||||
.Include("UserDetails")
|
||||
.Include(u => u.DeviceUserAssignments.Select(dua => dua.Device.DeviceModel))
|
||||
.Include(u => u.DeviceUserAssignments.Select(dua => dua.Device.DeviceProfile))
|
||||
.Include(u => u.DeviceUserAssignments.Select(dua => dua.Device.DeviceBatch))
|
||||
.Include(u => u.DeviceUserAssignments.Select(dua => dua.Device.DeviceDetails))
|
||||
.Include(u => u.UserAttachments.Select(ua => ua.TechUser))
|
||||
.Include(u => u.UserAttachments.Select(ua => ua.DocumentTemplate))
|
||||
.Include(u => u.UserFlagAssignments.Select(ufa => ufa.AddedUser))
|
||||
.Include(u => u.UserFlagAssignments.Select(ufa => ufa.RemovedUser))
|
||||
.Include(u => u.UserDetails)
|
||||
.FirstOrDefault(um => um.UserId == id);
|
||||
|
||||
if (m.User == null)
|
||||
@@ -79,7 +80,7 @@ namespace Disco.Web.Controllers
|
||||
HideClosedJobs = true,
|
||||
EnablePaging = false
|
||||
};
|
||||
m.Jobs.Fill(Database, Disco.Services.Searching.Search.BuildJobTableModel(Database).Where(j => j.UserId == id).OrderByDescending(j => j.Id), true);
|
||||
m.Jobs.Fill(Database, Services.Searching.Search.BuildJobTableModel(Database).Where(j => j.UserId == id).OrderByDescending(j => j.Id), true);
|
||||
}
|
||||
|
||||
if (Authorization.Has(Claims.User.ShowFlagAssignments))
|
||||
|
||||
@@ -836,6 +836,11 @@
|
||||
<DependentUpon>T4MVC.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Models\Shared\GenerateDocumentControlModel.cs" />
|
||||
<Compile Include="Views\Device\DeviceParts\_Flags.generated.cs">
|
||||
<DependentUpon>_Flags.cshtml</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="Views\Device\ImportHeaders.generated.cs">
|
||||
<DependentUpon>ImportHeaders.cshtml</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -1936,6 +1941,10 @@
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>AddOffline.generated.cs</LastGenOutput>
|
||||
</None>
|
||||
<Content Include="Views\Device\DeviceParts\_Flags.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>_Flags.generated.cs</LastGenOutput>
|
||||
</Content>
|
||||
<None Include="Views\Device\ImportHeaders.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>ImportHeaders.generated.cs</LastGenOutput>
|
||||
|
||||
@@ -218,6 +218,7 @@ namespace Disco.Web.Controllers
|
||||
public readonly string _AssignmentHistory = "_AssignmentHistory";
|
||||
public readonly string _Certificates = "_Certificates";
|
||||
public readonly string _Details = "_Details";
|
||||
public readonly string _Flags = "_Flags";
|
||||
public readonly string _Jobs = "_Jobs";
|
||||
public readonly string _Resources = "_Resources";
|
||||
public readonly string _Subject = "_Subject";
|
||||
@@ -225,6 +226,7 @@ namespace Disco.Web.Controllers
|
||||
public readonly string _AssignmentHistory = "~/Views/Device/DeviceParts/_AssignmentHistory.cshtml";
|
||||
public readonly string _Certificates = "~/Views/Device/DeviceParts/_Certificates.cshtml";
|
||||
public readonly string _Details = "~/Views/Device/DeviceParts/_Details.cshtml";
|
||||
public readonly string _Flags = "~/Views/Device/DeviceParts/_Flags.cshtml";
|
||||
public readonly string _Jobs = "~/Views/Device/DeviceParts/_Jobs.cshtml";
|
||||
public readonly string _Resources = "~/Views/Device/DeviceParts/_Resources.cshtml";
|
||||
public readonly string _Subject = "~/Views/Device/DeviceParts/_Subject.cshtml";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Disco.Models.Services.Documents;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Services.Documents;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Models.UI.Device;
|
||||
using Disco.Services.Plugins;
|
||||
@@ -13,20 +14,20 @@ namespace Disco.Web.Models.Device
|
||||
{
|
||||
public Disco.Models.Repository.Device Device { get; set; }
|
||||
|
||||
public List<Disco.Models.Repository.DeviceProfile> DeviceProfiles { get; set; }
|
||||
public List<DeviceProfile> DeviceProfiles { get; set; }
|
||||
public HashSet<int> DecommissionedDeviceProfileIds { get; set; }
|
||||
public Disco.Models.BI.Config.OrganisationAddress DeviceProfileDefaultOrganisationAddress { get; set; }
|
||||
public List<PluginFeatureManifest> DeviceProfileCertificateProviders { get; set; }
|
||||
public List<PluginFeatureManifest> DeviceProfileWirelessProfileProviders { get; set; }
|
||||
|
||||
public List<Disco.Models.Repository.DeviceBatch> DeviceBatches { get; set; }
|
||||
public List<DeviceBatch> DeviceBatches { get; set; }
|
||||
public HashSet<int> DecommissionedDeviceBatchIds { get; set; }
|
||||
public JobTableModel Jobs { get; set; }
|
||||
public List<Disco.Models.Repository.DeviceCertificate> Certificates { get; set; }
|
||||
public List<DeviceCertificate> Certificates { get; set; }
|
||||
|
||||
public string OrganisationUnit { get; set; }
|
||||
|
||||
public List<Disco.Models.Repository.DocumentTemplate> DocumentTemplates { get; set; }
|
||||
public List<DocumentTemplate> DocumentTemplates { get; set; }
|
||||
public List<DocumentTemplatePackage> DocumentTemplatePackages { get; set; }
|
||||
public GenerateDocumentControlModel GenerateDocumentControlModel => new GenerateDocumentControlModel()
|
||||
{
|
||||
@@ -36,6 +37,8 @@ namespace Disco.Web.Models.Device
|
||||
HandlersPresent = Plugins.GetPluginFeatures(typeof(DocumentHandlerProviderFeature)).Any(),
|
||||
};
|
||||
|
||||
public List<DeviceFlag> AvailableDeviceFlags { get; set; }
|
||||
|
||||
public Dictionary<string, string> AssignedUserDetails { get; set; }
|
||||
public bool HasAssignedUserPhoto { get; set; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
@model Disco.Web.Models.Device.ShowModel
|
||||
@using Disco.Services.Devices.DeviceFlags;
|
||||
@{
|
||||
Authorization.Require(Claims.Device.ShowFlagAssignments);
|
||||
|
||||
var hasRemove = Authorization.Has(Claims.Device.Actions.RemoveFlags);
|
||||
var hasEdit = Authorization.Has(Claims.Device.Actions.EditFlags);
|
||||
|
||||
var hasDeviceFlagShow = Authorization.Has(Claims.Config.DeviceFlag.Show);
|
||||
var activeAssignmentCount = Model.Device.DeviceFlagAssignments == null ? 0 : Model.Device.DeviceFlagAssignments.Count(a => !a.RemovedDate.HasValue);
|
||||
|
||||
var flagAssignments = Model.Device.DeviceFlagAssignments.Select(a => Tuple.Create(a, DeviceFlagService.GetDeviceFlag(a.DeviceFlagId))).ToList();
|
||||
}
|
||||
<div id="DeviceDetailTab-Flags" class="DevicePart">
|
||||
@if (flagAssignments.Count > 0)
|
||||
{
|
||||
<table id="deviceFlags">
|
||||
<tr>
|
||||
<th class="name">Name</th>
|
||||
<th class="added">Added</th>
|
||||
<th class="sla">Comments</th>
|
||||
<th class="removed">Removed</th>
|
||||
</tr>
|
||||
@foreach (var fa in flagAssignments.OrderByDescending(a => a.Item1.AddedDate))
|
||||
{
|
||||
<tr data-deviceflagassignmentid="@fa.Item1.Id" data-flagassignmentaddeddate="@(fa.Item1.AddedDate.ToString("s"))" class="@(!fa.Item1.RemovedDate.HasValue ? "added" : "removed")">
|
||||
<td class="name">
|
||||
<i class="fa fa-@(fa.Item2.Icon) fa-fw fa-lg d-@(fa.Item2.IconColour)"></i>
|
||||
@if (hasDeviceFlagShow)
|
||||
{
|
||||
@Html.ActionLink(fa.Item2.Name, MVC.Config.DeviceFlag.Index(fa.Item2.Id))
|
||||
}
|
||||
else
|
||||
{
|
||||
@fa.Item2.Name
|
||||
}
|
||||
</td>
|
||||
<td class="added">
|
||||
@CommonHelpers.FriendlyDateAndUser(fa.Item1.AddedDate, fa.Item1.AddedUser)
|
||||
@if (fa.Item1.OnAssignmentExpressionResult != null)
|
||||
{
|
||||
<div class="expressionResult">@fa.Item1.OnAssignmentExpressionResult</div>
|
||||
}
|
||||
</td>
|
||||
<td class="comments">
|
||||
@if (hasEdit)
|
||||
{
|
||||
<div class="editable"><i class="fa fa-fw fa-edit" title="Edit Comments"></i></div>
|
||||
}
|
||||
@if (fa.Item1.Comments == null)
|
||||
{
|
||||
<div class="comments smallMessage">[no comments]</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="comments">@fa.Item1.Comments.ToHtmlComment()</div>
|
||||
<div class="commentsRaw">@fa.Item1.Comments</div>
|
||||
}
|
||||
</td>
|
||||
<td class="removed@(!fa.Item1.RemovedDate.HasValue ? " na" : null)">
|
||||
@if (fa.Item1.RemovedDate.HasValue)
|
||||
{
|
||||
@CommonHelpers.FriendlyDateAndUser(fa.Item1.RemovedDate.Value, fa.Item1.RemovedUser)
|
||||
if (fa.Item1.OnUnassignmentExpressionResult != null)
|
||||
{
|
||||
<div class="expressionResult">@fa.Item1.OnUnassignmentExpressionResult</div>
|
||||
}
|
||||
}
|
||||
else if (fa.Item1.CanRemove())
|
||||
{
|
||||
<a href="#" class="button small remove">Remove</a>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
<div id="Device_Show_Flags_Actions_Remove_Dialog" class="dialog" title="Remove this flag from the device?">
|
||||
@using (Html.BeginForm(MVC.API.DeviceFlagAssignment.RemoveDevice()))
|
||||
{
|
||||
<input id="Device_Show_Flags_Actions_Remove_Dialog_Id" type="hidden" name="id" value="" />
|
||||
<p>
|
||||
<i class="fa fa-exclamation-triangle fa-lg"></i> Are you sure?
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
<div id="Device_Show_Flags_Actions_EditComments_Dialog" class="dialog" title="Edit the Comments">
|
||||
@using (Html.BeginForm(MVC.API.DeviceFlagAssignment.UpdateComments()))
|
||||
{
|
||||
<input id="Device_Show_Flags_Actions_EditComments_Dialog_Id" type="hidden" name="id" value="" />
|
||||
<input type="hidden" name="redirect" value="true" />
|
||||
<h4>Comments:</h4>
|
||||
<p>
|
||||
<textarea id="Device_Show_Flags_Actions_EditComments_Dialog_Comments" name="Comments" class="block"></textarea>
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var deviceFlags = $('#deviceFlags');
|
||||
|
||||
var dialog = null;
|
||||
var dialogEditComments = null;
|
||||
|
||||
deviceFlags.on('click', 'a.remove', function (e) {
|
||||
var $this = $(this);
|
||||
var DeviceFlagAssignmentId = $this.closest('tr').attr('data-deviceflagassignmentid');
|
||||
|
||||
if (!dialog) {
|
||||
dialog = $('#Device_Show_Flags_Actions_Remove_Dialog');
|
||||
dialog.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Remove Flag": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
$this.find('form').submit();
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#Device_Show_Flags_Actions_Remove_Dialog_Id').val(DeviceFlagAssignmentId);
|
||||
dialog.dialog('open');
|
||||
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
deviceFlags.on('click', 'td.comments i.fa-edit', function (e) {
|
||||
var $this = $(this);
|
||||
var DeviceFlagAssignmentId = $this.closest('tr').attr('data-deviceflagassignmentid');
|
||||
|
||||
if (!dialogEditComments) {
|
||||
dialogEditComments = $('#Device_Show_Flags_Actions_EditComments_Dialog');
|
||||
dialogEditComments.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
width: 320,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Save Changes": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
$this.find('form').submit();
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var $comments = $this.closest('td').find('.commentsRaw');
|
||||
if ($comments.hasClass('smallMessage')) {
|
||||
$('#Device_Show_Flags_Actions_EditComments_Dialog_Comments').val('');
|
||||
} else {
|
||||
$('#Device_Show_Flags_Actions_EditComments_Dialog_Comments').val($comments.text());
|
||||
}
|
||||
|
||||
$('#Device_Show_Flags_Actions_EditComments_Dialog_Id').val(DeviceFlagAssignmentId);
|
||||
dialogEditComments.dialog('open');
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="none">This device has no associated flags</div>
|
||||
}
|
||||
<script>
|
||||
$('#DeviceDetailTabItems').append('<li><a href="#DeviceDetailTab-Flags">Flags [@activeAssignmentCount]</a></li>');
|
||||
</script>
|
||||
</div>
|
||||
@@ -0,0 +1,690 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Views.Device.DeviceParts
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
|
||||
#line 2 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
using Disco.Services.Devices.DeviceFlags;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
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/_Flags.cshtml")]
|
||||
public partial class _Flags : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.ShowModel>
|
||||
{
|
||||
public _Flags()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 3 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
|
||||
Authorization.Require(Claims.Device.ShowFlagAssignments);
|
||||
|
||||
var hasRemove = Authorization.Has(Claims.Device.Actions.RemoveFlags);
|
||||
var hasEdit = Authorization.Has(Claims.Device.Actions.EditFlags);
|
||||
|
||||
var hasDeviceFlagShow = Authorization.Has(Claims.Config.DeviceFlag.Show);
|
||||
var activeAssignmentCount = Model.Device.DeviceFlagAssignments == null ? 0 : Model.Device.DeviceFlagAssignments.Count(a => !a.RemovedDate.HasValue);
|
||||
|
||||
var flagAssignments = Model.Device.DeviceFlagAssignments.Select(a => Tuple.Create(a, DeviceFlagService.GetDeviceFlag(a.DeviceFlagId))).ToList();
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"DeviceDetailTab-Flags\"");
|
||||
|
||||
WriteLiteral(" class=\"DevicePart\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 15 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 15 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
if (flagAssignments.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <table");
|
||||
|
||||
WriteLiteral(" id=\"deviceFlags\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(">Name</th>\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"added\"");
|
||||
|
||||
WriteLiteral(">Added</th>\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"sla\"");
|
||||
|
||||
WriteLiteral(">Comments</th>\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"removed\"");
|
||||
|
||||
WriteLiteral(">Removed</th>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 24 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 24 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
foreach (var fa in flagAssignments.OrderByDescending(a => a.Item1.AddedDate))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr");
|
||||
|
||||
WriteLiteral(" data-deviceflagassignmentid=\"");
|
||||
|
||||
|
||||
#line 26 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
Write(fa.Item1.Id);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-flagassignmentaddeddate=\"");
|
||||
|
||||
|
||||
#line 26 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
Write(fa.Item1.AddedDate.ToString("s"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1282), Tuple.Create("\"", 1345)
|
||||
|
||||
#line 26 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1290), Tuple.Create<System.Object, System.Int32>(!fa.Item1.RemovedDate.HasValue ? "added" : "removed"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1290), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1414), Tuple.Create("\"", 1481)
|
||||
, Tuple.Create(Tuple.Create("", 1422), Tuple.Create("fa", 1422), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1424), Tuple.Create("fa-", 1425), true)
|
||||
|
||||
#line 28 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1428), Tuple.Create<System.Object, System.Int32>(fa.Item2.Icon
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1428), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 1444), Tuple.Create("fa-fw", 1445), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1450), Tuple.Create("fa-lg", 1451), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1456), Tuple.Create("d-", 1457), true)
|
||||
|
||||
#line 28 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1459), Tuple.Create<System.Object, System.Int32>(fa.Item2.IconColour
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1459), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
|
||||
|
||||
#line 29 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 29 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
if (hasDeviceFlagShow)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 31 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
Write(Html.ActionLink(fa.Item2.Name, MVC.Config.DeviceFlag.Index(fa.Item2.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 31 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 35 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
Write(fa.Item2.Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 35 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"added\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 39 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
Write(CommonHelpers.FriendlyDateAndUser(fa.Item1.AddedDate, fa.Item1.AddedUser));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 40 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 40 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
if (fa.Item1.OnAssignmentExpressionResult != null)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"expressionResult\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 42 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
Write(fa.Item1.OnAssignmentExpressionResult);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
|
||||
#line 43 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"comments\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 46 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 46 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
if (hasEdit)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"editable\"");
|
||||
|
||||
WriteLiteral("><i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-fw fa-edit\"");
|
||||
|
||||
WriteLiteral(" title=\"Edit Comments\"");
|
||||
|
||||
WriteLiteral("></i></div>\r\n");
|
||||
|
||||
|
||||
#line 49 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 50 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
if (fa.Item1.Comments == null)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"comments smallMessage\"");
|
||||
|
||||
WriteLiteral(">[no comments]</div>\r\n");
|
||||
|
||||
|
||||
#line 53 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"comments\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 56 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
Write(fa.Item1.Comments.ToHtmlComment());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"commentsRaw\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 57 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
Write(fa.Item1.Comments);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
|
||||
#line 58 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n <td");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 3000), Tuple.Create("\"", 3063)
|
||||
, Tuple.Create(Tuple.Create("", 3008), Tuple.Create("removed", 3008), true)
|
||||
|
||||
#line 60 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3015), Tuple.Create<System.Object, System.Int32>(!fa.Item1.RemovedDate.HasValue ? " na" : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3015), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 61 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 61 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
if (fa.Item1.RemovedDate.HasValue)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 63 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
Write(CommonHelpers.FriendlyDateAndUser(fa.Item1.RemovedDate.Value, fa.Item1.RemovedUser));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 63 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
|
||||
if (fa.Item1.OnUnassignmentExpressionResult != null)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"expressionResult\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 66 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
Write(fa.Item1.OnUnassignmentExpressionResult);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
|
||||
#line 67 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
}
|
||||
}
|
||||
else if (fa.Item1.CanRemove())
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" class=\"button small remove\"");
|
||||
|
||||
WriteLiteral(">Remove</a>\r\n");
|
||||
|
||||
|
||||
#line 72 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 75 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </table>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"Device_Show_Flags_Actions_Remove_Dialog\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Remove this flag from the device?\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 78 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 78 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
using (Html.BeginForm(MVC.API.DeviceFlagAssignment.RemoveDevice()))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <input");
|
||||
|
||||
WriteLiteral(" id=\"Device_Show_Flags_Actions_Remove_Dialog_Id\"");
|
||||
|
||||
WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"id\"");
|
||||
|
||||
WriteLiteral(" value=\"\"");
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
WriteLiteral(" <p>\r\n <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");
|
||||
|
||||
WriteLiteral("></i> Are you sure?\r\n </p>\r\n");
|
||||
|
||||
|
||||
#line 84 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"Device_Show_Flags_Actions_EditComments_Dialog\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Edit the Comments\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 87 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 87 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
using (Html.BeginForm(MVC.API.DeviceFlagAssignment.UpdateComments()))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <input");
|
||||
|
||||
WriteLiteral(" id=\"Device_Show_Flags_Actions_EditComments_Dialog_Id\"");
|
||||
|
||||
WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"id\"");
|
||||
|
||||
WriteLiteral(" value=\"\"");
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
WriteLiteral(" <input");
|
||||
|
||||
WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"redirect\"");
|
||||
|
||||
WriteLiteral(" value=\"true\"");
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
WriteLiteral(" <h4>Comments:</h4>\r\n");
|
||||
|
||||
WriteLiteral(" <p>\r\n <textarea");
|
||||
|
||||
WriteLiteral(" id=\"Device_Show_Flags_Actions_EditComments_Dialog_Comments\"");
|
||||
|
||||
WriteLiteral(" name=\"Comments\"");
|
||||
|
||||
WriteLiteral(" class=\"block\"");
|
||||
|
||||
WriteLiteral("></textarea>\r\n </p>\r\n");
|
||||
|
||||
|
||||
#line 95 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n var deviceFlags = $(\'#deviceFlags" +
|
||||
"\');\r\n\r\n var dialog = null;\r\n var dialogEditComment" +
|
||||
"s = null;\r\n\r\n deviceFlags.on(\'click\', \'a.remove\', function (e) {\r" +
|
||||
"\n var $this = $(this);\r\n var DeviceFlagAss" +
|
||||
"ignmentId = $this.closest(\'tr\').attr(\'data-deviceflagassignmentid\');\r\n\r\n " +
|
||||
" if (!dialog) {\r\n dialog = $(\'#Device_Show_Fla" +
|
||||
"gs_Actions_Remove_Dialog\');\r\n dialog.dialog({\r\n " +
|
||||
" resizable: false,\r\n modal: true,\r\n " +
|
||||
" autoOpen: false,\r\n buttons" +
|
||||
": {\r\n \"Remove Flag\": function () {\r\n " +
|
||||
" var $this = $(this);\r\n " +
|
||||
" $this.dialog(\"disable\");\r\n $this.dialog(\"opt" +
|
||||
"ion\", \"buttons\", null);\r\n $this.find(\'form\')." +
|
||||
"submit();\r\n },\r\n C" +
|
||||
"ancel: function () {\r\n $(this).dialog(\"close\"" +
|
||||
");\r\n }\r\n }\r\n " +
|
||||
" });\r\n }\r\n\r\n $(\'#Device_Show_" +
|
||||
"Flags_Actions_Remove_Dialog_Id\').val(DeviceFlagAssignmentId);\r\n " +
|
||||
" dialog.dialog(\'open\');\r\n\r\n e.preventDefault();\r\n " +
|
||||
" return false;\r\n });\r\n\r\n deviceFlags.on(\'" +
|
||||
"click\', \'td.comments i.fa-edit\', function (e) {\r\n var $this =" +
|
||||
" $(this);\r\n var DeviceFlagAssignmentId = $this.closest(\'tr\')." +
|
||||
"attr(\'data-deviceflagassignmentid\');\r\n\r\n if (!dialogEditComme" +
|
||||
"nts) {\r\n dialogEditComments = $(\'#Device_Show_Flags_Actio" +
|
||||
"ns_EditComments_Dialog\');\r\n dialogEditComments.dialog({\r\n" +
|
||||
" resizable: false,\r\n modal" +
|
||||
": true,\r\n width: 320,\r\n au" +
|
||||
"toOpen: false,\r\n buttons: {\r\n " +
|
||||
" \"Save Changes\": function () {\r\n var $" +
|
||||
"this = $(this);\r\n $this.dialog(\"disable\");\r\n " +
|
||||
" $this.dialog(\"option\", \"buttons\", null);\r\n " +
|
||||
" $this.find(\'form\').submit();\r\n " +
|
||||
" },\r\n Cancel: function () {\r\n " +
|
||||
" $(this).dialog(\"close\");\r\n " +
|
||||
" }\r\n }\r\n });\r\n " +
|
||||
" }\r\n\r\n var $comments = $this.closest(\'td\').find(\'.c" +
|
||||
"ommentsRaw\');\r\n if ($comments.hasClass(\'smallMessage\')) {\r\n " +
|
||||
" $(\'#Device_Show_Flags_Actions_EditComments_Dialog_Comments" +
|
||||
"\').val(\'\');\r\n } else {\r\n $(\'#Device_Sh" +
|
||||
"ow_Flags_Actions_EditComments_Dialog_Comments\').val($comments.text());\r\n " +
|
||||
" }\r\n\r\n $(\'#Device_Show_Flags_Actions_EditComments_" +
|
||||
"Dialog_Id\').val(DeviceFlagAssignmentId);\r\n dialogEditComments" +
|
||||
".dialog(\'open\');\r\n e.preventDefault();\r\n r" +
|
||||
"eturn false;\r\n });\r\n });\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 174 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"none\"");
|
||||
|
||||
WriteLiteral(">This device has no associated flags</div>\r\n");
|
||||
|
||||
|
||||
#line 178 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script>\r\n $(\'#DeviceDetailTabItems\').append(\'<li><a href=\"#DeviceDeta" +
|
||||
"ilTab-Flags\">Flags [");
|
||||
|
||||
|
||||
#line 180 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
||||
Write(activeAssignmentCount);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -751,6 +751,96 @@
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@if (Model.Device.CanAddDeviceFlags() && Model.AvailableDeviceFlags != null && Model.AvailableDeviceFlags.Count > 0)
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Add Flag", MVC.API.DeviceFlagAssignment.AddDevice(), "Device_Show_Details_Actions_AddFlag_Button")
|
||||
<div id="Device_Show_Details_Actions_AddFlag_Dialog" class="dialog" title="Add Device Flag">
|
||||
@using (Html.BeginForm(MVC.API.DeviceFlagAssignment.AddDevice()))
|
||||
{
|
||||
<input id="Device_Show_Details_Actions_AddFlag_Dialog_Id" type="hidden" name="id" />
|
||||
<input id="Device_Show_Details_Actions_AddFlag_Dialog_DeviceSerialNumber" type="hidden" name="DeviceSerialNumber" value="@Model.Device.SerialNumber" />
|
||||
<div class="flagPicker">
|
||||
@foreach (var flag in Model.AvailableDeviceFlags.OrderBy(jq => jq.Name))
|
||||
{
|
||||
<div class="flag" data-flagid="@(flag.Id)">
|
||||
<i class="fa fa-@(flag.Icon) fa-fw fa-lg d-@(flag.IconColour)"></i>@flag.Name
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="details">
|
||||
<div>
|
||||
<h4>Comments</h4>
|
||||
<textarea name="Comments" id="Device_Show_Details_Actions_AddFlag_Dialog_Comments"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#Device_Show_Details_Actions_AddFlag_Button');
|
||||
var buttonDialog = null;
|
||||
var buttonLink = button.attr('href');
|
||||
|
||||
var flagPicker = null;
|
||||
var flagAddId = null;
|
||||
var flagAddComments = null;
|
||||
var details = null;
|
||||
|
||||
function flagSelected() {
|
||||
var flag = $(this);
|
||||
|
||||
flagPicker.children().removeClass('selected');
|
||||
flag.addClass('selected');
|
||||
|
||||
flagAddId.val(flag.attr('data-flagid'));
|
||||
|
||||
details.show();
|
||||
|
||||
flagAddComments.focus().select();
|
||||
}
|
||||
|
||||
button.attr('href', '#').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (!buttonDialog) {
|
||||
buttonDialog = $('#Device_Show_Details_Actions_AddFlag_Dialog');
|
||||
buttonDialog.dialog({
|
||||
width: 600,
|
||||
height: 410,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"Add Flag": function () {
|
||||
if (!!flagAddId.val()) {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
buttonDialog.find('form').submit();
|
||||
} else {
|
||||
alert('Select a Device Flag');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
flagAddId = $('#Device_Show_Details_Actions_AddFlag_Dialog_Id');
|
||||
flagAddComments = buttonDialog.find('#Device_Show_Details_Actions_AddFlag_Dialog_Comments');
|
||||
flagPicker = buttonDialog.find('.flagPicker');
|
||||
details = buttonDialog.find('.details');
|
||||
|
||||
flagPicker.on('click', 'div.flag', flagSelected);
|
||||
}
|
||||
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@if (Model.Device.CanUpdateTrustEnrol())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Trust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, true.ToString(), true), "Device_Show_Device_Actions_TrustEnrol_Button")
|
||||
|
||||
@@ -2694,7 +2694,7 @@ WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 754 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
if (Model.Device.CanUpdateTrustEnrol())
|
||||
if (Model.Device.CanAddDeviceFlags() && Model.AvailableDeviceFlags != null && Model.AvailableDeviceFlags.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
@@ -2702,7 +2702,7 @@ WriteLiteral(" ");
|
||||
#line hidden
|
||||
|
||||
#line 756 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
Write(Html.ActionLinkSmallButton("Trust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, true.ToString(), true), "Device_Show_Device_Actions_TrustEnrol_Button"));
|
||||
Write(Html.ActionLinkSmallButton("Add Flag", MVC.API.DeviceFlagAssignment.AddDevice(), "Device_Show_Details_Actions_AddFlag_Button"));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -2712,6 +2712,238 @@ WriteLiteral(" ");
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"Device_Show_Details_Actions_AddFlag_Dialog\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Add Device Flag\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 758 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 758 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
using (Html.BeginForm(MVC.API.DeviceFlagAssignment.AddDevice()))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <input");
|
||||
|
||||
WriteLiteral(" id=\"Device_Show_Details_Actions_AddFlag_Dialog_Id\"");
|
||||
|
||||
WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"id\"");
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
WriteLiteral(" <input");
|
||||
|
||||
WriteLiteral(" id=\"Device_Show_Details_Actions_AddFlag_Dialog_DeviceSerialNumber\"");
|
||||
|
||||
WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"DeviceSerialNumber\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 48128), Tuple.Create("\"", 48162)
|
||||
|
||||
#line 761 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 48136), Tuple.Create<System.Object, System.Int32>(Model.Device.SerialNumber
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 48136), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"flagPicker\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 763 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 763 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
foreach (var flag in Model.AvailableDeviceFlags.OrderBy(jq => jq.Name))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"flag\"");
|
||||
|
||||
WriteLiteral(" data-flagid=\"");
|
||||
|
||||
|
||||
#line 765 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
Write(flag.Id);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 48466), Tuple.Create("\"", 48525)
|
||||
, Tuple.Create(Tuple.Create("", 48474), Tuple.Create("fa", 48474), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 48476), Tuple.Create("fa-", 48477), true)
|
||||
|
||||
#line 766 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 48480), Tuple.Create<System.Object, System.Int32>(flag.Icon
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 48480), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 48492), Tuple.Create("fa-fw", 48493), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 48498), Tuple.Create("fa-lg", 48499), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 48504), Tuple.Create("d-", 48505), true)
|
||||
|
||||
#line 766 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 48507), Tuple.Create<System.Object, System.Int32>(flag.IconColour
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 48507), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 766 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
Write(flag.Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 768 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"details\"");
|
||||
|
||||
WriteLiteral(">\r\n <div>\r\n <h4>Comment" +
|
||||
"s</h4>\r\n <textarea");
|
||||
|
||||
WriteLiteral(" name=\"Comments\"");
|
||||
|
||||
WriteLiteral(" id=\"Device_Show_Details_Actions_AddFlag_Dialog_Comments\"");
|
||||
|
||||
WriteLiteral("></textarea>\r\n </div>\r\n </div>\r" +
|
||||
"\n");
|
||||
|
||||
|
||||
#line 776 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n var button = $(\'#" +
|
||||
"Device_Show_Details_Actions_AddFlag_Button\');\r\n var butto" +
|
||||
"nDialog = null;\r\n var buttonLink = button.attr(\'href\');\r\n" +
|
||||
"\r\n var flagPicker = null;\r\n var fl" +
|
||||
"agAddId = null;\r\n var flagAddComments = null;\r\n " +
|
||||
" var details = null;\r\n\r\n function flagSelect" +
|
||||
"ed() {\r\n var flag = $(this);\r\n\r\n " +
|
||||
" flagPicker.children().removeClass(\'selected\');\r\n " +
|
||||
" flag.addClass(\'selected\');\r\n\r\n flagAddId.val(flag." +
|
||||
"attr(\'data-flagid\'));\r\n\r\n details.show();\r\n\r\n " +
|
||||
" flagAddComments.focus().select();\r\n }" +
|
||||
"\r\n\r\n button.attr(\'href\', \'#\').click(function (e) {\r\n " +
|
||||
" e.preventDefault();\r\n\r\n if (!b" +
|
||||
"uttonDialog) {\r\n buttonDialog = $(\'#Device_Show_D" +
|
||||
"etails_Actions_AddFlag_Dialog\');\r\n buttonDialog.d" +
|
||||
"ialog({\r\n width: 600,\r\n " +
|
||||
" height: 410,\r\n resizable: false" +
|
||||
",\r\n modal: true,\r\n " +
|
||||
" autoOpen: false,\r\n buttons: {\r\n " +
|
||||
" Cancel: function () {\r\n " +
|
||||
" $(this).dialog(\"close\");\r\n " +
|
||||
" },\r\n \"Add Flag\": function () {\r\n " +
|
||||
" if (!!flagAddId.val()) {\r\n " +
|
||||
" var $this = $(this);\r\n " +
|
||||
" $this.dialog(\"disable\");\r\n " +
|
||||
" $this.dialog(\"option\", \"buttons\", null);\r\n " +
|
||||
" buttonDialog.find(\'form\').submit();\r\n " +
|
||||
" } else {\r\n " +
|
||||
" alert(\'Select a Device Flag\');\r\n " +
|
||||
" }\r\n }\r\n " +
|
||||
" }\r\n });\r\n\r\n " +
|
||||
" flagAddId = $(\'#Device_Show_Details_Actions_AddFlag_Dialog_Id\');\r\n " +
|
||||
" flagAddComments = buttonDialog.find(\'#Device_Show_Details_Ac" +
|
||||
"tions_AddFlag_Dialog_Comments\');\r\n flagPicker = b" +
|
||||
"uttonDialog.find(\'.flagPicker\');\r\n details = butt" +
|
||||
"onDialog.find(\'.details\');\r\n\r\n flagPicker.on(\'cli" +
|
||||
"ck\', \'div.flag\', flagSelected);\r\n }\r\n\r\n " +
|
||||
" buttonDialog.dialog(\'open\');\r\n return f" +
|
||||
"alse;\r\n });\r\n });\r\n </s" +
|
||||
"cript>\r\n");
|
||||
|
||||
|
||||
#line 843 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 844 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
if (Model.Device.CanUpdateTrustEnrol())
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 846 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
Write(Html.ActionLinkSmallButton("Trust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, true.ToString(), true), "Device_Show_Device_Actions_TrustEnrol_Button"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 846 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
@@ -2749,7 +2981,7 @@ WriteLiteral("></i>This action will allow a device <em>claiming</em> to have the
|
||||
"\'");
|
||||
|
||||
|
||||
#line 766 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 856 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
Write(Model.Device.SerialNumber);
|
||||
|
||||
|
||||
@@ -2791,7 +3023,7 @@ WriteLiteral(">\r\n $(function () {\r\n
|
||||
" });\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 806 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 896 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -2800,7 +3032,7 @@ WriteLiteral(">\r\n $(function () {\r\n
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 807 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 897 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
if (Model.Device.CanUpdateUntrustEnrol())
|
||||
{
|
||||
|
||||
@@ -2808,14 +3040,14 @@ WriteLiteral(" ");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 809 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 899 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
Write(Html.ActionLinkSmallButton("Untrust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, false.ToString(), true), "Device_Show_Device_Actions_UntrustEnrol_Button"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 809 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 899 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -2886,7 +3118,7 @@ WriteLiteral(@">
|
||||
");
|
||||
|
||||
|
||||
#line 849 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 939 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -2895,7 +3127,7 @@ WriteLiteral(@">
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 850 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 940 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
if (Model.Device.CanDecommission())
|
||||
{
|
||||
|
||||
@@ -2903,14 +3135,14 @@ WriteLiteral(" ");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 852 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 942 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
Write(Html.ActionLinkSmallButton("Decommission", MVC.API.Device.Decommission(), "Device_Show_Device_Actions_Decommission_Button"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 852 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 942 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -2942,13 +3174,13 @@ WriteLiteral(" class=\"none\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 859 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 949 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 859 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 949 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)).Cast<DecommissionReasons>().OrderBy(r => r.ToString()))
|
||||
{
|
||||
|
||||
@@ -2959,34 +3191,34 @@ WriteLiteral(" <li>\r\n
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 53845), Tuple.Create("\"", 53923)
|
||||
, Tuple.Create(Tuple.Create("", 53850), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 53850), true)
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 58686), Tuple.Create("\"", 58764)
|
||||
, Tuple.Create(Tuple.Create("", 58691), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 58691), true)
|
||||
|
||||
#line 862 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 53897), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||
#line 952 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 58738), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 53897), false)
|
||||
, 58738), false)
|
||||
);
|
||||
|
||||
WriteLiteral("\r\n name=\"Device_Show_Device_Actions_Dec" +
|
||||
"ommission_Reason\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 54022), Tuple.Create("\"", 54056)
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 58863), Tuple.Create("\"", 58897)
|
||||
|
||||
#line 863 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 54030), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||
#line 953 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 58871), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 54030), false)
|
||||
, 58871), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 863 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 953 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
Write((decommissionReason == DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty);
|
||||
|
||||
|
||||
@@ -2994,21 +3226,21 @@ WriteLiteral(" ");
|
||||
#line hidden
|
||||
WriteLiteral(" />\r\n <label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 54200), Tuple.Create("\"", 54279)
|
||||
, Tuple.Create(Tuple.Create("", 54206), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 54206), true)
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 59041), Tuple.Create("\"", 59120)
|
||||
, Tuple.Create(Tuple.Create("", 59047), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 59047), true)
|
||||
|
||||
#line 864 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 54253), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||
#line 954 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 59094), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 54253), false)
|
||||
, 59094), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 864 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 954 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
Write(decommissionReason.ReasonMessage());
|
||||
|
||||
|
||||
@@ -3017,7 +3249,7 @@ WriteLiteral(">");
|
||||
WriteLiteral("</label>\r\n </li>\r\n");
|
||||
|
||||
|
||||
#line 866 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 956 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -3035,7 +3267,7 @@ WriteLiteral(">\r\n $(function () {\r\n
|
||||
"uttonDialog = null;\r\n var deviceSerialNumber = \'");
|
||||
|
||||
|
||||
#line 874 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 964 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
Write(Model.Device.SerialNumber);
|
||||
|
||||
|
||||
@@ -3068,7 +3300,7 @@ WriteLiteral("\';\r\n\r\n button.click(function () {\r\n\
|
||||
" });\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 910 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 1000 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -3077,7 +3309,7 @@ WriteLiteral("\';\r\n\r\n button.click(function () {\r\n\
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 911 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 1001 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
if (Model.Device.CanRecommission())
|
||||
{
|
||||
|
||||
@@ -3085,14 +3317,14 @@ WriteLiteral(" ");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 913 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 1003 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
Write(Html.ActionLinkSmallButton("Recommission", MVC.API.Device.Recommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Recommission_Button"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 913 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 1003 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -3146,7 +3378,7 @@ WriteLiteral(@">
|
||||
");
|
||||
|
||||
|
||||
#line 948 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 1038 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -3155,7 +3387,7 @@ WriteLiteral(@">
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 949 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 1039 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
if (Model.Device.CanDelete())
|
||||
{
|
||||
|
||||
@@ -3163,14 +3395,14 @@ WriteLiteral(" ");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 951 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 1041 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
Write(Html.ActionLinkSmallButton("Delete Device", MVC.API.Device.Delete(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Delete_Button"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 951 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 1041 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -3230,7 +3462,7 @@ WriteLiteral(@">
|
||||
");
|
||||
|
||||
|
||||
#line 989 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
#line 1079 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -63,6 +63,10 @@
|
||||
{
|
||||
@Html.Partial(MVC.Device.Views.DeviceParts._Resources, Model)
|
||||
}
|
||||
@if (Authorization.Has(Claims.Device.ShowFlagAssignments))
|
||||
{
|
||||
@Html.Partial(MVC.Device.Views.DeviceParts._Flags, Model)
|
||||
}
|
||||
@if (Authorization.Has(Claims.Device.ShowCertificates))
|
||||
{
|
||||
@Html.Partial(MVC.Device.Views.DeviceParts._Certificates, Model)
|
||||
|
||||
@@ -241,7 +241,7 @@ WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 66 "..\..\Views\Device\Show.cshtml"
|
||||
if (Authorization.Has(Claims.Device.ShowCertificates))
|
||||
if (Authorization.Has(Claims.Device.ShowFlagAssignments))
|
||||
{
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ WriteLiteral(" ");
|
||||
#line hidden
|
||||
|
||||
#line 68 "..\..\Views\Device\Show.cshtml"
|
||||
Write(Html.Partial(MVC.Device.Views.DeviceParts._Certificates, Model));
|
||||
Write(Html.Partial(MVC.Device.Views.DeviceParts._Flags, Model));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -260,6 +260,31 @@ WriteLiteral(" ");
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 70 "..\..\Views\Device\Show.cshtml"
|
||||
if (Authorization.Has(Claims.Device.ShowCertificates))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 72 "..\..\Views\Device\Show.cshtml"
|
||||
Write(Html.Partial(MVC.Device.Views.DeviceParts._Certificates, Model));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 72 "..\..\Views\Device\Show.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n</div>\r\n");
|
||||
|
||||
Reference in New Issue
Block a user