#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.Areas.Config.Views.DeviceProfile
{
    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 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
    using Disco.Services.Devices.ManagedGroups;
    
    #line default
    #line hidden
    using Disco.Services.Web;
    using Disco.Web;
    
    #line 3 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
    using Disco.Web.Areas.Config.Models.Shared;
    
    #line default
    #line hidden
    using Disco.Web.Extensions;
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
    [System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceProfile/Show.cshtml")]
    public partial class Show : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.ShowModel>
    {
        public Show()
        {
        }
        public override void Execute()
        {
            
            #line 4 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
  
    Authorization.Require(Claims.Config.DeviceProfile.Show);

    ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), Model.DeviceProfile.ToString());

    var canConfig = Authorization.Has(Claims.Config.DeviceProfile.Configure);
    var canConfigExpression = Authorization.Has(Claims.Config.DeviceProfile.ConfigureComputerNameTemplate);
    var canDelete = (Authorization.Has(Claims.Config.DeviceProfile.Delete) && Model.CanDelete);
    var canViewPlugins = Authorization.Has(Claims.Config.Plugin.Install);

    var hideAdvanced =
        Model.DeviceProfile.AssignedUsersLinkedGroup == null &&
        Model.DeviceProfile.DevicesLinkedGroup == null;

    if (canConfig)
    {
        Html.BundleDeferred("~/Style/Fancytree");
        Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Fancytree");
        Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
    }

            
            #line default
            #line hidden
WriteLiteral("\r\n<div");

WriteLiteral(" id=\"configurationDeviceProfileShow\"");

WriteAttribute("class", Tuple.Create(" class=\"", 1194), Tuple.Create("\"", 1253)
, Tuple.Create(Tuple.Create("", 1202), Tuple.Create("form", 1202), true)
            
            #line 25 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
, Tuple.Create(Tuple.Create("", 1206), Tuple.Create<System.Object, System.Int32>(hideAdvanced ? " Config_HideAdvanced" : null
            
            #line default
            #line hidden
, 1206), false)
);

WriteLiteral(" style=\"width: 640px\"");

WriteLiteral(">\r\n    <table>\r\n        <tr>\r\n            <th");

WriteLiteral(" style=\"width: 170px;\"");

WriteLiteral(">\r\n                Id:\r\n            </th>\r\n            <td>\r\n");

WriteLiteral("                ");

            
            #line 32 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
           Write(Html.DisplayFor(model => model.DeviceProfile.Id));

            
            #line default
            #line hidden
WriteLiteral("\r\n            </td>\r\n        </tr>\r\n        <tr>\r\n            <th>\r\n             " +
"   Name:\r\n            </th>\r\n            <td>\r\n");

            
            #line 40 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 40 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canConfig)
                {
                    
            
            #line default
            #line hidden
            
            #line 42 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(Html.TextBoxFor(model => model.DeviceProfile.Name));

            
            #line default
            #line hidden
            
            #line 42 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                       
                    
            
            #line default
            #line hidden
            
            #line 43 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 43 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                           
                    
            
            #line default
            #line hidden
            
            #line 44 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 44 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                             

            
            #line default
            #line hidden
WriteLiteral("                    <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(">\r\n                        $(function () {\r\n                            document." +
"DiscoFunctions.PropertyChangeHelper(\r\n                                $(\'#Device" +
"Profile_Name\'),\r\n                                \'Name\',\r\n                      " +
"          \'");

            
            #line 50 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                            Write(Url.Action(MVC.API.DeviceProfile.UpdateName(Model.DeviceProfile.Id)));

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                \'ProfileName\'\r\n                            );" +
"\r\n                        });\r\n                    </script>\r\n");

            
            #line 55 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }
                else
                {
                    
            
            #line default
            #line hidden
            
            #line 58 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(Model.DeviceProfile.Name);

            
            #line default
            #line hidden
            
            #line 58 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                             
                }

            
            #line default
            #line hidden
WriteLiteral("            </td>\r\n        </tr>\r\n        <tr>\r\n            <th>\r\n               " +
" Short Name:\r\n            </th>\r\n            <td>\r\n");

            
            #line 67 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 67 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canConfig)
                {
                    
            
            #line default
            #line hidden
            
            #line 69 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(Html.TextBoxFor(model => model.DeviceProfile.ShortName));

            
            #line default
            #line hidden
            
            #line 69 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                            
                    
            
            #line default
            #line hidden
            
            #line 70 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 70 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                           
                    
            
            #line default
            #line hidden
            
            #line 71 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 71 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                             

            
            #line default
            #line hidden
WriteLiteral("                    <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                        $(function () {
                            document.DiscoFunctions.PropertyChangeHelper(
                                $('#DeviceProfile_ShortName'),
                                'Short Name',
                                '");

            
            #line 77 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                            Write(Url.Action(MVC.API.DeviceProfile.UpdateShortName(Model.DeviceProfile.Id)));

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                \'ShortName\'\r\n                            );\r\n" +
"                        });\r\n                    </script>\r\n");

            
            #line 82 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }
                else
                {
                    
            
            #line default
            #line hidden
            
            #line 85 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(Model.DeviceProfile.ShortName);

            
            #line default
            #line hidden
            
            #line 85 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                  
                }

            
            #line default
            #line hidden
WriteLiteral("            </td>\r\n        </tr>\r\n        <tr>\r\n            <th>\r\n               " +
" Description:\r\n            </th>\r\n            <td>\r\n");

            
            #line 94 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 94 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canConfig)
                {
                    
            
            #line default
            #line hidden
            
            #line 96 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(Html.EditorFor(model => model.DeviceProfile.Description));

            
            #line default
            #line hidden
            
            #line 96 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                             
                    
            
            #line default
            #line hidden
            
            #line 97 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 97 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                           
                    
            
            #line default
            #line hidden
            
            #line 98 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 98 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                             

            
            #line default
            #line hidden
WriteLiteral("                    <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                        $(function () {
                            document.DiscoFunctions.PropertyChangeHelper(
                                $('#DeviceProfile_Description'),
                                'Description',
                                '");

            
            #line 104 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                            Write(Url.Action(MVC.API.DeviceProfile.UpdateDescription(Model.DeviceProfile.Id)));

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                \'Description\'\r\n                            );" +
"\r\n                        });\r\n                    </script>\r\n");

            
            #line 109 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }
                else
                {
                    
            
            #line default
            #line hidden
            
            #line 112 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(Model.DeviceProfile.Description);

            
            #line default
            #line hidden
            
            #line 112 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                    
                }

            
            #line default
            #line hidden
WriteLiteral("            </td>\r\n        </tr>\r\n        <tr>\r\n            <th>Members</th>\r\n   " +
"         <td>\r\n                <div><strong>");

            
            #line 119 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                        Write(Model.DeviceCount.ToString("n0"));

            
            #line default
            #line hidden
WriteLiteral("</strong> ");

            
            #line 119 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                    Write(Model.DeviceCount == 1 ? "devices is a member" : "devices are members");

            
            #line default
            #line hidden
WriteLiteral(" of this profile.</div>\r\n");

            
            #line 120 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 120 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (Model.DeviceDecommissionedCount > 0)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">");

            
            #line 122 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                         Write(Model.DeviceDecommissionedCount.ToString("n0"));

            
            #line default
            #line hidden
WriteLiteral(" ");

            
            #line 122 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                          Write(Model.DeviceDecommissionedCount == 1 ? "device is" : "devices are");

            
            #line default
            #line hidden
WriteLiteral(" decommissioned.</div>\r\n");

            
            #line 123 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </td>\r\n        </tr>\r\n        <tr>\r\n            <th>\r\n               " +
" Distribution Type:\r\n            </th>\r\n            <td>\r\n");

            
            #line 131 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 131 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canConfig)
                {
                    
            
            #line default
            #line hidden
            
            #line 133 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(Html.DropDownList("DeviceProfile_DistributionType", Model.DeviceProfileDistributionTypes));

            
            #line default
            #line hidden
            
            #line 133 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                                              
                    
            
            #line default
            #line hidden
            
            #line 134 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 134 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                             

            
            #line default
            #line hidden
WriteLiteral("                    <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                        $(function () {
                            document.DiscoFunctions.PropertyChangeHelper(
                                $('#DeviceProfile_DistributionType'),
                                null,
                                '");

            
            #line 140 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                            Write(Url.Action(MVC.API.DeviceProfile.UpdateDistributionType(Model.DeviceProfile.Id)));

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                \'DistributionType\'\r\n                         " +
"   );\r\n                        });\r\n                    </script>\r\n");

            
            #line 145 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }
                else
                {
                    
            
            #line default
            #line hidden
            
            #line 148 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(Model.DeviceProfile.DistributionType.ToString());

            
            #line default
            #line hidden
            
            #line 148 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                    
                }

            
            #line default
            #line hidden
WriteLiteral("                <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                    <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                        <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral(@"></i>One-to-many devices are typically shared.
                        One-to-one devices are typically assigned to a user;
                        enrolment with a one-to-one device isn't considered complete until it is assigned.
                    </p>
                </div>
            </td>
        </tr>
        <tr>
            <th>
                Address:
            </th>
            <td>
");

            
            #line 164 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 164 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canConfig)
                {
                    
            
            #line default
            #line hidden
            
            #line 166 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(Html.DropDownListFor(m => m.DeviceProfile.DefaultOrganisationAddress, Model.OrganisationAddresses.ToSelectListItems(Model.DeviceProfile.DefaultOrganisationAddress, true, "None")));

            
            #line default
            #line hidden
            
            #line 166 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                                                                                                                                       
                    
            
            #line default
            #line hidden
            
            #line 167 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 167 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                             

            
            #line default
            #line hidden
WriteLiteral("                    <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                        $(function () {
                            document.DiscoFunctions.PropertyChangeHelper(
                                $('#DeviceProfile_DefaultOrganisationAddress'),
                                null,
                                '");

            
            #line 173 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                            Write(Url.Action(MVC.API.DeviceProfile.UpdateDefaultOrganisationAddress(Model.DeviceProfile.Id)));

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                \'DefaultOrganisationAddress\'\r\n               " +
"             );\r\n                        });\r\n                    </script>\r\n");

            
            #line 178 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }
                else
                {
                    if (Model.DefaultOrganisationAddress == null)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <span");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">&lt;None Specified&gt;</span>\r\n");

            
            #line 184 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }
                    else
                    {
                        
            
            #line default
            #line hidden
            
            #line 187 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                   Write(Model.DefaultOrganisationAddress.ToString());

            
            #line default
            #line hidden
            
            #line 187 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                    
                    }
                }

            
            #line default
            #line hidden
WriteLiteral("                <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                    <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                        <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral("></i>The profile address is used to separate jobs for <a");

WriteAttribute("href", Tuple.Create(" href=\"", 8096), Tuple.Create("\"", 8147)
            
            #line 192 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                   , Tuple.Create(Tuple.Create("", 8103), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Organisation.Index())
            
            #line default
            #line hidden
, 8103), false)
);

WriteLiteral(@">multi-site mode</a>.
                        It is also suggested as the default address for warranty/repair actions.
                    </p>
                </div>
            </td>
        </tr>
        <tr>
            <th>Policies</th>
            <td>
                <div>
");

            
            #line 202 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 202 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                     if (canConfig)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <input");

WriteLiteral(" id=\"DeviceProfile_ProvisionADAccount\"");

WriteLiteral(" type=\"checkbox\"");

WriteLiteral(" ");

            
            #line 204 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                 Write(Model.DeviceProfile.ProvisionADAccount ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty));

            
            #line default
            #line hidden
WriteLiteral(" />\r\n");

WriteLiteral("                        <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                            $(function () {
                                document.DiscoFunctions.PropertyChangeHelper(
                                    $('#DeviceProfile_ProvisionADAccount'),
                                    null,
                                    '");

            
            #line 210 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                Write(Url.Action(MVC.API.DeviceProfile.UpdateProvisionADAccount(Model.DeviceProfile.Id)));

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                    \'ProvisionADAccount\'\r\n                   " +
"             );\r\n                            });\r\n                        </scri" +
"pt>\r\n");

            
            #line 215 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <input");

WriteLiteral(" id=\"DeviceProfile_ProvisionADAccount\"");

WriteLiteral(" type=\"checkbox\"");

WriteLiteral(" ");

            
            #line 218 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                 Write(Model.DeviceProfile.ProvisionADAccount ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty));

            
            #line default
            #line hidden
WriteLiteral(" disabled=\"disabled\" />\r\n");

            
            #line 219 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                    <label");

WriteLiteral(" for=\"DeviceProfile_ProvisionADAccount\"");

WriteLiteral(">\r\n                        Provision Active Directory Account\r\n                  " +
"  </label>\r\n");

WriteLiteral("                    ");

            
            #line 223 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
WriteLiteral("\r\n                    <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                        <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                            <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral(@"></i>When enabled an Active Directory account will be provisioned for the device when enrolment occurs
                            and the device will be joined to the domain (refer to the <code>Computer&nbsp;Name&nbsp;Template&nbsp;Expression</code> and the
                            <code>Organisational&nbsp;Unit</code> configuration options below).
                        </p>
                    </div>
                </div>
                <div");

WriteLiteral(" style=\"margin-top: 8px;\"");

WriteLiteral(">\r\n");

            
            #line 233 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 233 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                     if (canConfig)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <input");

WriteLiteral(" id=\"DeviceProfile_AssignedUserLocalAdmin\"");

WriteLiteral(" type=\"checkbox\"");

WriteLiteral(" ");

            
            #line 235 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                     Write(Model.DeviceProfile.AssignedUserLocalAdmin ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty));

            
            #line default
            #line hidden
WriteLiteral(" />\r\n");

WriteLiteral("                        <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                            $(function () {
                                document.DiscoFunctions.PropertyChangeHelper(
                                    $('#DeviceProfile_AssignedUserLocalAdmin'),
                                    null,
                                    '");

            
            #line 241 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                Write(Url.Action(MVC.API.DeviceProfile.UpdateAssignedUserLocalAdmin(Model.DeviceProfile.Id)));

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                    \'AssignedUserLocalAdmin\'\r\n               " +
"                 );\r\n                            });\r\n                        </" +
"script>\r\n");

            
            #line 246 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <input");

WriteLiteral(" id=\"DeviceProfile_AssignedUserLocalAdmin\"");

WriteLiteral(" type=\"checkbox\"");

WriteLiteral(" ");

            
            #line 249 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                     Write(Model.DeviceProfile.AssignedUserLocalAdmin ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty));

            
            #line default
            #line hidden
WriteLiteral(" disabled=\"disabled\" />\r\n");

            
            #line 250 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                    <label");

WriteLiteral(" for=\"DeviceProfile_AssignedUserLocalAdmin\"");

WriteLiteral(">\r\n                        Assigned User is Local Administrator\r\n                " +
"    </label>\r\n");

WriteLiteral("                    ");

            
            #line 254 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
WriteLiteral("\r\n                    <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                        <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                            <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral("></i>When enabled the user assigned to the device will be added to the <code>Loca" +
"l&nbsp;Administrators</code> group during device enrolment.\r\n                   " +
"     </p>\r\n                    </div>\r\n                </div>\r\n                <" +
"div");

WriteLiteral(" style=\"margin-top: 8px;\"");

WriteLiteral(">\r\n");

            
            #line 262 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 262 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                     if (canConfig)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <input");

WriteLiteral(" id=\"DeviceProfile_AllowUntrustedReimageJobEnrolment\"");

WriteLiteral(" type=\"checkbox\"");

WriteLiteral(" ");

            
            #line 264 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                                Write(Model.DeviceProfile.AllowUntrustedReimageJobEnrolment ? new MvcHtmlString("checked=\"checked\" ") : null);

            
            #line default
            #line hidden
WriteLiteral(" />\r\n");

WriteLiteral("                        <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                            $(function () {
                                document.DiscoFunctions.PropertyChangeHelper(
                                    $('#DeviceProfile_AllowUntrustedReimageJobEnrolment'),
                                    null,
                                    '");

            
            #line 270 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                Write(Url.Action(MVC.API.DeviceProfile.UpdateAllowUntrustedReimageJobEnrolment(Model.DeviceProfile.Id)));

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                    \'AllowUntrustedReimageJobEnrolment\'\r\n    " +
"                            );\r\n                            });\r\n               " +
"         </script>\r\n");

            
            #line 275 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <input");

WriteLiteral(" id=\"DeviceProfile_AllowUntrustedReimageJobEnrolment\"");

WriteLiteral(" type=\"checkbox\"");

WriteLiteral(" ");

            
            #line 278 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                                Write(Model.DeviceProfile.AllowUntrustedReimageJobEnrolment ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty));

            
            #line default
            #line hidden
WriteLiteral(" disabled=\"disabled\" />\r\n");

            
            #line 279 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                    <label");

WriteLiteral(" for=\"DeviceProfile_AllowUntrustedReimageJobEnrolment\"");

WriteLiteral(">\r\n                        Allow Untrusted Enrolment Where a <span");

WriteLiteral(" class=\"code\"");

WriteLiteral(">\'Software - Reimage\'</span> Job is Open\r\n                    </label>\r\n");

WriteLiteral("                    ");

            
            #line 283 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
WriteLiteral("\r\n                    <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                        <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                            <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral(@"></i>When enabled an untrusted device enrolment will be allowed if a <code>Software&nbsp;-&nbsp;Reimage</code> job is open for the device.
                        </p>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <th>
                Computer Name<br />
                Template Expression:
            </th>
            <td>
                <div");

WriteLiteral(" id=\"displayComputerNameTemplate\"");

WriteLiteral(" class=\"code\"");

WriteLiteral(">\r\n");

            
            #line 299 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 299 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                     if (string.IsNullOrWhiteSpace(Model.DeviceProfile.ComputerNameTemplate))
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <span");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">&lt;None Specified&gt;</span>\r\n");

            
            #line 302 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }
                    else
                    {
                        
            
            #line default
            #line hidden
            
            #line 305 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                   Write(Model.DeviceProfile.ComputerNameTemplate);

            
            #line default
            #line hidden
            
            #line 305 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                 
                    }

            
            #line default
            #line hidden
WriteLiteral("                </div>\r\n");

            
            #line 308 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 308 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canConfig && canConfigExpression)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <a");

WriteLiteral(" id=\"changeComputerNameTemplate\"");

WriteLiteral(" href=\"#\"");

WriteLiteral(" class=\"button small\"");

WriteLiteral(">Change</a>");

            
            #line 310 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                               
            
            #line default
            #line hidden
            
            #line 310 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                          Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 310 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                                                        

            
            #line default
            #line hidden
WriteLiteral("                    <div");

WriteLiteral(" id=\"dialogComputerNameTemplate\"");

WriteLiteral(" title=\"Computer Name Template\"");

WriteLiteral(" class=\"dialog\"");

WriteLiteral(">\r\n");

            
            #line 312 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 312 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                         using (Html.BeginForm(MVC.API.DeviceProfile.UpdateComputerNameTemplate(Model.DeviceProfile.Id, null, false)))
                        {
                            
            
            #line default
            #line hidden
            
            #line 314 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                       Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
            
            #line 314 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                    
                            
            
            #line default
            #line hidden
            
            #line 315 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                       Write(Html.TextArea("ComputerNameTemplate", Model.DeviceProfile.ComputerNameTemplate, new { spellcheck = "false", required = "required" }));

            
            #line default
            #line hidden
            
            #line 315 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                                                                                                 
                        }

            
            #line default
            #line hidden
WriteLiteral("                        <div");

WriteLiteral(" class=\"hidden info-box error code whitespace-pre-wrap\"");

WriteLiteral(">\r\n                        </div>\r\n                        <div");

WriteLiteral(" class=\"test hidden\"");

WriteLiteral(">\r\n");

            
            #line 320 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 320 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                             using (Html.BeginForm(MVC.API.DeviceProfile.TestComputerNameTemplate(Model.DeviceProfile.Id)))
                            {
                                
            
            #line default
            #line hidden
            
            #line 322 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                           Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
            
            #line 322 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                        ;

            
            #line default
            #line hidden
WriteLiteral("                                <table");

WriteLiteral(" class=\"genericData\"");

WriteLiteral(@">
                                    <thead>
                                        <tr>
                                            <th>Serial Number</th>
                                            <th>Current</th>
                                            <th>Result</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td>
                                                <input");

WriteLiteral(" id=\"ComputerNameTemplateTestSearch\"");

WriteLiteral(" name=\"UserSpecifiedDeviceSerialNumber\"");

WriteLiteral(" type=\"text\"");

WriteLiteral(" placeholder=\"Device Serial Number\"");

WriteLiteral(" spellcheck=\"false\"");

WriteLiteral(@" />
                                            </td>
                                            <td>&nbsp;</td>
                                            <td>&nbsp;</td>
                                        </tr>
                                    </tbody>
                                </table>
");

            
            #line 341 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </div>\r\n                        <button");

WriteLiteral(" id=\"ComputerNameTemplateTest\"");

WriteLiteral(" class=\"button small\"");

WriteLiteral(" type=\"button\"");

WriteLiteral(">Test Template</button>");

            
            #line 343 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                                                  Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </div>\r\n");

WriteLiteral("                    <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                        $(() => {
                            let $dialog = null;
                            let $textarea = null;
                            let currentValue = null;

                            $('#changeComputerNameTemplate').click(e => {
                                e.preventDefault();

                                if (!$dialog) {
                                    $textarea = $('#ComputerNameTemplate');
                                    currentValue = $textarea.val();
                                    $dialog = $('#dialogComputerNameTemplate').dialog({
                                        autoOpen: false,
                                        buttons: null,
                                        draggable: false,
                                        modal: true,
                                        resizable: false,
                                        width: 700,
                                        buttons: {
                                            ""Cancel"": () => {
                                                $textarea.val(currentValue);
                                                $dialog.find('.error').addClass('hidden');
                                                $dialog.dialog(""close"");
                                            },
                                            ""Expression Browser"": () => {
                                                window.open('");

            
            #line 371 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                         Write(Url.Action(MVC.Config.Expressions.Browser()));

            
            #line default
            #line hidden
WriteLiteral("\', \'_blank\');\r\n                                            },\r\n                  " +
"                          \"Save\": () => {\r\n                                     " +
"           const $form = $textarea.closest(\'form\');\r\n                           " +
"                     $(this).find(\'.error\').addClass(\'hidden\');\r\n\r\n             " +
"                                   if ($form[0].reportValidity()) {\r\n           " +
"                                         const body = new FormData($form[0]);\r\n " +
"                                                   const url = $form.attr(\'actio" +
"n\');\r\n\r\n                                                    const $ajaxLoading =" +
" $(\'#changeComputerNameTemplate\').nextAll(\'.ajaxLoading\').first();\r\n            " +
"                                        $ajaxLoading.show();\r\n                  " +
"                                  $dialog.dialog(\'close\');\r\n\r\n                  " +
"                                  fetch(url, {\r\n                                " +
"                        method: \'POST\',\r\n                                       " +
"                 body: body\r\n                                                   " +
" }).then(response => {\r\n                                                        " +
"if (response.ok) {\r\n                                                            " +
"currentValue = $textarea.val();\r\n                                               " +
"             const $display = $(\'#displayComputerNameTemplate\');\r\n              " +
"                                              if (currentValue) {\r\n             " +
"                                                   $display.text(currentValue);\r" +
"\n                                                            } else {\r\n         " +
"                                                       $display.html(\'<span clas" +
"s=\"smallMessage\">&lt;None Specified&gt;</span>\');\r\n                             " +
"                               }\r\n                                              " +
"              $ajaxLoading.hide().next(\'.ajaxOk\').show().delay(\'fast\').fadeOut(\'" +
"slow\');\r\n                                                        } else if (resp" +
"onse.status == 400) {\r\n                                                         " +
"   response.json().then(data => {\r\n                                             " +
"                   $ajaxLoading.hide();\r\n                                       " +
"                         $dialog.dialog(\'open\');\r\n                              " +
"                                  $dialog.find(\'.error\').text(data).removeClass(" +
"\'hidden\');\r\n                                                                cons" +
"ole.error(data);\r\n                                                            })" +
"\r\n                                                        }\r\n                   " +
"                                 }).catch(error => {\r\n                          " +
"                              alert(\'Unable to save computer name template\');\r\n " +
"                                                       $ajaxLoading.hide();\r\n   " +
"                                                     $dialog.dialog(\'open\');\r\n  " +
"                                                      $dialog.find(\'.error\').tex" +
"t(\'Unable to save computer name template: \' + error).removeClass(\'hidden\');\r\n   " +
"                                                     console.error(error);\r\n    " +
"                                                });\r\n                           " +
"                     }\r\n                                            }\r\n         " +
"                               }\r\n                                    });\r\n     " +
"                               const $buttonTest = $dialog.find(\'#ComputerNameTe" +
"mplateTest\');\r\n                                    $buttonTest.click(e => {\r\n   " +
"                                     e.preventDefault();\r\n                      " +
"                  const $test = $dialog.find(\'.test\');\r\n\r\n                      " +
"                  const $ajaxLoading = $(e.currentTarget).nextAll(\'.ajaxLoading\'" +
").first();\r\n                                        $ajaxLoading.show();\r\n\r\n    " +
"                                    const $form = $test.find(\'form\');\r\n         " +
"                               const url = $form.attr(\'action\');\r\n              " +
"                          const body = new FormData($form[0]);\r\n                " +
"                        body.append(\'ComputerNameTemplate\', $textarea.val());\r\n\r" +
"\n                                        fetch(url, {\r\n                         " +
"                   method: \'POST\',\r\n                                            " +
"body: body\r\n                                        }).then(response => {\r\n     " +
"                                       if (response.ok) {\r\n                     " +
"                           response.json().then(data => {\r\n                     " +
"                               const $table = $test.find(\'table tbody\');\r\n      " +
"                                              if (data.UserSpecifiedResult) {\r\n " +
"                                                       const result = data.UserS" +
"pecifiedResult;\r\n                                                        const r" +
"ow = $table.find(\'tr\').first();\r\n                                               " +
"         row.find(\'input\').val(result.DeviceSerialNumber);\r\n                    " +
"                                    const columns = row.find(\'td\');\r\n           " +
"                                             columns.eq(1).html(\'\');\r\n          " +
"                                              $(\'<span class=\"code\">\').text(resu" +
"lt.DeviceComputerName)\r\n                                                        " +
"    .appendTo(columns.eq(1))\r\n                                                  " +
"      columns.eq(2).html(\'\');\r\n                                                 " +
"       $(\'<span class=\"code\">\').text(result.RenderedComputerName)\r\n             " +
"                                               .appendTo(columns.eq(2))\r\n       " +
"                                                 if (!result.Success) {\r\n       " +
"                                                     $(\'<div class=\"info-box err" +
"or code whitespace-pre-wrap\">\').text(result.ErrorMessage).appendTo(columns[2]);\r" +
"\n                                                        }\r\n                    " +
"                                }\r\n                                             " +
"       if (data.RandomDeviceResults) {\r\n                                        " +
"                $table.find(\'tr\').slice(1).remove();\r\n                          " +
"                              for (var i = 0; i < data.RandomDeviceResults.lengt" +
"h; i++) {\r\n                                                            const res" +
"ult = data.RandomDeviceResults[i];\r\n                                            " +
"                const row = $(\'<tr><td></td><td></td><td></td></tr>\');\r\n        " +
"                                                    const columns = row.find(\'td" +
"\');\r\n                                                            $(\'<a>\').attr({" +
"\r\n                                                                href: result.U" +
"rl,\r\n                                                                target: \'_b" +
"lank\'\r\n                                                            }).text(resul" +
"t.DeviceSerialNumber)\r\n                                                         " +
"       .appendTo(columns.eq(0));\r\n                                              " +
"              $(\'<span class=\"code\">\').text(result.DeviceComputerName)\r\n        " +
"                                                        .appendTo(columns.eq(1))" +
"\r\n                                                            $(\'<span class=\"co" +
"de\">\').text(result.RenderedComputerName)\r\n                                      " +
"                          .appendTo(columns.eq(2))\r\n                            " +
"                                if (!result.Success) {\r\n                        " +
"                                        $(\'<div class=\"info-box error code white" +
"space-pre-wrap\">\').text(result.ErrorMessage).appendTo(columns.eq(2));\r\n         " +
"                                                   }\r\n                          " +
"                                  row.appendTo($table);\r\n                       " +
"                                 }\r\n                                            " +
"        }\r\n                                                    $test.removeClass" +
"(\'hidden\');\r\n                                                    $ajaxLoading.hi" +
"de().next(\'.ajaxOk\').show().delay(\'fast\').fadeOut(\'slow\');\r\n                    " +
"                            });\r\n                                            } e" +
"lse if (response.status == 400) {\r\n                                             " +
"   response.json().then(data => {\r\n                                             " +
"       $ajaxLoading.hide();\r\n                                                   " +
" $test.addClass(\'hidden\');\r\n                                                    " +
"$dialog.find(\'.error\').text(data).removeClass(\'hidden\');\r\n                      " +
"                              console.error(data);\r\n                            " +
"                    })\r\n                                            }\r\n         " +
"                               }).catch(error => {\r\n                            " +
"                $ajaxLoading.hide();\r\n                                          " +
"  $test.addClass(\'hidden\');\r\n                                            $dialog" +
".find(\'.error\').text(\'Unable to test computer name template: \' + error).removeCl" +
"ass(\'hidden\');\r\n                                            console.error(error)" +
";\r\n                                        });\r\n\r\n                              " +
"          return false;\r\n                                    })\r\n               " +
"                     const $testSearchText = $dialog.find(\'#ComputerNameTemplate" +
"TestSearch\');\r\n                                    $testSearchText.autocomplete(" +
"{\r\n                                        source: \'");

            
            #line 495 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                             Write(Url.Action(MVC.API.Search.Devices()));

            
            #line default
            #line hidden
WriteLiteral(@"',
                                        minLength: 2,
                                        focus: function (e, ui) {
                                            $testSearchText.val(ui.item.Id);
                                            return false;
                                        },
                                        select: function (e, ui) {
                                            $testSearchText.val(ui.item.Id).blur();
                                            $buttonTest.click();
                                            return false;
                                        }
                                    }).data('ui-autocomplete')._renderItem = function (ul, item) {
                                        return $('<li>')
                                            .data('item.autocomplete', item)
                                            .append($('<a>').text(item.Description))
                                            .appendTo(ul);
                                    };
                                }
                                $dialog.dialog('open');

                                return false;
                            });
                        });
                    </script>
");

            
            #line 519 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("                <div");

WriteLiteral(" style=\"margin-top: 8px;\"");

WriteLiteral(">\r\n");

            
            #line 521 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 521 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                     if (canConfig)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <input");

WriteLiteral(" id=\"DeviceProfile_EnforceComputerNameConvention\"");

WriteLiteral(" type=\"checkbox\"");

WriteLiteral(" ");

            
            #line 523 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                            Write(Model.DeviceProfile.EnforceComputerNameConvention ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty));

            
            #line default
            #line hidden
WriteLiteral(" />\r\n");

WriteLiteral("                        <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                            $(function () {
                                document.DiscoFunctions.PropertyChangeHelper(
                                    $('#DeviceProfile_EnforceComputerNameConvention'),
                                    null,
                                    '");

            
            #line 529 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                Write(Url.Action(MVC.API.DeviceProfile.UpdateEnforceComputerNameConvention(Model.DeviceProfile.Id)));

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                    \'EnforceComputerNameConvention\'\r\n        " +
"                        );\r\n                            });\r\n                   " +
"     </script>\r\n");

            
            #line 534 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <input");

WriteLiteral(" id=\"DeviceProfile_EnforceComputerNameConvention\"");

WriteLiteral(" type=\"checkbox\"");

WriteLiteral(" ");

            
            #line 537 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                            Write(Model.DeviceProfile.EnforceComputerNameConvention ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty));

            
            #line default
            #line hidden
WriteLiteral(" disabled=\"disabled\" />\r\n");

            
            #line 538 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                    <label");

WriteLiteral(" for=\"DeviceProfile_EnforceComputerNameConvention\"");

WriteLiteral(">\r\n                        Enforce Naming Convention\r\n                    </label" +
">\r\n");

WriteLiteral("                    ");

            
            #line 542 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
WriteLiteral("\r\n                </div>\r\n                <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                    <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                        <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral(@"></i>Computer names are only changed when Active Directory accounts are provisioned.
                        If the device has already joined the domain when enrolment occurs the name will remain the same unless Enforce Naming Convention is enabled.
                    </p>
                </div>
            </td>
        </tr>
        <tr>
            <th>
                Organisational Unit:
            </th>
            <td>
");

            
            #line 557 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 557 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canConfig)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div");

WriteLiteral(" id=\"DeviceProfile_OrganisationalUnit\"");

WriteLiteral(" class=\"code\"");

WriteLiteral(" data-value=\"");

            
            #line 559 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                   Write(Model.DeviceProfile.OrganisationalUnit);

            
            #line default
            #line hidden
WriteLiteral("\"");

WriteLiteral(">\r\n                        <span>\r\n");

WriteLiteral("                            ");

            
            #line 561 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                       Write(Model.FriendlyOrganisationalUnitName);

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </span>\r\n                    </div>\r\n");

WriteLiteral("                    <a");

WriteLiteral(" id=\"changeOrganisationalUnit\"");

WriteLiteral(" href=\"#\"");

WriteLiteral(" class=\"button small\"");

WriteLiteral(">Change</a>");

            
            #line 564 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                             
            
            #line default
            #line hidden
            
            #line 564 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                        Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 564 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                                                      

            
            #line default
            #line hidden
WriteLiteral("                    <div");

WriteLiteral(" id=\"dialogOrganisationalUnit\"");

WriteLiteral(" title=\"Organisational Unit\"");

WriteLiteral(" class=\"dialog\"");

WriteLiteral(">\r\n                        <div");

WriteLiteral(" id=\"dialogOrganisationalUnit_Loading\"");

WriteLiteral(">\r\n");

WriteLiteral("                            ");

            
            #line 567 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                       Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
WriteLiteral(" Loading Organisational Units\r\n                        </div>\r\n                  " +
"      <div");

WriteLiteral(" id=\"treeOrganisationalUnit\"");

WriteLiteral(" class=\"organisationalUnitTree\"");

WriteLiteral(">\r\n                        </div>\r\n");

            
            #line 571 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 571 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                         using (Html.BeginForm(MVC.API.DeviceProfile.UpdateOrganisationalUnit(Model.DeviceProfile.Id, redirect: true), FormMethod.Post))
                        {
                            
            
            #line default
            #line hidden
            
            #line 573 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                       Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
            
            #line 573 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                    ;

            
            #line default
            #line hidden
WriteLiteral("                            <input");

WriteLiteral(" type=\"hidden\"");

WriteLiteral(" name=\"OrganisationalUnit\"");

WriteLiteral(" />\r\n");

WriteLiteral("                            <div");

WriteLiteral(" class=\"enforceOrganisationalUnit\"");

WriteLiteral(">\r\n                                <input");

WriteLiteral(" id=\"enforceOrganisationalUnit\"");

WriteLiteral(" type=\"checkbox\"");

WriteLiteral(" name=\"enforce\"");

WriteLiteral(" value=\"true\"");

WriteLiteral(" /> <label");

WriteLiteral(" for=\"enforceOrganisationalUnit\"");

WriteLiteral(">Move all profile devices to this organisational unit</label>\r\n                  " +
"          </div>\r\n");

            
            #line 578 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </div>\r\n");

WriteLiteral("                    <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(">\r\n                        $(function () {\r\n                            var ouVal" +
"ue = $(\'#DeviceProfile_OrganisationalUnit\').attr(\'data-value\');\r\n               " +
"             var $ouTree = null;\r\n                            var ouTree = null;" +
"\r\n                            var $dialog = null;\r\n                            v" +
"ar $enforceCheckbox;\r\n                            var ouSet = function (ou) {\r\n " +
"                               const $form = $dialog.find(\'form\');\r\n            " +
"                    $form.find(\'input[name=\"OrganisationalUnit\"]\').val(ou);\r\n   " +
"                             $form.submit();\r\n                            }\r\n   " +
"                         var expandNodeTree = function (node) {\r\n               " +
"                 var parent = node.parent;\r\n                                if (" +
"parent) {\r\n                                    expandNodeTree(parent);\r\n        " +
"                            parent.setExpanded(true, { noAnimation: true, noEven" +
"ts: false });\r\n                                }\r\n                            }\r" +
"\n                            var expandAndFocusNode = function (nodeKey) {\r\n    " +
"                            if (ouTree) {\r\n                                    v" +
"ar ouNode = ouTree.getNodeByKey(ouValue);\r\n                                    i" +
"f (ouNode) {\r\n                                        expandNodeTree(ouNode);\r\n " +
"                                       ouNode.setFocus(true);\r\n                 " +
"                       ouNode.setActive(true);\r\n\r\n                              " +
"          var li = ouNode.li;\r\n                                        var liOff" +
"set = li.offsetParent;\r\n                                        if (li.offsetTop" +
" + li.offsetHeight > liOffset.offsetHeight)\r\n                                   " +
"         $(liOffset).animate({ \'scrollTop\': li.offsetTop - liOffset.offsetHeight" +
" + li.offsetHeight + 4 }, \'fast\');\r\n                                    }\r\n     " +
"                           }\r\n                            }\r\n                   " +
"         var ouChange = function () {\r\n                                if (!$dia" +
"log) {\r\n                                    $dialog = $(\'#dialogOrganisationalUn" +
"it\').dialog({\r\n                                        autoOpen: false,\r\n       " +
"                                 buttons: null,\r\n                               " +
"         draggable: false,\r\n                                        modal: true," +
"\r\n                                        resizable: false,\r\n                   " +
"                     width: 500,\r\n                                        height" +
": 500\r\n                                    });\r\n                                " +
"    $loading = $(\'#dialogOrganisationalUnit_Loading\');\r\n                        " +
"            $loading.find(\'i.ajaxLoading\').show();\r\n\r\n                          " +
"          $ouTree = $(\'#treeOrganisationalUnit\');\r\n                             " +
"       $dialog.css(\'overflow\', \'visible\');\r\n\r\n                                  " +
"  $enforceCheckbox = $(\'#enforceOrganisationalUnit\');\r\n\r\n                       " +
"             $.getJSON(\'");

            
            #line 633 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                           Write(Url.Action(MVC.API.System.DomainOrganisationalUnits()));

            
            #line default
            #line hidden
WriteLiteral("\', null, function (data) {\r\n                                        $loading.hide" +
"();\r\n\r\n                                        // Make \'Domains\' unselectable\r\n " +
"                                       $.each(data, function (i, node) {\r\n      " +
"                                      node.unselectable = true;\r\n               " +
"                         });\r\n\r\n                                        ouTree =" +
" $ouTree.fancytree({\r\n                                            source: data,\r" +
"\n                                            checkbox: false,\r\n                 " +
"                           selectMode: 1,\r\n                                     " +
"       keyboard: false,\r\n                                            fx: null\r\n " +
"                                       }).fancytree(\'getTree\');\r\n\r\n             " +
"                           ouTree.$container.css(\'position\', \'relative\');\r\n\r\n   " +
"                                     // Set Buttons\r\n                           " +
"             $dialog.dialog(\'option\', \'buttons\', {\r\n                            " +
"                \'Use Default Computers Container\': function () {\r\n              " +
"                                  var $this = $(this);\r\n                        " +
"                        $this.css(\'overflow\', \'hidden\');\r\n                      " +
"                          $this.dialog(\"disable\");\r\n                            " +
"                    $this.dialog(\"option\", \"buttons\", null);\r\n                  " +
"                              ouSet(\'\');\r\n                                      " +
"      },\r\n                                            \'Save\': function () {\r\n   " +
"                                             var node = ouTree.getActiveNode();\r" +
"\n                                                if (node && node.key.substr(0, " +
"3).toLowerCase() == \'ou=\') {\r\n                                                  " +
"  var $this = $(this);\r\n                                                    $thi" +
"s.css(\'overflow\', \'hidden\');\r\n                                                  " +
"  $this.dialog(\"disable\");\r\n                                                    " +
"$this.dialog(\"option\", \"buttons\", null);\r\n                                      " +
"              ouSet(node.key);\r\n                                                " +
"} else {\r\n                                                    alert(\'Select an O" +
"rganisational Unit to Save\')\r\n                                                }\r" +
"\n                                            }\r\n                                " +
"        });\r\n\r\n                                        // Expand\r\n              " +
"                          expandAndFocusNode(ouValue);\r\n\r\n                      " +
"                  ouTree.options.fx = { height: \"toggle\", duration: 200 };\r\n    " +
"                                });\r\n                                }\r\n        " +
"                        $dialog.dialog(\'open\');\r\n\r\n                             " +
"   $enforceCheckbox.prop(\'checked\', $(\'#DeviceProfile_EnforceOrganisationalUnit\'" +
").prop(\'checked\'));\r\n\r\n                                if (ouTree) {\r\n          " +
"                          // Expand\r\n                                    expandA" +
"ndFocusNode(ouValue);\r\n                                }\r\n\r\n                    " +
"            return false;\r\n                            };\r\n\r\n                   " +
"         $(\'#changeOrganisationalUnit\').click(ouChange);\r\n                      " +
"  });\r\n                    </script>\r\n");

            
            #line 695 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }
                else
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div");

WriteLiteral(" id=\"displayOrganisationalUnit\"");

WriteLiteral(" class=\"code\"");

WriteLiteral(">\r\n                        <span>\r\n");

WriteLiteral("                            ");

            
            #line 700 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                       Write(Model.FriendlyOrganisationalUnitName);

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </span>\r\n                    </div>\r\n");

            
            #line 703 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("                ");

            
            #line 704 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (!Model.OrganisationalUnitExists)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div");

WriteLiteral(" class=\"info-box error\"");

WriteLiteral(">\r\n                        <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                            <i");

WriteLiteral(" class=\"fa fa-exclamation-triangle\"");

WriteLiteral("></i>The Organisational Unit could not be found.\r\n                        </p>\r\n " +
"                   </div>\r\n");

            
            #line 711 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("                <div");

WriteLiteral(" style=\"margin-top: 8px;\"");

WriteLiteral(">\r\n");

            
            #line 713 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 713 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                     if (canConfig)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <input");

WriteLiteral(" id=\"DeviceProfile_EnforceOrganisationalUnit\"");

WriteLiteral(" type=\"checkbox\"");

WriteLiteral(" ");

            
            #line 715 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                        Write(Model.DeviceProfile.EnforceOrganisationalUnit ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty));

            
            #line default
            #line hidden
WriteLiteral(" />\r\n");

WriteLiteral("                        <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                            $(function () {
                                document.DiscoFunctions.PropertyChangeHelper(
                                    $('#DeviceProfile_EnforceOrganisationalUnit'),
                                    null,
                                    '");

            
            #line 721 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                Write(Url.Action(MVC.API.DeviceProfile.UpdateEnforceOrganisationalUnit(Model.DeviceProfile.Id)));

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                    \'EnforceOrganisationalUnit\'\r\n            " +
"                    );\r\n                            });\r\n                       " +
" </script>\r\n");

            
            #line 726 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <input");

WriteLiteral(" id=\"DeviceProfile_EnforceOrganisationalUnit\"");

WriteLiteral(" type=\"checkbox\"");

WriteLiteral(" ");

            
            #line 729 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                        Write(Model.DeviceProfile.EnforceOrganisationalUnit ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty));

            
            #line default
            #line hidden
WriteLiteral(" disabled=\"disabled\" />\r\n");

            
            #line 730 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                    <label");

WriteLiteral(" for=\"DeviceProfile_EnforceOrganisationalUnit\"");

WriteLiteral(">\r\n                        Enforce Organisational Unit\r\n                    </lab" +
"el>\r\n");

WriteLiteral("                    ");

            
            #line 734 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
WriteLiteral("\r\n                </div>\r\n                <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                    <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                        <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral(@"></i>When an Active Directory account is provisioned it will be placed in this container. This typically occurs
                        at device enrolment. If the device has already joined the domain and the <code>Enforce&nbsp;Organisational&nbsp;Unit</code> option is enabled
                        the Active Directory account will be moved into this organisational unit during enrolment.
                    </p>
                </div>
            </td>
        </tr>
        <tr>
            <th>
                Provision Certificates:
");

            
            #line 748 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 748 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canConfig && (Model.CertificateProviders.Count > 0 || Model.CertificateAuthorityProviders.Count > 0))
                {

            
            #line default
            #line hidden
WriteLiteral("                    <br />\r\n");

            
            #line 751 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 751 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxLoader("DeviceProfile_CertificateProviders"));

            
            #line default
            #line hidden
            
            #line 751 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                 
                }

            
            #line default
            #line hidden
WriteLiteral("                ");

            
            #line 753 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canConfig && Model.CertificateProviders.Count > 0)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                        $(function () {
                            var $container = $('#DeviceProfile_CertificateProviders');

                            $container.on('change', 'input', function () {
                                var $ajaxLoading = $('#DeviceProfile_CertificateProviders_loading').show();

                                var data = {
                                    CertificateProviders: $('input:checked', $container).map(function () { return $(this).val() }).get().join(',')
                                };
                                $.getJSON('");

            
            #line 765 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                       Write(Url.Action(MVC.API.DeviceProfile.UpdateCertificateProviders(Model.DeviceProfile.Id)));

            
            #line default
            #line hidden
WriteLiteral(@"', data, function (response, result) {
                                    if (result != 'success' || response != 'OK') {
                                        alert('Unable to change property ""CertificateProviders"":\n' + response);
                                        $ajaxLoading.hide();
                                    } else {
                                        $ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
                                    }
                                })
                            })
                        });
                    </script>
");

            
            #line 776 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("                ");

            
            #line 777 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canConfig && Model.CertificateProviders.Count > 0)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                        $(function () {
                            var $container = $('#DeviceProfile_CertificateAuthorityProviders');

                            $container.on('change', 'input', function () {
                                var $ajaxLoading = $('#DeviceProfile_CertificateProviders_loading').show();

                                var data = {
                                    CertificateAuthorityProviders: $('input:checked', $container).map(function () { return $(this).val() }).get().join(',')
                                };
                                $.getJSON('");

            
            #line 789 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                       Write(Url.Action(MVC.API.DeviceProfile.UpdateCertificateAuthorityProviders(Model.DeviceProfile.Id)));

            
            #line default
            #line hidden
WriteLiteral(@"', data, function (response, result) {
                                    if (result != 'success' || response != 'OK') {
                                        alert('Unable to change property ""CertificateAuthorityProviders"":\n' + response);
                                        $ajaxLoading.hide();
                                    } else {
                                        $ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
                                    }
                                })
                            })
                        });
                    </script>
");

            
            #line 800 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </th>\r\n            <td>\r\n                <h4>Device/Machine Certifica" +
"tes</h4>\r\n");

            
            #line 804 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 804 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canConfig && Model.CertificateProviders.Count > 0)
                {
                    
            
            #line default
            #line hidden
            
            #line 806 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(CommonHelpers.CheckBoxList("DeviceProfile_CertificateProviders", "DeviceProfile_CertificateProviders", Model.CertificateProviders.ToSelectListItems(Model.DeviceProfile.GetCertificateProviders())));

            
            #line default
            #line hidden
            
            #line 806 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                                                                                                                                                        
                }
                else
                {
                    var certificateProviders = Model.DeviceProfile.GetCertificateProviders().ToList();

                    if (certificateProviders.Count == 0)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <span");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">&lt;None Allocated&gt;</span>\r\n");

            
            #line 815 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <ul>\r\n");

            
            #line 819 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 819 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                             foreach (var certificateProvider in certificateProviders)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <li>");

            
            #line 821 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                               Write(certificateProvider.Name);

            
            #line default
            #line hidden
WriteLiteral("</li>\r\n");

            
            #line 822 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </ul>\r\n");

            
            #line 824 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }
                }

            
            #line default
            #line hidden
WriteLiteral("                <h4");

WriteLiteral(" style=\"margin-top: 4px;\"");

WriteLiteral(">Authority Certificates</h4>\r\n");

            
            #line 827 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 827 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canConfig && Model.CertificateAuthorityProviders.Count > 0)
                {
                    
            
            #line default
            #line hidden
            
            #line 829 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(CommonHelpers.CheckBoxList("DeviceProfile_CertificateAuthorityProviders", "DeviceProfile_CertificateAuthorityProviders", Model.CertificateAuthorityProviders.ToSelectListItems(Model.DeviceProfile.GetCertificateAuthorityProviders())));

            
            #line default
            #line hidden
            
            #line 829 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                                                                                                                                                                                            
                }
                else
                {
                    var certificateProviders = Model.DeviceProfile.GetCertificateAuthorityProviders().ToList();

                    if (certificateProviders.Count == 0)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <span");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">&lt;None Allocated&gt;</span>\r\n");

            
            #line 838 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <ul>\r\n");

            
            #line 842 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 842 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                             foreach (var certificateProvider in certificateProviders)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <li>");

            
            #line 844 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                               Write(certificateProvider.Name);

            
            #line default
            #line hidden
WriteLiteral("</li>\r\n");

            
            #line 845 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </ul>\r\n");

            
            #line 847 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }
                }

            
            #line default
            #line hidden
WriteLiteral("                ");

            
            #line 849 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canViewPlugins)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                        <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                            <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral("></i>View the <a");

WriteAttribute("href", Tuple.Create(" href=\"", 48824), Tuple.Create("\"", 48874)
            
            #line 853 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
, Tuple.Create(Tuple.Create("", 48831), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Install())
            
            #line default
            #line hidden
, 48831), false)
);

WriteLiteral(">Plugin Catalogue</a> to discover and install certificate provider plugins.\r\n    " +
"                    </p>\r\n                    </div>\r\n");

            
            #line 856 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </td>\r\n        </tr>\r\n        <tr>\r\n            <th>\r\n               " +
" Provision Wireless Profiles:\r\n");

            
            #line 862 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 862 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canConfig && Model.WirelessProfileProviders.Count > 0)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <br />\r\n");

            
            #line 865 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 865 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(AjaxHelpers.AjaxLoader("DeviceProfile_WirelessProfileProviders"));

            
            #line default
            #line hidden
            
            #line 865 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                     

            
            #line default
            #line hidden
WriteLiteral("                    <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                        $(function () {
                            var $container = $('#DeviceProfile_WirelessProfileProviders');

                            $container.on('change', 'input', function () {
                                var $ajaxLoading = $('#DeviceProfile_WirelessProfileProviders_loading').show();

                                var data = {
                                    WirelessProfileProviders: $('input:checked', $container).map(function () { return $(this).val() }).get().join(',')
                                };
                                $.getJSON('");

            
            #line 876 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                       Write(Url.Action(MVC.API.DeviceProfile.UpdateWirelessProfileProviders(Model.DeviceProfile.Id)));

            
            #line default
            #line hidden
WriteLiteral(@"', data, function (response, result) {
                                    if (result != 'success' || response != 'OK') {
                                        alert('Unable to change property ""WirelessProfileProviders"":\n' + response);
                                        $ajaxLoading.hide();
                                    } else {
                                        $ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
                                    }
                                })
                            })
                        });
                    </script>
");

            
            #line 887 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </th>\r\n            <td>\r\n");

            
            #line 890 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 890 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canConfig && Model.WirelessProfileProviders.Count > 0)
                {
                    
            
            #line default
            #line hidden
            
            #line 892 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(CommonHelpers.CheckBoxList("DeviceProfile_WirelessProfileProviders", "DeviceProfile_WirelessProfileProviders", Model.WirelessProfileProviders.ToSelectListItems(Model.DeviceProfile.GetWirelessProfileProviders())));

            
            #line default
            #line hidden
            
            #line 892 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                                                                                                                                                                        
                }
                else
                {
                    var wirelessProfileProviders = Model.DeviceProfile.GetWirelessProfileProviders().ToList();

                    if (wirelessProfileProviders.Count == 0)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <span");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">&lt;None Allocated&gt;</span>\r\n");

            
            #line 901 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <ul>\r\n");

            
            #line 905 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 905 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                             foreach (var wirelessProfileProvider in wirelessProfileProviders)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <li>");

            
            #line 907 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                               Write(wirelessProfileProvider.Name);

            
            #line default
            #line hidden
WriteLiteral("</li>\r\n");

            
            #line 908 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </ul>\r\n");

            
            #line 910 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    }
                }

            
            #line default
            #line hidden
WriteLiteral("                ");

            
            #line 912 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                 if (canViewPlugins)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                        <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                            <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral("></i>View the <a");

WriteAttribute("href", Tuple.Create(" href=\"", 52078), Tuple.Create("\"", 52128)
            
            #line 916 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
, Tuple.Create(Tuple.Create("", 52085), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Install())
            
            #line default
            #line hidden
, 52085), false)
);

WriteLiteral(">Plugin Catalogue</a> to discover and install wireless profile provider plugins.\r" +
"\n                        </p>\r\n                    </div>\r\n");

            
            #line 919 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </td>\r\n        </tr>\r\n");

            
            #line 922 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
        
            
            #line default
            #line hidden
            
            #line 922 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
         if (hideAdvanced)
        {

            
            #line default
            #line hidden
WriteLiteral("            <tr>\r\n                <td");

WriteLiteral(" colspan=\"2\"");

WriteLiteral(" style=\"text-align: right;\"");

WriteLiteral(">\r\n                    <button");

WriteLiteral(" id=\"Config_HideAdvanced_Show\"");

WriteLiteral(" class=\"button small\"");

WriteLiteral(@">Show Advanced Options</button>
                    <script>
                        $(function () {
                            $('#Config_HideAdvanced_Show').click(function () {
                                var $this = $(this);
                                $this.closest('.Config_HideAdvanced').removeClass('Config_HideAdvanced');
                                $this.closest('tr').remove();
                            });
                        });
                    </script>
                </td>
            </tr>
");

            
            #line 938 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("        <tr");

WriteLiteral(" class=\"Config_HideAdvanced_Item\"");

WriteLiteral(">\r\n            <th>\r\n                Linked Groups:\r\n            </th>\r\n         " +
"   <td>\r\n                <div>\r\n");

WriteLiteral("                    ");

            
            #line 945 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel()
               {
                   CanConfigure = canConfig,
                   CategoryDescription = DeviceProfileDevicesManagedGroup.GetCategoryDescription(Model.DeviceProfile),
                   Description = DeviceProfileDevicesManagedGroup.GetDescription(Model.DeviceProfile),
                   ManagedGroup = Model.DevicesLinkedGroup,
                   UpdateUrl = Url.Action(MVC.API.DeviceProfile.UpdateDevicesLinkedGroup(Model.DeviceProfile.Id, redirect: true))
               }));

            
            #line default
            #line hidden
WriteLiteral("\r\n");

WriteLiteral("                    ");

            
            #line 953 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
               Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel()
               {
                   CanConfigure = canConfig,
                   CategoryDescription = DeviceProfileAssignedUsersManagedGroup.GetCategoryDescription(Model.DeviceProfile),
                   Description = DeviceProfileAssignedUsersManagedGroup.GetDescription(Model.DeviceProfile),
                   ManagedGroup = Model.AssignedUsersLinkedGroup,
                   UpdateUrl = Url.Action(MVC.API.DeviceProfile.UpdateAssignedUsersLinkedGroup(Model.DeviceProfile.Id, redirect: true))
               }));

            
            #line default
            #line hidden
WriteLiteral("\r\n");

            
            #line 961 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 961 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                     if (canConfig)
                    {
                        
            
            #line default
            #line hidden
            
            #line 963 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                   Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupShared));

            
            #line default
            #line hidden
            
            #line 963 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                
                    }

            
            #line default
            #line hidden
WriteLiteral("                </div>\r\n            </td>\r\n        </tr>\r\n    </table>\r\n</div>\r\n");

            
            #line 970 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
 if (canDelete)
{

            
            #line default
            #line hidden
WriteLiteral("    <div");

WriteLiteral(" id=\"dialogConfirmDelete\"");

WriteLiteral(" title=\"Delete this Device Profile?\"");

WriteLiteral(">\r\n        <p>\r\n            <i");

WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg warning\"");

WriteLiteral("></i>\r\n            This item will be permanently deleted and cannot be recovered." +
" Are you sure?\r\n        </p>\r\n    </div>\r\n");

WriteLiteral("    <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
        $(function () {

            var button = $('#buttonDelete');
            var buttonLink = button.attr('href');
            button.attr('href', '#');
            button.click(function () {
                $(""#dialogConfirmDelete"").dialog('open');
            });

            $(""#dialogConfirmDelete"").dialog({
                resizable: false,
                height: 140,
                modal: true,
                autoOpen: false,
                buttons: {
                    ""Delete"": function () {
                        $(this).dialog('disable');
                        window.location.href = buttonLink;
                    },
                    Cancel: function () {
                        $(this).dialog(""close"");
                    }
                }
            });

        });
    </script>
");

            
            #line 1006 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
}

            
            #line default
            #line hidden
            
            #line 1007 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(Html.Partial(MVC.Config.Shared.Views._DeviceGroupDocumentBulkGenerate, Model));

            
            #line default
            #line hidden
WriteLiteral(";\r\n<div");

WriteLiteral(" class=\"actionBar\"");

WriteLiteral(">\r\n");

            
            #line 1009 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
    
            
            #line default
            #line hidden
            
            #line 1009 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
     if (canDelete)
    {
        
            
            #line default
            #line hidden
            
            #line 1011 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
   Write(Html.ActionLinkButton("Delete", MVC.API.DeviceProfile.Delete(Model.DeviceProfile.Id, true), "buttonDelete"));

            
            #line default
            #line hidden
            
            #line 1011 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                                                    
    }

            
            #line default
            #line hidden
WriteLiteral("    ");

            
            #line 1013 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
     if (Authorization.Has(Claims.Device.Actions.Export))
    {
        
            
            #line default
            #line hidden
            
            #line 1015 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
   Write(Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.DeviceExportTypes.Profile, Model.DeviceProfile.Id)));

            
            #line default
            #line hidden
            
            #line 1015 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                                                                                          
    }

            
            #line default
            #line hidden
WriteLiteral("    ");

            
            #line 1017 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
     if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0)
    {
        
            
            #line default
            #line hidden
            
            #line 1019 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
   Write(Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceProfile.Id.ToString(), "DeviceProfile")));

            
            #line default
            #line hidden
            
            #line 1019 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
                                                                                                                                                                                                   
    }

            
            #line default
            #line hidden
WriteLiteral("</div>\r\n");

        }
    }
}
#pragma warning restore 1591
