821 lines
26 KiB
C#
821 lines
26 KiB
C#
#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"
|
|
|
|
var flagAssignments = Model.Device.DeviceFlagAssignments.Select(a => Tuple.Create(a, DeviceFlagService.GetDeviceFlag(a.DeviceFlagId))).Where(a => a.Item2.permission.CanShow()).ToList();
|
|
var activeAssignmentCount = flagAssignments.Count(a => !a.Item1.RemovedDate.HasValue);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n<div");
|
|
|
|
WriteLiteral(" id=\"DeviceDetailTab-Flags\"");
|
|
|
|
WriteLiteral(" class=\"DevicePart\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 8 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 8 "..\..\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(">Detail</th>\r\n <th");
|
|
|
|
WriteLiteral(" class=\"removed\"");
|
|
|
|
WriteLiteral(">Removed</th>\r\n </tr>\r\n");
|
|
|
|
|
|
#line 17 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 17 "..\..\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 19 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(fa.Item1.Id);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(" data-flagassignmentaddeddate=\"");
|
|
|
|
|
|
#line 19 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(fa.Item1.AddedDate.ToString("s"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 965), Tuple.Create("\"", 1028)
|
|
|
|
#line 19 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 973), Tuple.Create<System.Object, System.Int32>(!fa.Item1.RemovedDate.HasValue ? "added" : "removed"
|
|
|
|
#line default
|
|
#line hidden
|
|
, 973), false)
|
|
);
|
|
|
|
WriteLiteral(" data-canremove=\"");
|
|
|
|
|
|
#line 19 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(fa.Item1.CanRemove());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(" data-removeon=\"");
|
|
|
|
|
|
#line 19 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(fa.Item1.RemoveDate.HasValue ? fa.Item1.RemoveDate.Value.ToString("yyyy-MM-dd") : null);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(">\r\n <td");
|
|
|
|
WriteLiteral(" class=\"name\"");
|
|
|
|
WriteLiteral(">\r\n <i");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 1242), Tuple.Create("\"", 1319)
|
|
, Tuple.Create(Tuple.Create("", 1250), Tuple.Create("fa", 1250), true)
|
|
, Tuple.Create(Tuple.Create(" ", 1252), Tuple.Create("fa-", 1253), true)
|
|
|
|
#line 21 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 1256), Tuple.Create<System.Object, System.Int32>(fa.Item2.flag.Icon
|
|
|
|
#line default
|
|
#line hidden
|
|
, 1256), false)
|
|
, Tuple.Create(Tuple.Create(" ", 1277), Tuple.Create("fa-fw", 1278), true)
|
|
, Tuple.Create(Tuple.Create(" ", 1283), Tuple.Create("fa-lg", 1284), true)
|
|
, Tuple.Create(Tuple.Create(" ", 1289), Tuple.Create("d-", 1290), true)
|
|
|
|
#line 21 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 1292), Tuple.Create<System.Object, System.Int32>(fa.Item2.flag.IconColour
|
|
|
|
#line default
|
|
#line hidden
|
|
, 1292), false)
|
|
);
|
|
|
|
WriteLiteral("></i>\r\n");
|
|
|
|
|
|
#line 22 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 22 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
if (Authorization.Has(Claims.Config.DeviceFlag.Show))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 24 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(Html.ActionLink(fa.Item2.flag.Name, MVC.Config.DeviceFlag.Index(fa.Item2.flag.Id)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 24 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 28 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(fa.Item2.flag.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 28 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n <td");
|
|
|
|
WriteLiteral(" class=\"added\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 32 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(CommonHelpers.FriendlyDateAndUser(fa.Item1.AddedDate, fa.Item1.AddedUser));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n");
|
|
|
|
|
|
#line 33 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 33 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
if (fa.Item1.OnAssignmentExpressionResult != null)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" class=\"expressionResult\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 35 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(fa.Item1.OnAssignmentExpressionResult);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</div>\r\n");
|
|
|
|
|
|
#line 36 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n <td");
|
|
|
|
WriteLiteral(" class=\"comments\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 39 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 39 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
if (fa.Item2.permission.CanEdit())
|
|
{
|
|
|
|
|
|
#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 42 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 43 "..\..\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 46 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" class=\"comments\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 49 "..\..\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 50 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(fa.Item1.Comments);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</div>\r\n");
|
|
|
|
|
|
#line 51 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 52 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
if (!fa.Item1.RemovedDate.HasValue && fa.Item1.RemoveDate.HasValue)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" class=\"removeDate\"");
|
|
|
|
WriteLiteral(" data-date=\"");
|
|
|
|
|
|
#line 54 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(fa.Item1.RemoveDate.Value.ToString("yyyy-MM-dd"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(">Removing ");
|
|
|
|
|
|
#line 54 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(fa.Item1.RemoveDate.Value));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</div>\r\n");
|
|
|
|
|
|
#line 55 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n <td");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 3239), Tuple.Create("\"", 3302)
|
|
, Tuple.Create(Tuple.Create("", 3247), Tuple.Create("removed", 3247), true)
|
|
|
|
#line 57 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 3254), Tuple.Create<System.Object, System.Int32>(!fa.Item1.RemovedDate.HasValue ? " na" : null
|
|
|
|
#line default
|
|
#line hidden
|
|
, 3254), false)
|
|
);
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 58 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 58 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
if (fa.Item1.RemovedDate.HasValue)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 60 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(CommonHelpers.FriendlyDateAndUser(fa.Item1.RemovedDate.Value, fa.Item1.RemovedUser));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 60 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
|
|
if (fa.Item1.RemoveDate.HasValue)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <em>(scheduled)</em>\r\n");
|
|
|
|
|
|
#line 64 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
}
|
|
if (fa.Item1.OnUnassignmentExpressionResult != null)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" class=\"expressionResult\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 67 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(fa.Item1.OnUnassignmentExpressionResult);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</div>\r\n");
|
|
|
|
|
|
#line 68 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
}
|
|
}
|
|
else if (fa.Item1.CanRemove())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <button");
|
|
|
|
WriteLiteral(" type=\"button\"");
|
|
|
|
WriteLiteral(" class=\"button small remove\"");
|
|
|
|
WriteLiteral(">Remove</button>\r\n");
|
|
|
|
|
|
#line 73 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n");
|
|
|
|
|
|
#line 76 "..\..\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 79 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 79 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
using (Html.BeginForm(MVC.API.DeviceFlagAssignment.RemoveDevice()))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 81 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(Html.AntiForgeryToken());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 81 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
|
|
|
|
|
|
#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 86 "..\..\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 Details\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 89 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 89 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
using (Html.BeginForm(MVC.API.DeviceFlagAssignment.Edit()))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 91 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
Write(Html.AntiForgeryToken());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 91 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
|
|
|
|
|
|
#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");
|
|
|
|
WriteLiteral(" <div>\r\n <h4>Remove On</h4>\r\n " +
|
|
" <input");
|
|
|
|
WriteLiteral(" name=\"RemoveDate\"");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Flags_Actions_EditComments_Dialog_RemoveDate\"");
|
|
|
|
WriteLiteral(" type=\"date\"");
|
|
|
|
WriteAttribute("min", Tuple.Create(" min=\"", 5593), Tuple.Create("\"", 5650)
|
|
|
|
#line 100 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 5599), Tuple.Create<System.Object, System.Int32>(DateTime.Today.AddDays(1).ToString("yyyy-MM-dd")
|
|
|
|
#line default
|
|
#line hidden
|
|
, 5599), false)
|
|
);
|
|
|
|
WriteLiteral(" />\r\n <span>12:00 AM</span>\r\n </div>\r\n");
|
|
|
|
|
|
#line 103 "..\..\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 const deviceFlags = $(\'#deviceFla" +
|
|
"gs\');\r\n\r\n let dialog = null;\r\n let dialogEditComme" +
|
|
"nts = null;\r\n\r\n deviceFlags.on(\'click\', \'button.remove\', function" +
|
|
" (e) {\r\n const $this = $(this);\r\n const De" +
|
|
"viceFlagAssignmentId = $this.closest(\'tr\').attr(\'data-deviceflagassignmentid\');\r" +
|
|
"\n\r\n if (!dialog) {\r\n dialog = $(\'#Devi" +
|
|
"ce_Show_Flags_Actions_Remove_Dialog\');\r\n dialog.dialog({\r" +
|
|
"\n resizable: false,\r\n moda" +
|
|
"l: true,\r\n autoOpen: false,\r\n " +
|
|
" buttons: {\r\n \"Remove Flag\": function () {\r\n " +
|
|
" const $this = $(this);\r\n " +
|
|
" $this.dialog(\"disable\");\r\n $thi" +
|
|
"s.dialog(\"option\", \"buttons\", null);\r\n $this." +
|
|
"find(\'form\').submit();\r\n },\r\n " +
|
|
" Cancel: function () {\r\n $(this).d" +
|
|
"ialog(\"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 dev" +
|
|
"iceFlags.on(\'click\', \'td.comments i.fa-edit\', function (e) {\r\n " +
|
|
" const $this = $(this);\r\n const $row = $this.closest(\'tr\');\r" +
|
|
"\n const DeviceFlagAssignmentId = $row.attr(\'data-deviceflagas" +
|
|
"signmentid\');\r\n const canRemove = $row.attr(\'data-canremove\')" +
|
|
" === \'True\';\r\n const removeOn = $row.attr(\'data-removeon\');\r\n" +
|
|
"\r\n if (!dialogEditComments) {\r\n dialog" +
|
|
"EditComments = $(\'#Device_Show_Flags_Actions_EditComments_Dialog\');\r\n " +
|
|
" dialogEditComments.dialog({\r\n resizable:" +
|
|
" false,\r\n modal: true,\r\n w" +
|
|
"idth: 320,\r\n autoOpen: false,\r\n " +
|
|
" buttons: {\r\n \"Save Changes\": function () {\r" +
|
|
"\n const $this = $(this);\r\n " +
|
|
" $this.dialog(\"disable\");\r\n $" +
|
|
"this.dialog(\"option\", \"buttons\", null);\r\n $th" +
|
|
"is.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 " +
|
|
"const $comments = $this.closest(\'td\').find(\'.commentsRaw\');\r\n " +
|
|
" if ($comments.hasClass(\'smallMessage\')) {\r\n $(\'#Device_S" +
|
|
"how_Flags_Actions_EditComments_Dialog_Comments\').val(\'\');\r\n }" +
|
|
" else {\r\n $(\'#Device_Show_Flags_Actions_EditComments_Dial" +
|
|
"og_Comments\').val($comments.text());\r\n }\r\n\r\n " +
|
|
" const removeOnInput = $(\'#Device_Show_Flags_Actions_EditComments_Dialog_Remov" +
|
|
"eDate\');\r\n if (canRemove) {\r\n removeOn" +
|
|
"Input.prop(\'disabled\', false);\r\n if (removeOn) {\r\n " +
|
|
" removeOnInput.val(removeOn);\r\n } els" +
|
|
"e {\r\n removeOnInput.val(\'\');\r\n " +
|
|
" }\r\n removeOnInput.closest(\'div\').css(\'display\', \'block\')" +
|
|
";\r\n } else {\r\n removeOnInput.prop(\'dis" +
|
|
"abled\', true);\r\n removeOnInput.val(\'\');\r\n " +
|
|
" removeOnInput.closest(\'div\').css(\'display\', \'none\');\r\n " +
|
|
" }\r\n\r\n $(\'#Device_Show_Flags_Actions_EditComments_Dialog_Id\'" +
|
|
").val(DeviceFlagAssignmentId);\r\n dialogEditComments.dialog(\'o" +
|
|
"pen\');\r\n e.preventDefault();\r\n return fals" +
|
|
"e;\r\n });\r\n });\r\n </script>\r\n");
|
|
|
|
|
|
#line 200 "..\..\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 204 "..\..\Views\Device\DeviceParts\_Flags.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <script>\r\n $(\'#DeviceDetailTabItems\').append(\'<li><a href=\"#DeviceDeta" +
|
|
"ilTab-Flags\">Flags [");
|
|
|
|
|
|
#line 206 "..\..\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
|