#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.34014
//
//     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.DocumentTemplate
{
    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;
    
    #line 2 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
    using Disco.BI.DocumentTemplateBI.ManagedGroups;
    
    #line default
    #line hidden
    using Disco.BI.Extensions;
    using Disco.Models.Repository;
    using Disco.Services;
    using Disco.Services.Authorization;
    
    #line 3 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
    using Disco.Services.Interop.ActiveDirectory;
    
    #line default
    #line hidden
    using Disco.Services.Web;
    using Disco.Web;
    
    #line 4 "..\..\Areas\Config\Views\DocumentTemplate\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/DocumentTemplate/Show.cshtml")]
    public partial class Show : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.ShowModel>
    {
        public Show()
        {
        }
        public override void Execute()
        {
            
            #line 5 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
  
    Authorization.Require(Claims.Config.DocumentTemplate.Show);

    var canConfig = Authorization.Has(Claims.Config.DocumentTemplate.Configure);

    var hideAdvanced =
        Model.DocumentTemplate.UsersLinkedGroup == null &&
        Model.DocumentTemplate.DevicesLinkedGroup == null &&
        Model.DocumentTemplate.FilterExpression == null &&
        Model.TemplateExpressions.All(e => e.All(p => !p.ParseError));

    #region Can Bulk Generate
    var canBulkGenerate = Authorization.Has(Claims.Config.DocumentTemplate.BulkGenerate);
    if (canBulkGenerate)
    {
        switch (Model.DocumentTemplate.Scope)
        {
            case DocumentTemplate.DocumentTemplateScopes.Device:
                canBulkGenerate = Authorization.Has(Claims.Device.Actions.GenerateDocuments);
                break;
            case DocumentTemplate.DocumentTemplateScopes.Job:
                canBulkGenerate = Authorization.Has(Claims.Job.Actions.GenerateDocuments);
                break;
            case DocumentTemplate.DocumentTemplateScopes.User:
                canBulkGenerate = Authorization.Has(Claims.User.Actions.GenerateDocuments);
                break;
            default:
                throw new InvalidOperationException("Invalid DocumentType Scope");
        }
    }
    #endregion

    ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), Model.DocumentTemplate.Description);

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

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

WriteAttribute("class", Tuple.Create(" class=\"", 1770), Tuple.Create("\"", 1824)
            
            #line 39 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 1778), Tuple.Create<System.Object, System.Int32>(hideAdvanced ? "Config_HideAdvanced" : null
            
            #line default
            #line hidden
, 1778), false)
);

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

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

WriteLiteral(" style=\"width: 650px; margin: 10px auto 20px;\"");

WriteLiteral(">\r\n        <table>\r\n            <tbody>\r\n                <tr>\r\n                  " +
"  <th>Id:\r\n                    </th>\r\n                    <td>");

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

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

            
            #line 53 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                           Write(Model.StoredInstanceCount.ToString("n0"));

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

            
            #line 53 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                              Write(Model.StoredInstanceCount == 1 ? null : "s");

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

            
            #line 59 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                         if (canConfig)
                        {
                        
            
            #line default
            #line hidden
            
            #line 61 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                   Write(Html.TextBoxFor(model => model.DocumentTemplate.Description));

            
            #line default
            #line hidden
            
            #line 61 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                     
                        
            
            #line default
            #line hidden
            
            #line 62 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                   Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 62 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                               
                        
            
            #line default
            #line hidden
            
            #line 63 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                   Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 63 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                 

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

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

WriteLiteral(@">
                            $(function () {
                                var $Description = $('#DocumentTemplate_Description');
                                var $DescriptionAjaxSave = $Description.next('.ajaxSave');
                                $Description
                                        .watermark('Description')
                                        .focus(function () { $Description.select() })
                                        .keydown(function (e) {
                                            $DescriptionAjaxSave.show();
                                            if (e.which == 13) {
                                                $(this).blur();
                                            }
                                        }).blur(function () {
                                            $DescriptionAjaxSave.hide();
                                        })
                                        .change(function () {
                                            $DescriptionAjaxSave.hide();
                                            var $ajaxLoading = $DescriptionAjaxSave.next('.ajaxLoading').show();
                                            var data = { Description: $Description.val() };
                                            $.ajax({
                                                url: '");

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

            
            #line default
            #line hidden
WriteLiteral(@"',
                                                dataType: 'json',
                                                data: data,
                                                success: function (d) {
                                                    if (d == 'OK') {
                                                        $ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
                                                    } else {
                                                        $ajaxLoading.hide();
                                                        alert('Unable to update description: ' + d);
                                                    }
                                                },
                                                error: function (jqXHR, textStatus, errorThrown) {
                                                    alert('Unable to update description: ' + textStatus);
                                                    $ajaxLoading.hide();
                                                }
                                            });
                                        });
                            });
                        </script>
");

            
            #line 103 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                        }
                        else
                        {
                            if (string.IsNullOrEmpty(Model.DocumentTemplate.Description))
                            {

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

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

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

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

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

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

            
            #line 120 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                         if (canConfig)
                        {

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

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

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

WriteLiteral(" ");

            
            #line 122 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                             Write(Model.DocumentTemplate.FlattenForm ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty));

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

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

            
            #line default
            #line hidden
            
            #line 123 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                 

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

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

WriteLiteral(@">
                            $(function () {
                                $('#DocumentTemplate_FlattenForm').click(function () {
                                    var $this = $(this);
                                    var $ajaxLoading = $this.next('.ajaxLoading').show();
                                    var data = { FlattenForm: $this.is(':checked') };
                                    $.getJSON('");

            
            #line 130 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                           Write(Url.Action(MVC.API.DocumentTemplate.UpdateFlattenForm(Model.DocumentTemplate.Id)));

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

            
            #line 141 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                        }
                        else
                        {

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

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

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

WriteLiteral(" ");

            
            #line 144 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                             Write(Model.DocumentTemplate.FlattenForm ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty));

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

            
            #line 145 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                        }

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

            
            #line 152 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                       Write(Model.DocumentTemplate.Scope);

            
            #line default
            #line hidden
WriteLiteral(" Scope</h4>\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>This template is generated from ");

            
            #line 155 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                             Write(Model.DocumentTemplate.Scope);

            
            #line default
            #line hidden
WriteLiteral("s. Any expressions within the Template&nbsp;PDF will be evaluated within the <a");

WriteAttribute("href", Tuple.Create(" href=\"", 8590), Tuple.Create("\"", 8696)
            
            #line 155 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                                                                       , Tuple.Create(Tuple.Create("", 8597), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.DocumentTemplate.ExpressionBrowser())
            
            #line default
            #line hidden
, 8597), false)
, Tuple.Create(Tuple.Create("", 8659), Tuple.Create("#", 8659), true)
            
            #line 155 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                                                                                                                                      , Tuple.Create(Tuple.Create("", 8660), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Scope
            
            #line default
            #line hidden
, 8660), false)
, Tuple.Create(Tuple.Create("", 8691), Tuple.Create("Scope", 8691), true)
);

WriteLiteral(">");

            
            #line 155 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                                                                                                                                                                                                                                                       Write(Model.DocumentTemplate.Scope);

            
            #line default
            #line hidden
WriteLiteral(" Scope</a>.\r\n                            </p>\r\n                        </div>\r\n  " +
"                      <div>\r\n                            <button");

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

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

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

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

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

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

WriteLiteral(" title=\"Change Document Template Scope\"");

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

WriteLiteral(">\r\n");

            
            #line 164 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 164 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                 using (Html.BeginForm(MVC.API.DocumentTemplate.UpdateScope(Model.DocumentTemplate.Id, redirect: true)))
                                {

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

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

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

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

WriteLiteral(">Scope: </label>\r\n                                        <select");

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

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

WriteLiteral(">\r\n");

            
            #line 169 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                            
            
            #line default
            #line hidden
            
            #line 169 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                             foreach (var scope in Model.Scopes)
                                            {

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

WriteAttribute("value", Tuple.Create(" value=\"", 9820), Tuple.Create("\"", 9834)
            
            #line 171 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 9828), Tuple.Create<System.Object, System.Int32>(scope
            
            #line default
            #line hidden
, 9828), false)
);

WriteAttribute("selected", Tuple.Create(" selected=\"", 9835), Tuple.Create("\"", 9906)
            
            #line 171 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
  , Tuple.Create(Tuple.Create("", 9846), Tuple.Create<System.Object, System.Int32>(scope == Model.DocumentTemplate.Scope ? "selected" : null
            
            #line default
            #line hidden
, 9846), false)
);

WriteLiteral(">");

            
            #line 171 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                                                                          Write(scope);

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

            
            #line 172 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                            }

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

            
            #line 175 "..\..\Areas\Config\Views\DocumentTemplate\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>Expressions within the Template PDF may need to be updated to reflect any ch" +
"anges to the Document Template Scope.\r\n                                    </p>\r" +
"\n                                </div>\r\n");

            
            #line 181 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 181 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                 if (Model.DocumentTemplate.UsersLinkedGroup != null || Model.DocumentTemplate.DevicesLinkedGroup != null)
                                {

            
            #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-circle\"");

WriteLiteral(@"></i><strong>Warning:</strong> This Document Template contains Linked Groups, these will be automatically updated to reflect the new Document Template Scope which <strong>may result in undesired behaviour</strong>.
                                        </p>
                                    </div>
");

            
            #line 188 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                }

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

WriteLiteral("                            <script");

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

WriteLiteral(">\r\n                                $(function () {\r\n                             " +
"       var dialog;\r\n\r\n                                    function showDialog() " +
"{\r\n                                        if (dialog == null) {\r\n              " +
"                              dialog = $(\'#Config_DocumentTemplates_Scope_Dialog" +
"\').dialog({\r\n                                                width: 400,\r\n      " +
"                                          resizable: false,\r\n                   " +
"                             modal: true,\r\n                                     " +
"           autoOpen: false,\r\n                                                but" +
"tons: {\r\n                                                    \'Save Changes\': fun" +
"ction () {\r\n                                                        dialog.dialo" +
"g(\'option\', \'buttons\', null);\r\n                                                 " +
"       dialog.dialog(\'disable\');\r\n                                              " +
"          $(\'#Config_DocumentTemplates_Scope_Scope\').closest(\'form\').submit();\r\n" +
"                                                    },\r\n                        " +
"                            \'Cancel\': function () {\r\n                           " +
"                             dialog.dialog(\'close\');\r\n                          " +
"                          }\r\n                                                }\r\n" +
"                                            });\r\n                               " +
"         }\r\n\r\n                                        dialog.dialog(\'open\');\r\n\r\n" +
"                                        return false;\r\n                         " +
"           }\r\n\r\n                                    $(\'#Config_DocumentTemplates" +
"_Scope_Button\').click(showDialog);\r\n                                });\r\n       " +
"                     </script>\r\n");

            
            #line 222 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                        }

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

            
            #line 223 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                         if (Model.DocumentTemplate.Scope == DocumentTemplate.DocumentTemplateScopes.Job)
                        {

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

WriteLiteral("                            <h4>Job Type Filters:</h4>\r\n");

WriteLiteral("                            <div");

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

WriteLiteral(" ");

            
            #line 227 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                       Write(Model.DocumentTemplate.Scope != DocumentTemplate.DocumentTemplateScopes.Job ? "style=\"display: none;\" " : null);

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

            
            #line 229 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 229 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                     if (Model.DocumentTemplate.JobSubTypes.Count > 0)
                                    {

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

            
            #line 232 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                            
            
            #line default
            #line hidden
            
            #line 232 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                             foreach (var jobType in Model.DocumentTemplate.JobSubTypes.GroupBy(jst => jst.JobType).OrderBy(jtg => jtg.Key.Description))
                                            {

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

WriteLiteral("                                                    ");

            
            #line 235 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                               Write(jobType.Key.Description);

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

            
            #line 237 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                        
            
            #line default
            #line hidden
            
            #line 237 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                         if (jobType.Count() == Model.JobTypes.FirstOrDefault(jt => jt.Id == jobType.Key.Id).JobSubTypes.Count)
                                                        {

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

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

WriteLiteral(">[All Sub Types]</span></li>\r\n");

            
            #line 240 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                        }
                                                        else
                                                        {
                                                            foreach (var jobSubType in jobType)
                                                            {

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

            
            #line 245 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                           Write(jobSubType.Description);

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

            
            #line 246 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                            }
                                                        }

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

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

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

            
            #line 252 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                    }
                                    else
                                    {

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

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

WriteLiteral(">&lt;No Filter&gt;</span>\r\n");

            
            #line 256 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                    }

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

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

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

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

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

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

WriteLiteral(">Update</a>\r\n");

WriteLiteral("                                    <div");

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

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

WriteLiteral(" title=\"Job Type Filter\"");

WriteLiteral(">\r\n");

            
            #line 262 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                        
            
            #line default
            #line hidden
            
            #line 262 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                         using (Html.BeginForm(MVC.API.DocumentTemplate.UpdateJobSubTypes(Model.DocumentTemplate.Id, null, true)))
                                        {
                                            var selectedTypes = Model.DocumentTemplate.JobSubTypes.Select(jst => jst.JobType).Distinct().ToList();
                                            foreach (var jt in Model.JobTypes)
                                            {

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

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

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

WriteAttribute("id", Tuple.Create(" id=\"", 16550), Tuple.Create("\"", 16569)
, Tuple.Create(Tuple.Create("", 16555), Tuple.Create("Types_", 16555), true)
            
            #line 269 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 16561), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 16561), false)
);

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

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

WriteAttribute("value", Tuple.Create(" value=\"", 16602), Tuple.Create("\"", 16618)
            
            #line 269 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                      , Tuple.Create(Tuple.Create("", 16610), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 16610), false)
);

WriteLiteral(" ");

            
            #line 269 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                                                            Write(selectedTypes.Contains(jt) ? "checked=\"checked\"" : null);

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

WriteAttribute("for", Tuple.Create(" for=\"", 16689), Tuple.Create("\"", 16709)
, Tuple.Create(Tuple.Create("", 16695), Tuple.Create("Types_", 16695), true)
            
            #line 269 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                                                                 , Tuple.Create(Tuple.Create("", 16701), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 16701), false)
);

WriteLiteral(">");

            
            #line 269 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                                                                                                                                                      Write(jt.Description);

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

WriteAttribute("id", Tuple.Create(" id=\"", 16793), Tuple.Create("\"", 16815)
, Tuple.Create(Tuple.Create("", 16798), Tuple.Create("SubTypes_", 16798), true)
            
            #line 270 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 16807), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 16807), false)
);

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

WriteLiteral(">\r\n");

WriteLiteral("                                                    ");

            
            #line 271 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                               Write(CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id), "div"));

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

WriteLiteral("                                                    ");

            
            #line 272 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                               Write(CommonHelpers.CheckBoxList("JobSubTypes", jt.JobSubTypes.OrderBy(jst => jst.Description).ToSelectListItems(Model.DocumentTemplate.JobSubTypes), 2));

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

            
            #line 275 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                            }
                                        }

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

WriteLiteral("                                    <script>\r\n                                   " +
"     (function () {\r\n                                            var dialog;\r\n\r\n" +
"                                            function showDialog() {\r\n           " +
"                                     if (!dialog) {\r\n                           " +
"                         dialog = $(\'#Config_DocumentTemplates_JobSubTypes_Updat" +
"e_Dialog\').dialog({\r\n                                                        res" +
"izable: false,\r\n                                                        modal: t" +
"rue,\r\n                                                        autoOpen: false,\r\n" +
"                                                        width: 750,\r\n           " +
"                                             height: 620,\r\n                     " +
"                                   buttons: {\r\n                                 " +
"                           \"Save Changes\": saveChanges,\r\n                       " +
"                                     Cancel: cancel\r\n                           " +
"                             }\r\n                                                " +
"    });\r\n\r\n                                                    dialog.find(\'.job" +
"SubTypes\').hide();\r\n                                                    dialog.o" +
"n(\'change\', \'input.jobType\', function () {\r\n                                    " +
"                    var $this = $(this);\r\n                                      " +
"                  if ($this.is(\':checked\'))\r\n                                   " +
"                         $(\'#SubTypes_\' + $this.val()).slideDown(\'fast\');\r\n     " +
"                                                   else\r\n                       " +
"                                     $(\'#SubTypes_\' + $this.val()).slideUp(\'fast" +
"\');\r\n                                                    }).find(\'input.jobType:" +
"checked\').each(function () {\r\n                                                  " +
"      $(\'#SubTypes_\' + $(this).val()).show();\r\n                                 " +
"                   });\r\n                                                }\r\n\r\n   " +
"                                             dialog.dialog(\'open\');\r\n\r\n         " +
"                                       return false;\r\n                          " +
"                  }\r\n\r\n                                            function canc" +
"el() {\r\n                                                dialog.dialog(\"disable\")" +
";\r\n                                                dialog.dialog(\"option\", \"butt" +
"ons\", null);\r\n\r\n                                                // Refresh Page\r" +
"\n                                                window.location.href = window.l" +
"ocation.href;\r\n                                            }\r\n\r\n                " +
"                            function saveChanges() {\r\n                          " +
"                      var form = dialog.find(\'form\');\r\n\r\n                       " +
"                         $(\'input.jobType:unchecked\').each(function () {\r\n      " +
"                                              $(\'#SubTypes_\' + $(this).val()).fi" +
"nd(\'input\').prop(\'checked\', false);\r\n                                           " +
"     });\r\n\r\n                                                form.submit();\r\n\r\n  " +
"                                              dialog.dialog(\"disable\");\r\n       " +
"                                         dialog.dialog(\"option\", \"buttons\", null" +
");\r\n                                            }\r\n\r\n                           " +
"                 $(function () {\r\n                                              " +
"  $(\'#Config_DocumentTemplates_JobSubTypes_Update\').click(showDialog);\r\n        " +
"                                    });\r\n\r\n                                     " +
"   })();\r\n                                    </script>\r\n");

            
            #line 340 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                }

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

            
            #line 342 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                        }

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

WriteLiteral("                        ");

            
            #line 349 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                   Write(Html.ActionLinkSmallButton("Download Template", MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id)));

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

            
            #line 350 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 350 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                         if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.Upload))
                        {

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

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

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

WriteLiteral(">Replace Template</button>\r\n");

WriteLiteral("                            <div");

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

WriteLiteral(" title=\"Replace Document PDF Template\"");

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

WriteLiteral(">\r\n                                <h4>Select a PDF Template to upload:</h4>\r\n   " +
"                             <div>\r\n");

            
            #line 356 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 356 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                     using (Html.BeginForm(MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
                                    {

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

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

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

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

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

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

            
            #line 359 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                    }

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

WriteLiteral("                            <script");

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

WriteLiteral(">\r\n                                $(function () {\r\n                             " +
"       var dialog, template;\r\n\r\n                                    function sho" +
"wDialog() {\r\n                                        if (dialog == null) {\r\n    " +
"                                        template = $(\'#Config_DocumentTemplates_" +
"TemplatePdf_Template\');\r\n\r\n                                            dialog = " +
"$(\'#Config_DocumentTemplates_TemplatePdf_Dialog\').dialog({\r\n                    " +
"                            width: 350,\r\n                                       " +
"         resizable: false,\r\n                                                moda" +
"l: true,\r\n                                                autoOpen: false,\r\n    " +
"                                            buttons: {\r\n                        " +
"                            \'Upload\': function () {\r\n                           " +
"                             if (template.val() == \'\') {\r\n                      " +
"                                      alert(\'A template file is required to uplo" +
"ad.\');\r\n                                                        } else {\r\n      " +
"                                                      dialog.dialog(\'option\', \'b" +
"uttons\', null);\r\n                                                            dia" +
"log.dialog(\'disable\');\r\n                                                        " +
"    template.closest(\'form\').submit();\r\n                                        " +
"                }\r\n                                                    },\r\n     " +
"                                               \'Cancel\': function () {\r\n        " +
"                                                dialog.dialog(\'close\');\r\n       " +
"                                             }\r\n                                " +
"                }\r\n                                            });\r\n            " +
"                            }\r\n\r\n                                        dialog." +
"dialog(\'open\');\r\n\r\n                                        return false;\r\n      " +
"                              }\r\n\r\n                                    $(\'#Confi" +
"g_DocumentTemplates_TemplatePdf_Button\').click(showDialog);\r\n                   " +
"             });\r\n                            </script>\r\n");

            
            #line 400 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                        }

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

            
            #line 403 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 403 "..\..\Areas\Config\Views\DocumentTemplate\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 419 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                }

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

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

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

WriteLiteral(">\r\n        <h2>Advanced Options</h2>\r\n        <table>\r\n            <tbody>\r\n     " +
"           <tr>\r\n                    <th>Filter Expression:\r\n                   " +
" </th>\r\n                    <td>");

            
            #line 430 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                         if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.ConfigureFilterExpression))
                        {
                        
            
            #line default
            #line hidden
            
            #line 432 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                   Write(Html.TextBoxFor(model => model.DocumentTemplate.FilterExpression));

            
            #line default
            #line hidden
            
            #line 432 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                          
                        
            
            #line default
            #line hidden
            
            #line 433 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                   Write(AjaxHelpers.AjaxRemove());

            
            #line default
            #line hidden
            
            #line 433 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                 
                        
            
            #line default
            #line hidden
            
            #line 434 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                   Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 434 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                 

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

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

WriteLiteral(">\r\n                            $(function () {\r\n                                v" +
"ar $FilterExpression = $(\'#DocumentTemplate_FilterExpression\');\r\n               " +
"                 var $ajaxLoading = $FilterExpression.nextAll(\'.ajaxLoading\').fi" +
"rst();\r\n                                var $ajaxRemove = $FilterExpression.next" +
"All(\'.ajaxRemove\').first();\r\n                                $FilterExpression\r\n" +
"                                        .watermark(\'Filter Expression\')\r\n       " +
"                                 .focus(function () { $FilterExpression.select()" +
" })\r\n                                        .keydown(function (e) {\r\n          " +
"                                  if (e.which == 13) {\r\n                        " +
"                        $(this).blur();\r\n                                       " +
"     }\r\n                                        }).change(function () {\r\n       " +
"                                     updateFilterExpression($FilterExpression.va" +
"l());\r\n                                        });\r\n                            " +
"    if ($FilterExpression.val() != \'\')\r\n                                    $aja" +
"xRemove.show();\r\n                                $ajaxRemove.click(function () {" +
"\r\n                                    updateFilterExpression(\'\');\r\n             " +
"                       $FilterExpression.val(\'\');\r\n                             " +
"   });\r\n                                var updateFilterExpression = function (f" +
"ilterExpression) {\r\n                                    $ajaxLoading.show();\r\n  " +
"                                  $ajaxRemove.hide();\r\n                         " +
"           var data = { FilterExpression: filterExpression };\r\n                 " +
"                   $.ajax({\r\n                                        url: \'");

            
            #line 461 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                         Write(Url.Action(MVC.API.DocumentTemplate.UpdateFilterExpression(Model.DocumentTemplate.Id)));

            
            #line default
            #line hidden
WriteLiteral(@"',
                                        dataType: 'json',
                                        data: data,
                                        success: function (d) {
                                            if (d == 'OK') {
                                                $ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
                                                if (data.FilterExpression != '')
                                                    $ajaxRemove.fadeIn('fast');
                                            } else {
                                                $ajaxLoading.hide();
                                                alert('Unable to update filter expression: ' + d);
                                            }
                                        },
                                        error: function (jqXHR, textStatus, errorThrown) {
                                            alert('Unable to update filter expression: ' + textStatus);
                                            $ajaxLoading.hide();
                                        }
                                    });
                                };
                            });
                        </script>
");

            
            #line 482 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                        }
                        else
                        {
                            if (string.IsNullOrWhiteSpace(Model.DocumentTemplate.FilterExpression))
                            {

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

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

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

            
            #line 488 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                            }
                            else
                            {

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

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

WriteLiteral(">\r\n");

WriteLiteral("                            ");

            
            #line 492 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                       Write(Model.DocumentTemplate.FilterExpression);

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

            
            #line 494 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                            }
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n                <tr>\r\n         " +
"           <th>Linked Groups:\r\n                    </th>\r\n                    <t" +
"d>\r\n                        <div>\r\n");

WriteLiteral("                            ");

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

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

WriteLiteral("                            ");

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

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

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

            
            #line default
            #line hidden
            
            #line 521 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                        
                            }

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

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

WriteLiteral(">\r\n        <h2>Template Expressions</h2>\r\n");

WriteLiteral("        ");

            
            #line 531 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
   Write(Html.Partial(MVC.Config.DocumentTemplate.Views._ExpressionsTable, Model.TemplateExpressions));

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

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

WriteLiteral(" title=\"Delete this Document Template?\"");

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

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

WriteLiteral(@"></i>This item will be permanently deleted and cannot be recovered.<br />
        <em>This <strong>will not delete attachments</strong> which have already been imported,
            but any generated documents will no longer be automatically imported.</em><br />
        Are you sure?
    </p>
</div>
<script");

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

WriteLiteral(@">
    $(function () {
        var button = $('#buttonDelete');
        var buttonDialog = $(""#dialogConfirmDelete"");
        var buttonLink = button.attr('href');
        button.attr('href', '#');
        button.click(function () {
            buttonDialog.dialog('open');
            return false;
        });
        buttonDialog.dialog({
            resizable: false,
            modal: true,
            autoOpen: false,
            buttons: {
                ""Delete"": function () {
                    $this = $(this);
                    $this.dialog('disable');
                    $this.dialog(""option"", ""buttons"", null);
                    window.location.href = buttonLink;
                },
                Cancel: function () {
                    $(this).dialog(""close"");
                }
            }
        });

    });
</script>
<div");

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

WriteLiteral(">\r\n");

            
            #line 572 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
    
            
            #line default
            #line hidden
            
            #line 572 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
     if (Authorization.Has(Claims.Config.Show))
    {
        
            
            #line default
            #line hidden
            
            #line 574 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
   Write(Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser()));

            
            #line default
            #line hidden
            
            #line 574 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                                     
    }

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

            
            #line 576 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
     if (canBulkGenerate)
    {

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

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

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

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

WriteLiteral(">Bulk Generate</a>\r\n");

WriteLiteral("        <div");

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

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

WriteAttribute("title", Tuple.Create(" title=\"", 33929), Tuple.Create("\"", 33980)
, Tuple.Create(Tuple.Create("", 33937), Tuple.Create("Bulk", 33937), true)
, Tuple.Create(Tuple.Create(" ", 33941), Tuple.Create("Generate:", 33942), true)
            
            #line 579 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create(" ", 33951), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Id
            
            #line default
            #line hidden
, 33952), false)
);

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

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

WriteLiteral(">\r\n                <div>\r\n                    Enter multiple <span");

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

WriteLiteral("></span>&nbsp;separated by <code>&lt;new line&gt;</code>, commas (<code>,</code>)" +
" or semicolons (<code>;</code>).\r\n                </div>\r\n                <div");

WriteLiteral(" class=\"examples clearfix\"");

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

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

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

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

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

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

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

            
            #line 591 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
            
            
            #line default
            #line hidden
            
            #line 591 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
             using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id), FormMethod.Post))
            {

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

WriteLiteral(" class=\"field-validation-valid\"");

WriteLiteral(" data-valmsg-replace=\"true\"");

WriteLiteral(" data-valmsg-for=\"DataIds\"");

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

WriteLiteral("                <textarea");

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

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

WriteLiteral(" data-val=\"true\"");

WriteLiteral(" data-val-required=\"Identifiers are required\"");

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

            
            #line 595 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
            }

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

            
            #line 597 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"


            
            #line default
            #line hidden
WriteLiteral("        <script>\r\n            $(function () {\r\n                var dialog;\r\n\r\n   " +
"             $(\'#buttonBulkGenerate\').click(function () {\r\n                    i" +
"f (!dialog) {\r\n                        dialog = $(\'#dialogBulkGenerate\').dialog(" +
"{\r\n                            resizable: false,\r\n                            mo" +
"dal: true,\r\n                            autoOpen: false,\r\n                      " +
"      width: 460,\r\n                            buttons: {\r\n                     " +
"           \"Bulk Generate\": function () {\r\n                                    d" +
"ialog.find(\'form\').submit();\r\n                                    dialog.dialog(" +
"\"disable\");\r\n                                },\r\n                               " +
" Close: function () {\r\n                                    $(this).dialog(\"close" +
"\");\r\n                                }\r\n                            }\r\n         " +
"               });\r\n\r\n                        $.validator.unobtrusive.reparse(\'#" +
"inputBulkGenerateDataIds\');\r\n                    }\r\n\r\n                    switch" +
" ($(\'#DocumentTemplate_Scope\').val()) {\r\n                        case \'Device\':\r" +
"\n                            dialog.find(\'.scopeDescBulkGenerate\').text(\'Device " +
"Serial Numbers\');\r\n                            dialog.find(\'.example1\').html(\'01" +
"234567<br />ABCD9876<br />8VQ6G2R\');\r\n                            dialog.find(\'." +
"example2\').text(\'01234567,ABCD9876,8VQ6G2R\');\r\n                            dialo" +
"g.find(\'.example3\').text(\'01234567;ABCD9876;8VQ6G2R\');\r\n                        " +
"    break;\r\n                        case \'Job\':\r\n                            dia" +
"log.find(\'.scopeDescBulkGenerate\').text(\'Job Ids\');\r\n                           " +
" dialog.find(\'.example1\').html(\'86<br />99<br />44\');\r\n                         " +
"   dialog.find(\'.example2\').text(\'86,99,44\');\r\n                            dialo" +
"g.find(\'.example3\').text(\'86;99;44\');\r\n                            break;\r\n     " +
"                   case \'User\':\r\n                            dialog.find(\'.scope" +
"DescBulkGenerate\').text(\'User Ids\');\r\n                            dialog.find(\'." +
"example1\').html(\'user6<br />smi0099<br />");

            
            #line 638 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                               Write(ActiveDirectory.Context.PrimaryDomain.NetBiosName);

            
            #line default
            #line hidden
WriteLiteral("\\\\rsmith\');\r\n                            dialog.find(\'.example2\').text(\'user6,smi" +
"0099,");

            
            #line 639 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                     Write(ActiveDirectory.Context.PrimaryDomain.NetBiosName);

            
            #line default
            #line hidden
WriteLiteral("\\\\rsmith\');\r\n                            dialog.find(\'.example3\').text(\'user6;smi" +
"0099;");

            
            #line 640 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                     Write(ActiveDirectory.Context.PrimaryDomain.NetBiosName);

            
            #line default
            #line hidden
WriteLiteral("\\\\rsmith\');\r\n                            break;\r\n                    }\r\n\r\n       " +
"             dialog.dialog(\'open\');\r\n                    return false;\r\n        " +
"        });\r\n            });\r\n        </script>\r\n");

            
            #line 649 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
    }

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

            
            #line 650 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
     if (Authorization.Has(Claims.Config.DocumentTemplate.Delete))
    {
        
            
            #line default
            #line hidden
            
            #line 652 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
   Write(Html.ActionLinkButton("Delete", MVC.API.DocumentTemplate.Delete(Model.DocumentTemplate.Id, true), "buttonDelete"));

            
            #line default
            #line hidden
            
            #line 652 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                                                          
    }

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

        }
    }
}
#pragma warning restore 1591
