#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.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;
    using Disco.Models.Repository;
    using Disco.Services;
    using Disco.Services.Authorization;
    
    #line 2 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
    using Disco.Services.Documents.ManagedGroups;
    
    #line default
    #line hidden
    
    #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.DocumentTemplate.OnGenerateExpression == null &&
        Model.DocumentTemplate.OnImportAttachmentExpression == null &&
        Model.TemplateExpressions.All(e => e.All(p => !p.ParseError) &&
        !Model.OnImportUserFlagRules.Any());

    #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);

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

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

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

WriteAttribute("class", Tuple.Create(" class=\"", 2071), Tuple.Create("\"", 2126)
            
            #line 47 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 2079), Tuple.Create<System.Object, System.Int32>(hideAdvanced ? " Config_HideAdvanced" : null
            
            #line default
            #line hidden
, 2079), 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>\r\n                        Id:\r\n                    </th>\r\n                " +
"    <td>\r\n                        <code>");

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

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

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

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

            
            #line 64 "..\..\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>\r\n                        Description:\r\n                    </t" +
"h>\r\n                    <td>\r\n");

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

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

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

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

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

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

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

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

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

            
            #line 87 "..\..\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 93 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                            }
                            else
                            {
                                
            
            #line default
            #line hidden
            
            #line 96 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                           Write(Model.DocumentTemplate.Description);

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

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

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

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

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

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

WriteLiteral(" ");

            
            #line 109 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                  Write(Model.DocumentTemplate.IsHidden ? new MvcHtmlString("checked=\"checked\" ") : null);

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

WriteLiteral("                                <label");

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

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

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

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

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

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

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

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

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

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

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

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

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

WriteLiteral(" ");

            
            #line 125 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                  Write(Model.DocumentTemplate.IsHidden ? new MvcHtmlString("checked=\"checked\" ") : null);

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

WriteLiteral("                                <label");

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

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

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

            
            #line default
            #line hidden
WriteLiteral("                        </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>If selected the template will not appear in the list of documents to generate.
                            </p>
                        </div>
                    </td>
                </tr>
                <tr>
                    <th>
                        Scope:
                    </th>
                    <td>
                        <h4>");

            
            #line 141 "..\..\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 144 "..\..\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=\"", 6951), Tuple.Create("\"", 7042)
            
            #line 144 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                                                                       , Tuple.Create(Tuple.Create("", 6958), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Expressions.Browser())
            
            #line default
            #line hidden
, 6958), false)
, Tuple.Create(Tuple.Create("", 7005), Tuple.Create("#", 7005), true)
            
            #line 144 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                                                                                                                       , Tuple.Create(Tuple.Create("", 7006), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Scope
            
            #line default
            #line hidden
, 7006), false)
, Tuple.Create(Tuple.Create("", 7037), Tuple.Create("Scope", 7037), true)
);

WriteLiteral(">");

            
            #line 144 "..\..\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 150 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 150 "..\..\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 153 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 153 "..\..\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 158 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                            
            
            #line default
            #line hidden
            
            #line 158 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                             foreach (var scope in Model.Scopes)
                                            {

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

WriteAttribute("value", Tuple.Create(" value=\"", 8166), Tuple.Create("\"", 8180)
            
            #line 160 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 8174), Tuple.Create<System.Object, System.Int32>(scope
            
            #line default
            #line hidden
, 8174), false)
);

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

WriteLiteral(">");

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

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

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

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

            
            #line 164 "..\..\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 170 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 170 "..\..\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 177 "..\..\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 211 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                        }

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

            
            #line 212 "..\..\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(">\r\n                                <div>\r\n");

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

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

            
            #line 221 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                            
            
            #line default
            #line hidden
            
            #line 221 "..\..\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 224 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                               Write(jobType.Key.Description);

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

            
            #line 226 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                        
            
            #line default
            #line hidden
            
            #line 226 "..\..\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 229 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                        }
                                                        else
                                                        {
                                                            foreach (var jobSubType in jobType)
                                                            {

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

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

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

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

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

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

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

            
            #line 241 "..\..\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 245 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                    }

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

            
            #line 247 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 247 "..\..\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 251 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                        
            
            #line default
            #line hidden
            
            #line 251 "..\..\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=\"", 14794), Tuple.Create("\"", 14813)
, Tuple.Create(Tuple.Create("", 14799), Tuple.Create("Types_", 14799), true)
            
            #line 258 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 14805), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 14805), false)
);

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

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

WriteAttribute("value", Tuple.Create(" value=\"", 14846), Tuple.Create("\"", 14862)
            
            #line 258 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                          , Tuple.Create(Tuple.Create("", 14854), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 14854), false)
);

WriteLiteral(" ");

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

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

WriteAttribute("for", Tuple.Create(" for=\"", 14934), Tuple.Create("\"", 14954)
, Tuple.Create(Tuple.Create("", 14940), Tuple.Create("Types_", 14940), true)
            
            #line 258 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                                                                      , Tuple.Create(Tuple.Create("", 14946), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 14946), false)
);

WriteLiteral(">");

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

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

WriteAttribute("id", Tuple.Create(" id=\"", 15096), Tuple.Create("\"", 15118)
, Tuple.Create(Tuple.Create("", 15101), Tuple.Create("SubTypes_", 15101), true)
            
            #line 260 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 15110), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 15110), false)
);

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

WriteLiteral(">\r\n");

WriteLiteral("                                                        ");

            
            #line 261 "..\..\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 262 "..\..\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 265 "..\..\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: 580,\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.reload(true);\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()).find(\'input\').pro" +
"p(\'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_Do" +
"cumentTemplates_JobSubTypes_Update\').click(showDialog);\r\n                       " +
"                     });\r\n\r\n                                        })();\r\n     " +
"                               </script>\r\n");

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

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

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

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

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

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

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

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

WriteLiteral(" ");

            
            #line 343 "..\..\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");

WriteLiteral("                                <label");

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

WriteLiteral(">Flatten Form</label>\r\n");

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

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

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

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

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

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

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

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

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

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

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

WriteLiteral(" ");

            
            #line 359 "..\..\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");

WriteLiteral("                                <label");

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

WriteLiteral(">Flatten Form</label>\r\n");

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

            
            #line default
            #line hidden
WriteLiteral("                        </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 a document is generated all form elements will be removed and their content written in place if this option is selected.
                            </p>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>

    <div");

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

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

WriteLiteral(">\r\n        <h2>PDF Template</h2>\r\n        <table>\r\n            <tbody>\r\n         " +
"       <tr>\r\n                    <td>\r\n                        <div");

WriteLiteral(" style=\"margin: -8px -5px; height: 350px; overflow-y: scroll; text-align: center;" +
"\"");

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

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

WriteAttribute("src", Tuple.Create(" src=\"", 22201), Tuple.Create("\"", 22287)
            
            #line 381 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 22207), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DocumentTemplate.TemplatePreview(Model.DocumentTemplate.Id))
            
            #line default
            #line hidden
, 22207), false)
);

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

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

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

            
            #line 389 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 389 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                             if (Model.TemplatePagesHaveAttachmentId.Any(i => !i))
                            {

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

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

WriteLiteral(">\r\n");

            
            #line 392 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 392 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                     for (int i = 0; i < Model.TemplatePagesHaveAttachmentId.Count; i++)
                                    {
                                        if (!Model.TemplatePagesHaveAttachmentId[i])
                                        {

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

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

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

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

WriteLiteral("></i>Note: Page ");

            
            #line 397 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                            Write(i + 1);

            
            #line default
            #line hidden
WriteLiteral(" does not have a <code>DiscoAttachmentId</code> field.\r\n                         " +
"                   </p>\r\n");

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

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

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

WriteLiteral(@">
                                        The <code>DiscoAttachmentId</code> field is replaced with a unique QR Code which identifies the page when it is imported back into Disco ICT.
                                    </p>
                                </div>
");

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

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

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

WriteLiteral(">\r\n");

WriteLiteral("                                ");

            
            #line 407 "..\..\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 408 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 408 "..\..\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 414 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                            
            
            #line default
            #line hidden
            
            #line 414 "..\..\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(" accept=\".pdf\"");

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

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

            
            #line 417 "..\..\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 showDialog() {\r\n                                           " +
"     if (dialog == null) {\r\n                                                    " +
"template = $(\'#Config_DocumentTemplates_TemplatePdf_Template\');\r\n\r\n             " +
"                                       dialog = $(\'#Config_DocumentTemplates_Tem" +
"platePdf_Dialog\').dialog({\r\n                                                    " +
"    width: 350,\r\n                                                        resizab" +
"le: false,\r\n                                                        modal: true," +
"\r\n                                                        autoOpen: false,\r\n    " +
"                                                    buttons: {\r\n                " +
"                                            \'Upload\': function () {\r\n           " +
"                                                     if (template.val() == \'\') {" +
"\r\n                                                                    alert(\'A t" +
"emplate file is required to upload.\');\r\n                                        " +
"                        } else {\r\n                                              " +
"                      dialog.dialog(\'option\', \'buttons\', null);\r\n               " +
"                                                     dialog.dialog(\'disable\');\r\n" +
"                                                                    template.clo" +
"sest(\'form\').submit();\r\n                                                        " +
"        }\r\n                                                            },\r\n     " +
"                                                       \'Cancel\': function () {\r\n" +
"                                                                dialog.dialog(\'c" +
"lose\');\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 458 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                }

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

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

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n\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>\r\n                        Filter Expres" +
"sion:\r\n                    </th>\r\n                    <td>\r\n");

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

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

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

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

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

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

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

WriteLiteral(@">
                                $(function () {
                                    var field = $('#DocumentTemplate_FilterExpression');
                                    var fieldRemove = field.next('.ajaxRemove');
                                    var fieldOriginalWidth, fieldOriginalHeight;

                                    document.DiscoFunctions.PropertyChangeHelper(
                                        field,
                                        'None',
                                        '");

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

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                        \'FilterExpression\'\r\n                 " +
"                   );\r\n\r\n                                    field.focus(functio" +
"n () {\r\n                                        fieldOriginalWidth = field.width" +
"();\r\n                                        fieldOriginalHeight = field.height(" +
");\r\n                                        field.css(\'overflow\', \'visible\').ani" +
"mate({ width: field.parent().width() - 42, height: 75 }, 200);\r\n                " +
"                    }).blur(function () {\r\n                                     " +
"   field.css(\'overflow\', \'hidden\').animate({ width: fieldOriginalWidth, height: " +
"fieldOriginalHeight }, 200);\r\n                                    }).change(func" +
"tion () {\r\n                                        if (!!field.val()) {\r\n       " +
"                                     fieldRemove.show();\r\n                      " +
"                  } else {\r\n                                            fieldRem" +
"ove.hide();\r\n                                        }\r\n                        " +
"            }).attr(\'placeholder\', \'None\').attr(\'spellcheck\', \'false\');\r\n\r\n     " +
"                               fieldRemove.click(function () {\r\n                " +
"                        field.val(\'\').change();\r\n                               " +
"     });\r\n\r\n                                    if (!!field.val()) {\r\n          " +
"                              fieldRemove.show();\r\n                             " +
"       } else {\r\n                                        fieldRemove.hide();\r\n  " +
"                                  }\r\n                                });\r\n      " +
"                      </script>\r\n");

            
            #line 520 "..\..\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 526 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                            }
                            else
                            {

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

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

WriteLiteral(">\r\n");

WriteLiteral("                                    ");

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

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

            
            #line 532 "..\..\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-fw fa-info-circle\"");

WriteLiteral(@"></i>This expression will be evaluated to determine if this template is shown in the <em>Generate Document</em> drop-down list. If the template is hidden (see above) this expression is ignored.
                            </p>
                        </div>
                    </td>
                </tr>
                <tr>
                    <th>
                        On Generated Expression:
                    </th>
                    <td>
");

            
            #line 546 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 546 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                         if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.ConfigureFilterExpression))
                        {
                            
            
            #line default
            #line hidden
            
            #line 548 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                       Write(Html.EditorFor(model => model.DocumentTemplate.OnGenerateExpression));

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

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

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

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

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

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

WriteLiteral(@">
                                $(function () {
                                    var field = $('#DocumentTemplate_OnGenerateExpression');
                                    var fieldRemove = field.next('.ajaxRemove');
                                    var fieldOriginalWidth, fieldOriginalHeight;

                                    document.DiscoFunctions.PropertyChangeHelper(
                                        field,
                                        'None',
                                        '");

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

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                        \'OnGenerateExpression\'\r\n             " +
"                       );\r\n\r\n                                    field.focus(fun" +
"ction () {\r\n                                        fieldOriginalWidth = field.w" +
"idth();\r\n                                        fieldOriginalHeight = field.hei" +
"ght();\r\n                                        field.css(\'overflow\', \'visible\')" +
".animate({ width: field.parent().width() - 42, height: 75 }, 200);\r\n            " +
"                        }).blur(function () {\r\n                                 " +
"       field.css(\'overflow\', \'hidden\').animate({ width: fieldOriginalWidth, heig" +
"ht: fieldOriginalHeight }, 200);\r\n                                    }).change(" +
"function () {\r\n                                        if (!!field.val()) {\r\n   " +
"                                         fieldRemove.show();\r\n                  " +
"                      } else {\r\n                                            fiel" +
"dRemove.hide();\r\n                                        }\r\n                    " +
"                }).attr(\'placeholder\', \'None\').attr(\'spellcheck\', \'false\');\r\n\r\n " +
"                                   fieldRemove.click(function () {\r\n            " +
"                            field.val(\'\').change();\r\n                           " +
"         });\r\n\r\n                                    if (!!field.val()) {\r\n      " +
"                                  fieldRemove.show();\r\n                         " +
"           } else {\r\n                                        fieldRemove.hide();" +
"\r\n                                    }\r\n                                });\r\n  " +
"                          </script>\r\n");

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

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

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

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

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

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

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

WriteLiteral(">\r\n");

WriteLiteral("                                    ");

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

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

            
            #line 602 "..\..\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-fw fa-info-circle\"");

WriteLiteral(@"></i>This expression will be evaluated each time a document is generated from this template.
                            </p>
                        </div>
                    </td>
                </tr>
                <tr>
                    <th>
                        On Import Expression:
                    </th>
                    <td>
");

            
            #line 616 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 616 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                         if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.ConfigureFilterExpression))
                        {
                            
            
            #line default
            #line hidden
            
            #line 618 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                       Write(Html.EditorFor(model => model.DocumentTemplate.OnImportAttachmentExpression));

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

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

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

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

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

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

WriteLiteral(@">
                                $(function () {
                                    var field = $('#DocumentTemplate_OnImportAttachmentExpression');
                                    var fieldRemove = field.next('.ajaxRemove');
                                    var fieldOriginalWidth, fieldOriginalHeight;

                                    document.DiscoFunctions.PropertyChangeHelper(
                                        field,
                                        'None',
                                        '");

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

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                        \'OnImportAttachmentExpression\'\r\n     " +
"                               );\r\n\r\n                                    field.f" +
"ocus(function () {\r\n                                        fieldOriginalWidth =" +
" field.width();\r\n                                        fieldOriginalHeight = f" +
"ield.height();\r\n                                        field.css(\'overflow\', \'v" +
"isible\').animate({ width: field.parent().width() - 42, height: 75 }, 200);\r\n    " +
"                                }).blur(function () {\r\n                         " +
"               field.css(\'overflow\', \'hidden\').animate({ width: fieldOriginalWid" +
"th, height: fieldOriginalHeight }, 200);\r\n                                    })" +
".change(function () {\r\n                                        if (!!field.val()" +
") {\r\n                                            fieldRemove.show();\r\n          " +
"                              } else {\r\n                                        " +
"    fieldRemove.hide();\r\n                                        }\r\n            " +
"                        }).attr(\'placeholder\', \'None\').attr(\'spellcheck\', \'false" +
"\');\r\n\r\n                                    fieldRemove.click(function () {\r\n    " +
"                                    field.val(\'\').change();\r\n                   " +
"                 });\r\n\r\n                                    if (!!field.val()) {" +
"\r\n                                        fieldRemove.show();\r\n                 " +
"                   } else {\r\n                                        fieldRemove" +
".hide();\r\n                                    }\r\n                               " +
" });\r\n                            </script>\r\n");

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

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

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

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

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

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

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

WriteLiteral(">\r\n");

WriteLiteral("                                    ");

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

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

            
            #line 672 "..\..\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-fw fa-info-circle\"");

WriteLiteral(@"></i>This expression will be evaluated each time a document is imported (as an attachment) where it is determined the document was based on this template.
                            </p>
                        </div>
                    </td>
                </tr>
                <tr>
                    <th>
                        On Import <br /> User Flag Rules:
                    </th>
                    <td>
");

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

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

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

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

WriteLiteral(@">
                                <thead>
                                    <tr>
                                        <td>Action</td>
                                        <td>User Flag</td>
                                        <td>Comments</td>
                                        <td>&nbsp;</td>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr");

WriteAttribute("class", Tuple.Create(" class=\"", 40562), Tuple.Create("\"", 40624)
            
            #line 698 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 40570), Tuple.Create<System.Object, System.Int32>(Model.OnImportUserFlagRules.Any() ? "hidden" : null
            
            #line default
            #line hidden
, 40570), false)
);

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

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

WriteLiteral("><span");

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

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

            
            #line 701 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 701 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                     foreach (var rule in Model.OnImportUserFlagRules)
                                    {

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

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

            
            #line 703 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                Write(rule.Id);

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

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

            
            #line 704 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                            Write(rule.AddFlag ? "Assign" : "Remove");

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

WriteAttribute("class", Tuple.Create(" class=\"", 41174), Tuple.Create("\"", 41245)
, Tuple.Create(Tuple.Create("", 41182), Tuple.Create("fa", 41182), true)
, Tuple.Create(Tuple.Create(" ", 41184), Tuple.Create("fa-", 41185), true)
            
            #line 706 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 41188), Tuple.Create<System.Object, System.Int32>(rule.UserFlag.Icon
            
            #line default
            #line hidden
, 41188), false)
, Tuple.Create(Tuple.Create(" ", 41209), Tuple.Create("fa-lg", 41210), true)
, Tuple.Create(Tuple.Create(" ", 41215), Tuple.Create("d-", 41216), true)
            
            #line 706 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
              , Tuple.Create(Tuple.Create("", 41218), Tuple.Create<System.Object, System.Int32>(rule.UserFlag.IconColour
            
            #line default
            #line hidden
, 41218), false)
);

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

            
            #line 707 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                
            
            #line default
            #line hidden
            
            #line 707 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                 if (Authorization.Has(Claims.Config.UserFlag.Configure))
                                                {

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

            
            #line 709 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                     Write(Html.ActionLink(rule.UserFlag.Name, MVC.Config.UserFlag.Index(rule.UserFlag.Id)));

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

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

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

            
            #line 713 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                     Write(rule.UserFlag.Name);

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

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

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

            
            #line 717 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                
            
            #line default
            #line hidden
            
            #line 717 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                 if (string.IsNullOrWhiteSpace(rule.Comments))
                                                {

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

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

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

WriteLiteral(" class=\"whitespace-pre-wrap\"");

WriteLiteral(">");

            
            #line 723 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                 Write(rule.Comments);

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

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

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

WriteLiteral(" class=\"fa fa-times-circle fa-lg ajaxRemove\"");

WriteLiteral(" title=\"Remove\"");

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

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

WriteLiteral(" title=\"Loading...\"");

WriteLiteral("></i>\r\n                                            </td>\r\n                       " +
"                 </tr>\r\n");

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

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

            
            #line 734 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                            using (Html.BeginForm(MVC.API.DocumentTemplate.RemoveOnImportUserFlagRule(Model.DocumentTemplate.Id), FormMethod.Post, new { id = "DocumentTemplate_OnImportUserFlagRules_Remove" }))
                            {
                                
            
            #line default
            #line hidden
            
            #line 736 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                           Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
            
            #line 736 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                        
                                
            
            #line default
            #line hidden
            
            #line 737 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                           Write(Html.Hidden("ruleId", ""));

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

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

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

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

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

WriteLiteral(">Add User Flag Rule</a>\r\n");

WriteLiteral("                            <div");

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

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

WriteAttribute("title", Tuple.Create(" title=\"", 43656), Tuple.Create("\"", 43718)
, Tuple.Create(Tuple.Create("", 43664), Tuple.Create("On", 43664), true)
, Tuple.Create(Tuple.Create(" ", 43666), Tuple.Create("Import", 43667), true)
, Tuple.Create(Tuple.Create(" ", 43673), Tuple.Create("User", 43674), true)
, Tuple.Create(Tuple.Create(" ", 43678), Tuple.Create("Flag", 43679), true)
, Tuple.Create(Tuple.Create(" ", 43683), Tuple.Create("Rule:", 43684), true)
            
            #line 740 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                            , Tuple.Create(Tuple.Create(" ", 43689), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Id
            
            #line default
            #line hidden
, 43690), false)
);

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

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

WriteLiteral(">\r\n");

            
            #line 742 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 742 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                     switch (Model.DocumentTemplate.Scope)
                                    {
                                        case "Device":

            
            #line default
            #line hidden
WriteLiteral("                                            <div>\r\n                              " +
"                  The user flag will be created/removed against the devices assi" +
"gned user.\r\n                                            </div>\r\n");

            
            #line 748 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                            break;
                                        case "Job":

            
            #line default
            #line hidden
WriteLiteral("                                            <div>\r\n                              " +
"                  The user flag will be created/removed against the jobs associa" +
"ted user.\r\n                                            </div>\r\n");

            
            #line 753 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                            break;
                                        case "User":

            
            #line default
            #line hidden
WriteLiteral("                                            <div>\r\n                              " +
"                  The user flag will be created/removed against the user.\r\n     " +
"                                       </div>\r\n");

            
            #line 758 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                            break;
                                    }

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

            
            #line 761 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 761 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                 using (Html.BeginForm(MVC.API.DocumentTemplate.AddOnImportUserFlagRule(Model.DocumentTemplate.Id), FormMethod.Post))
                                {
                                    
            
            #line default
            #line hidden
            
            #line 763 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                               Write(Html.AntiForgeryToken());

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

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

WriteLiteral(" class=\"distribute-evenly\"");

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

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

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

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

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

WriteLiteral(" checked /><label");

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

WriteLiteral(">Assign User Flag</label>\r\n                                        </span>\r\n     " +
"                                   <span>\r\n                                     " +
"       <input");

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

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

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

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

WriteLiteral(" /><label");

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

WriteLiteral(">Remove User Flag</label>\r\n                                        </span>\r\n     " +
"                               </div>\r\n");

WriteLiteral("                                    <div");

WriteLiteral(" class=\"dialog-item-picker\"");

WriteLiteral(">\r\n");

            
            #line 773 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                        
            
            #line default
            #line hidden
            
            #line 773 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                         foreach (var flag in Model.UserFlags)
                                        {

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

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

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

WriteAttribute("id", Tuple.Create(" id=\"", 46296), Tuple.Create("\"", 46357)
, Tuple.Create(Tuple.Create("", 46301), Tuple.Create("DocumentTemplate_OnImportUserFlagRules_Add_Flag_", 46301), true)
            
            #line 776 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                          , Tuple.Create(Tuple.Create("", 46349), Tuple.Create<System.Object, System.Int32>(flag.Id
            
            #line default
            #line hidden
, 46349), false)
);

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

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

WriteAttribute("value", Tuple.Create(" value=\"", 46389), Tuple.Create("\"", 46405)
            
            #line 776 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                          , Tuple.Create(Tuple.Create("", 46397), Tuple.Create<System.Object, System.Int32>(flag.Id
            
            #line default
            #line hidden
, 46397), false)
);

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

WriteAttribute("for", Tuple.Create(" for=\"", 46474), Tuple.Create("\"", 46536)
, Tuple.Create(Tuple.Create("", 46480), Tuple.Create("DocumentTemplate_OnImportUserFlagRules_Add_Flag_", 46480), true)
            
            #line 777 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                           , Tuple.Create(Tuple.Create("", 46528), Tuple.Create<System.Object, System.Int32>(flag.Id
            
            #line default
            #line hidden
, 46528), false)
);

WriteLiteral("><i");

WriteAttribute("class", Tuple.Create(" class=\"", 46540), Tuple.Create("\"", 46599)
, Tuple.Create(Tuple.Create("", 46548), Tuple.Create("fa", 46548), true)
, Tuple.Create(Tuple.Create(" ", 46550), Tuple.Create("fa-", 46551), true)
            
            #line 777 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                      , Tuple.Create(Tuple.Create("", 46554), Tuple.Create<System.Object, System.Int32>(flag.Icon
            
            #line default
            #line hidden
, 46554), false)
, Tuple.Create(Tuple.Create(" ", 46566), Tuple.Create("fa-fw", 46567), true)
, Tuple.Create(Tuple.Create(" ", 46572), Tuple.Create("fa-lg", 46573), true)
, Tuple.Create(Tuple.Create(" ", 46578), Tuple.Create("d-", 46579), true)
            
            #line 777 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                 , Tuple.Create(Tuple.Create("", 46581), Tuple.Create<System.Object, System.Int32>(flag.IconColour
            
            #line default
            #line hidden
, 46581), false)
);

WriteLiteral("></i>");

            
            #line 777 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                                                                                                                    Write(flag.Name);

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

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

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

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

WriteLiteral(" class=\"mt-1\"");

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

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

WriteLiteral(">Comments</label> <small>(added to the assignment; optional)</small>\r\n           " +
"                             </div>\r\n                                        <te" +
"xtarea");

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

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

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

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

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

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


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

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

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

WriteLiteral(@">
                    <tr>
                        <td class=""rule-action""></td>
                        <td>
                            <i class=""rule-flag fa fa-lg""></i>
                            <span class=""rule-flag""></span>
                        </td>
                        <td>
                            <span class=""rule-comments whitespace-pre-wrap""></span>
                        </td>
                        <td>
                            <i class=""fa fa-times-circle fa-lg ajaxRemove"" title=""Remove""></i>
                            <i class=""ajaxLoading"" title=""Loading..."" style=""display: none;""></i>
                        </td>
                    </tr>
                    </script>
");

WriteLiteral("                    <script");

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

WriteLiteral(">\r\n                        $(function () {\r\n                            const rul" +
"esTable = $(\'#DocumentTemplate_OnImportUserFlagRules\');\r\n\r\n                     " +
"       rulesTable.on(\'click\', \'.ajaxRemove\', e => {\r\n                           " +
"     const $remove = $(e.currentTarget);\r\n                                const " +
"$target = $remove.closest(\'tr\');\r\n                                const id = $ta" +
"rget.attr(\'data-id\');\r\n\r\n                                const $loader = $remove" +
".next(\'.ajaxLoading\');\r\n                                $loader.show();\r\n       " +
"                         $remove.hide();\r\n\r\n                                cons" +
"t $form = $(\'#DocumentTemplate_OnImportUserFlagRules_Remove\');\r\n                " +
"                $form.find(\'[name=\"ruleId\"]\').val(id);\r\n                        " +
"        const body = new FormData($form[0]);\r\n                                fe" +
"tch($form[0].action, {\r\n                                    body: body,\r\n       " +
"                             method: \'POST\'\r\n                                })." +
"then(r => {\r\n                                    if (r.status === 200) {\r\n      " +
"                                  $target.remove();\r\n\r\n                         " +
"               const rows = rulesTable.find(\'tbody\').find(\'tr\');\r\n              " +
"                          if (rows.length === 1) {\r\n                            " +
"                rows.first().removeClass(\'hidden\');\r\n                           " +
"             } else {\r\n                                            rows.first()." +
"addClass(\'hidden\');\r\n                                        }\r\n                " +
"                    } else {\r\n                                        alert(r.st" +
"atusText);\r\n                                        $loader.hide();\r\n           " +
"                             $remove.show();\r\n                                  " +
"  }\r\n                                })\r\n                                    .ca" +
"tch(e => {\r\n                                        alert(e);\r\n                 " +
"                       $loader.hide();\r\n                                        " +
"$remove.show();\r\n                                    });\r\n                      " +
"      });\r\n\r\n                            let dialog = null;\r\n                   " +
"         $(\'#DocumentTemplate_OnImportUserFlagRules_AddButton\').click(e => {\r\n  " +
"                              e.preventDefault();\r\n\r\n                           " +
"     if (!dialog) {\r\n                                    dialog = $(\'#DocumentTe" +
"mplate_OnImportUserFlagRules_AddDialog\').dialog({\r\n                             " +
"           resizable: false,\r\n                                        modal: tru" +
"e,\r\n                                        autoOpen: false,\r\n                  " +
"                      width: 460,\r\n                                        butto" +
"ns: {\r\n                                            \"Add Rule\": function () {\r\n  " +
"                                              dialog.dialog(\"disable\");\r\n\r\n     " +
"                                           const form = dialog.find(\'form\')[0];\r" +
"\n                                                if (form.reportValidity()) {\r\n " +
"                                                   const body = new FormData(for" +
"m);\r\n\r\n                                                    fetch(form.action, {\r" +
"\n                                                        method: \'POST\',\r\n      " +
"                                                  body: body\r\n                  " +
"                                  })\r\n                                          " +
"              .then(r => r.json())\r\n                                            " +
"            .then(r => {\r\n                                                      " +
"      const row = $($(\'#DocumentTemplate_OnImportUserFlagRules_AddTemplate\').htm" +
"l());\r\n                                                            row.attr(\'dat" +
"a-id\', r.Id);\r\n                                                            row.f" +
"ind(\'.rule-action\').text(r.AddFlag ? \'Assign\' : \'Remove\');\r\n                    " +
"                                        row.find(\'i.rule-flag\').addClass(\'fa-\' +" +
" r.UserFlagIcon + \' d-\' + r.UserFlagColour);\r\n                                  " +
"                          row.find(\'span.rule-flag\').text(r.UserFlagName);\r\n    " +
"                                                        row.find(\'.rule-comments" +
"\').text(r.Comments);\r\n                                                          " +
"  rulesTable.find(\'tbody\').append(row);\r\n\r\n                                     " +
"                       rulesTable.find(\'tbody\').find(\'tr\').first().addClass(\'hid" +
"den\');\r\n                                                            \r\n          " +
"                                                  dialog.dialog(\"close\");\r\n     " +
"                                                   })\r\n                         " +
"                               .catch(e => {\r\n                                  " +
"                          alert(e);\r\n                                           " +
"             })\r\n                                                }\r\n            " +
"                                },\r\n                                            " +
"Close: function () {\r\n                                                $(this).di" +
"alog(\"close\");\r\n                                            }\r\n                 " +
"                       }\r\n                                    });\r\n             " +
"                   }\r\n\r\n                                dialog.dialog(\'open\');\r\n" +
"                                return false;\r\n                            });\r\n" +
"                        });\r\n                    </script>\r\n");

            
            #line 901 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                }
                else
                {
                    if (!Model.OnImportUserFlagRules.Any())
                    {

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

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

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

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

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

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

WriteLiteral(@">
                            <thead>
                                <tr>
                                    <td>Action</td>
                                    <td>User Flag</td>
                                    <td>Comments</td>
                                </tr>
                            </thead>
                            <tbody>
");

            
            #line 919 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 919 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                 foreach (var rule in Model.OnImportUserFlagRules)
                                {

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

            
            #line 922 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                        Write(rule.AddFlag ? "Assign" : "Remove");

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

WriteAttribute("class", Tuple.Create(" class=\"", 54862), Tuple.Create("\"", 54933)
, Tuple.Create(Tuple.Create("", 54870), Tuple.Create("fa", 54870), true)
, Tuple.Create(Tuple.Create(" ", 54872), Tuple.Create("fa-", 54873), true)
            
            #line 924 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 54876), Tuple.Create<System.Object, System.Int32>(rule.UserFlag.Icon
            
            #line default
            #line hidden
, 54876), false)
, Tuple.Create(Tuple.Create(" ", 54897), Tuple.Create("fa-lg", 54898), true)
, Tuple.Create(Tuple.Create(" ", 54903), Tuple.Create("d-", 54904), true)
            
            #line 924 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
          , Tuple.Create(Tuple.Create("", 54906), Tuple.Create<System.Object, System.Int32>(rule.UserFlag.IconColour
            
            #line default
            #line hidden
, 54906), false)
);

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

            
            #line 925 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                            
            
            #line default
            #line hidden
            
            #line 925 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                             if (Authorization.Has(Claims.Config.UserFlag.Configure))
                                            {

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

            
            #line 927 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                 Write(Html.ActionLink(rule.UserFlag.Name, MVC.Config.UserFlag.Index(rule.UserFlag.Id)));

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

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

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

            
            #line 931 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                 Write(rule.UserFlag.Name);

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

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

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

            
            #line 935 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                            
            
            #line default
            #line hidden
            
            #line 935 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                             if (string.IsNullOrWhiteSpace(rule.Comments))
                                            {

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

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

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

WriteLiteral(" class=\"whitespace-pre-wrap\"");

WriteLiteral(">");

            
            #line 941 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                             Write(rule.Comments);

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

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

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

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

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

            
            #line 948 "..\..\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-fw fa-info-circle\"");

WriteLiteral(@"></i>
                                These rules will be applied each time a document is imported (as an attachment) where it is determined the document was based on this template.
                                When creating a user flag assignment, if an assignment already exists the rule will be skipped.
                                When removing user flag assignments, if no assignment is present the rule will be skipped.
                            </p>
                        </div>
                        </td>
                        </tr>
                        <tr>
                            <th>
                                Linked Groups:
                            </th>
                            <td>
                                <div>
");

WriteLiteral("                                    ");

            
            #line 966 "..\..\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,
                                   IncludeFilterBeginDate = true,
                                   UpdateUrl = Url.Action(MVC.API.DocumentTemplate.UpdateUsersLinkedGroup(Model.DocumentTemplate.Id, redirect: true))
                               }));

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

WriteLiteral("                                    ");

            
            #line 975 "..\..\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,
                                   IncludeFilterBeginDate = true,
                                   UpdateUrl = Url.Action(MVC.API.DocumentTemplate.UpdateDevicesLinkedGroup(Model.DocumentTemplate.Id, redirect: true))
                               }));

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

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

            
            #line default
            #line hidden
            
            #line 986 "..\..\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 996 "..\..\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(" class=\"dialog\"");

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 1039 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
            
            
            #line default
            #line hidden
            
            #line 1039 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
             if (hideAdvanced)
            {

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

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

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

WriteLiteral(">Show Advanced Options</button>\r\n");

WriteLiteral(@"                <script>
                    $(function () {
                        $('#Config_HideAdvanced_Show').click(function () {
                            $('#Config_DocumentTemplates_Show').removeClass('Config_HideAdvanced');
                            $(this).remove();
                        });
                    });
                </script>
");

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

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

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

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

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

            
            #line 1055 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
             if (Authorization.Has(Claims.Config.DocumentTemplate.Export))
            {
                
            
            #line default
            #line hidden
            
            #line 1057 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
           Write(Html.ActionLinkButton("Export Instances", MVC.Config.DocumentTemplate.Export(Model.DocumentTemplate.Id, null)));

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

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

            
            #line 1059 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
             if (canBulkGenerate)
            {
                if (Model.DocumentTemplate.Scope == DocumentTemplate.DocumentTemplateScopes.User)
                {
                    
            
            #line default
            #line hidden
            
            #line 1063 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
               Write(Html.ActionLinkButton("Bulk Generate", MVC.Config.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id)));

            
            #line default
            #line hidden
            
            #line 1063 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                                                                                                                
                }
                else
                {

            
            #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 dialog-bulk-generate\"");

WriteAttribute("title", Tuple.Create(" title=\"", 62787), Tuple.Create("\"", 62838)
, Tuple.Create(Tuple.Create("", 62795), Tuple.Create("Bulk", 62795), true)
, Tuple.Create(Tuple.Create(" ", 62799), Tuple.Create("Generate:", 62800), true)
            
            #line 1068 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                , Tuple.Create(Tuple.Create(" ", 62809), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Id
            
            #line default
            #line hidden
, 62810), false)
);

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

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

WriteLiteral(">\r\n");

            
            #line 1070 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 1070 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                             switch (Model.DocumentTemplate.Scope)
                            {
                                case "Device":

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

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

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

WriteLiteral("                                    <div");

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

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

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

WriteLiteral(@">
                                            01234567<br />
                                            ABCD9876<br />
                                            8VQ6G2R
                                        </div>
                                        <div");

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

WriteLiteral(">01234567,ABCD9876,8VQ6G2R</div>\r\n                                        <div");

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

WriteLiteral(">01234567;ABCD9876;8VQ6G2R</div>\r\n                                    </div>\r\n");

            
            #line 1086 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                    break;
                                case "Job":

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

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

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

WriteLiteral("                                    <div");

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

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

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

WriteLiteral(">\r\n                                            86<br />\r\n                        " +
"                    99<br />\r\n                                            44\r\n  " +
"                                      </div>\r\n                                  " +
"      <div");

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

WriteLiteral(">86,99,44</div>\r\n                                        <div");

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

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

            
            #line 1101 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                                    break;
                            }

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

            
            #line 1104 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 1104 "..\..\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 1108 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
                            if (Model.TemplatePageCount > 1 && Model.TemplatePageCount % 2 != 0)
                            {

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

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

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

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

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

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

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

WriteLiteral(" /><label");

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

WriteLiteral(">Insert Blank Pages for Double-Sided Printing</label>\r\n                          " +
"      </div>\r\n");

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

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

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


            
            #line default
            #line hidden
WriteLiteral(@"                    <script>
                        $(function () {
                            var dialog;

                            $('#buttonBulkGenerate').click(function () {
                                if (!dialog) {
                                    dialog = $('#dialogBulkGenerate').dialog({
                                        resizable: false,
                                        modal: true,
                                        autoOpen: false,
                                        width: 460,
                                        buttons: {
                                            ""Bulk Generate"": function () {
                                                dialog.find('form').submit();
                                                dialog.dialog(""disable"");
                                            },
                                            Close: function () {
                                                $(this).dialog(""close"");
                                            }
                                        }
                                    });

                                    $.validator.unobtrusive.reparse('#inputBulkGenerateDataIds');
                                }

                                dialog.dialog('open');
                                return false;
                            });
                        });
                    </script>
");

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

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

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

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

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

            
            #line 1154 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
        
            
            #line default
            #line hidden
            
            #line 1154 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
         if (!string.IsNullOrWhiteSpace(Model.BulkGenerateDownloadId))
        {

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

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

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

WriteLiteral(" title=\"Download Bulk Documents\"");

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

WriteAttribute("href", Tuple.Create(" href=\"", 68089), Tuple.Create("\"", 68220)
            
            #line 1157 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 68096), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DocumentTemplate.BulkGenerateDownload(Model.BulkGenerateDownloadId, Model.BulkGenerateDownloadFilename))
            
            #line default
            #line hidden
, 68096), false)
);

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

WriteLiteral("><i");

WriteLiteral(" class=\"fa fa-download fa-lg\"");

WriteLiteral("></i>Download Bulk Documents</a>\r\n            </div>\r\n");

WriteLiteral(@"            <script>
                $(function () {
                    $('#Config_DocumentTemplates_Show_DownloadBulk_Dialog')
                        .dialog({
                            width: 400,
                            height: 100,
                            resizable: false,
                            modal: true,
                            autoOpen: true
                        });
                });
            </script>
");

            
            #line 1171 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
        }
            
            #line default
            #line hidden
        }
    }
}
#pragma warning restore 1591
