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

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

    var hideAdvanced =
        Model.Package.FilterExpression == null &&
        Model.Package.OnGenerateExpression == null;

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

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

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

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

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

WriteAttribute("class", Tuple.Create(" class=\"", 1577), Tuple.Create("\"", 1632)
            
            #line 40 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
, Tuple.Create(Tuple.Create("", 1585), Tuple.Create<System.Object, System.Int32>(hideAdvanced ? " Config_HideAdvanced" : null
            
            #line default
            #line hidden
, 1585), 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 49 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                         Write(Html.DisplayFor(model => model.Package.Id));

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

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

            
            #line default
            #line hidden
            
            #line 59 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                                
                            
            
            #line default
            #line hidden
            
            #line 60 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                       Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 60 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                   
                            
            
            #line default
            #line hidden
            
            #line 61 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                       Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 61 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                     

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

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

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

            
            #line 67 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                    Write(Url.Action(MVC.API.DocumentTemplatePackage.UpdateDescription(Model.Package.Id)));

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

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

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

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

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

            
            #line 78 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                            }
                            else
                            {
                                
            
            #line default
            #line hidden
            
            #line 81 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                           Write(Model.Package.Description);

            
            #line default
            #line hidden
            
            #line 81 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.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 92 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 92 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                             if (canConfig)
                            {

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

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

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

WriteLiteral(" ");

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

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

WriteLiteral("                                <label");

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

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

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

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

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

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

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

            
            #line 102 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                        Write(Url.Action(MVC.API.DocumentTemplatePackage.UpdateIsHidden(Model.Package.Id)));

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

            
            #line 107 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                            }
                            else
                            {

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

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

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

WriteLiteral(" ");

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

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

WriteLiteral("                                <label");

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

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

            
            #line 112 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.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 package will not appear in the list of documents to generate.
                            </p>
                        </div>
                    </td>
                </tr>
                <tr>
                    <th>
                        &nbsp;
                    </th>
                    <td>
                        <div>
");

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

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

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

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

WriteLiteral(" ");

            
            #line 129 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                                 Write(Model.Package.InsertBlankPages ? new MvcHtmlString("checked=\"checked\" ") : null);

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

WriteLiteral("                                <label");

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

WriteLiteral(">Insert Blank Pages</label>\r\n");

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

            
            #line default
            #line hidden
            
            #line 131 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                         

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

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

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

            
            #line 137 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                        Write(Url.Action(MVC.API.DocumentTemplatePackage.UpdateInsertBlankPages(Model.Package.Id)));

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

            
            #line 142 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                            }
                            else
                            {

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

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

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

WriteLiteral(" ");

            
            #line 145 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                                 Write(Model.Package.InsertBlankPages ? new MvcHtmlString("checked=\"checked\" ") : null);

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

WriteLiteral("                                <label");

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

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

            
            #line 147 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.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 blank pages will be inserted to ensure each of the individual documents within the package appear on separate pages when using duplex printing.
                            </p>
                        </div>
                    </td>
                </tr>
                <tr>
                    <th>
                        Scope:
                    </th>
                    <td>
                        <h4>");

            
            #line 161 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                       Write(Model.Package.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 package is generated from ");

            
            #line 164 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                                            Write(Model.Package.Scope);

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

WriteAttribute("href", Tuple.Create(" href=\"", 8106), Tuple.Create("\"", 8188)
            
            #line 164 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                                                                                           , Tuple.Create(Tuple.Create("", 8113), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Expressions.Browser())
            
            #line default
            #line hidden
, 8113), false)
, Tuple.Create(Tuple.Create("", 8160), Tuple.Create("#", 8160), true)
            
            #line 164 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                                                                                                                                           , Tuple.Create(Tuple.Create("", 8161), Tuple.Create<System.Object, System.Int32>(Model.Package.Scope
            
            #line default
            #line hidden
, 8161), false)
, Tuple.Create(Tuple.Create("", 8183), Tuple.Create("Scope", 8183), true)
);

WriteLiteral(">");

            
            #line 164 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                                                                                                                                                                                                                                                   Write(Model.Package.Scope);

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

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

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

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

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

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

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

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

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

WriteLiteral(">\r\n");

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

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

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

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

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

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

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

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

WriteLiteral(">\r\n");

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

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

WriteAttribute("value", Tuple.Create(" value=\"", 9309), Tuple.Create("\"", 9323)
            
            #line 180 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
, Tuple.Create(Tuple.Create("", 9317), Tuple.Create<System.Object, System.Int32>(scope
            
            #line default
            #line hidden
, 9317), false)
);

WriteAttribute("selected", Tuple.Create(" selected=\"", 9324), Tuple.Create("\"", 9398)
            
            #line 180 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
, Tuple.Create(Tuple.Create("", 9335), Tuple.Create<System.Object, System.Int32>(scope == Model.Package.Scope.ToString() ? " selected" : null
            
            #line default
            #line hidden
, 9335), false)
);

WriteLiteral(">");

            
            #line 180 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                                                                                         Write(scope);

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

            
            #line 181 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                            }

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

            
            #line 184 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                }

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

            
            #line 185 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                             if (Model.Package.DocumentTemplateIds != null && Model.Package.DocumentTemplateIds.Count > 0)
                                {

            
            #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>If changed, all Document Templates will be unassociated with this Package.\r\n" +
"                                    </p>\r\n                                </div>" +
"\r\n");

            
            #line 192 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.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_DocumentTemplatePackages_Scope" +
"_Dialog\').dialog({\r\n                                                width: 400,\r" +
"\n                                                resizable: false,\r\n            " +
"                                    modal: true,\r\n                              " +
"                  autoOpen: false,\r\n                                            " +
"    buttons: {\r\n                                                    \'Save Change" +
"s\': function () {\r\n                                                        dialo" +
"g.dialog(\'option\', \'buttons\', null);\r\n                                          " +
"              dialog.dialog(\'disable\');\r\n                                       " +
"                 $(\'#Config_DocumentTemplatePackages_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.dialo" +
"g(\'open\');\r\n\r\n                                        return false;\r\n           " +
"                         }\r\n\r\n                                    $(\'#Config_Doc" +
"umentTemplatePackages_Scope_Button\').click(showDialog);\r\n                       " +
"         });\r\n                        </script>\r\n");

            
            #line 226 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                        }

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

            
            #line 227 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                         if (Model.Package.Scope == AttachmentTypes.Job)
                        {

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

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

WriteLiteral("                        <div");

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

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

            
            #line 233 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 233 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                 if (Model.Package.JobSubTypes != null && Model.Package.JobSubTypes.Count > 0)
                                    {

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

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

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

WriteLiteral("                                                ");

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

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

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

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

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

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

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

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

            
            #line 254 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                            }

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

            
            #line 256 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                    }
                                    else
                                    {

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

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

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

            
            #line 260 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                    }

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

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

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

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

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

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

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

WriteLiteral("                                <div");

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

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

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

WriteLiteral(">\r\n");

            
            #line 266 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 266 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                     using (Html.BeginForm(MVC.API.DocumentTemplatePackage.UpdateJobSubTypes(Model.Package.Id, null, true)))
                                        {
                                            var selectedTypes = Model.JobSubTypesSelected.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=\"", 15256), Tuple.Create("\"", 15275)
, Tuple.Create(Tuple.Create("", 15261), Tuple.Create("Types_", 15261), true)
            
            #line 273 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
, Tuple.Create(Tuple.Create("", 15267), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 15267), false)
);

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

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

WriteAttribute("value", Tuple.Create(" value=\"", 15308), Tuple.Create("\"", 15324)
            
            #line 273 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                  , Tuple.Create(Tuple.Create("", 15316), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 15316), false)
);

WriteLiteral(" ");

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

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

WriteAttribute("for", Tuple.Create(" for=\"", 15396), Tuple.Create("\"", 15416)
, Tuple.Create(Tuple.Create("", 15402), Tuple.Create("Types_", 15402), true)
            
            #line 273 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                                                                              , Tuple.Create(Tuple.Create("", 15408), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 15408), false)
);

WriteLiteral(">");

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

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

WriteAttribute("id", Tuple.Create(" id=\"", 15542), Tuple.Create("\"", 15564)
, Tuple.Create(Tuple.Create("", 15547), Tuple.Create("SubTypes_", 15547), true)
            
            #line 275 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
, Tuple.Create(Tuple.Create("", 15556), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 15556), false)
);

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

WriteLiteral(">\r\n");

WriteLiteral("                                                ");

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

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

WriteLiteral("                                                ");

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

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

            
            #line 280 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.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_DocumentTemplatePackages_JobSubTypes_Up" +
"date_Dialog\').dialog({\r\n                                                        " +
"resizable: false,\r\n                                                        modal" +
": true,\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(\'." +
"jobSubTypes\').hide();\r\n                                                    dialo" +
"g.on(\'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(\'f" +
"ast\');\r\n                                                    }).find(\'input.jobTy" +
"pe: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 c" +
"ancel() {\r\n                                                dialog.dialog(\"disabl" +
"e\");\r\n                                                dialog.dialog(\"option\", \"b" +
"uttons\", null);\r\n\r\n                                                // Refresh Pa" +
"ge\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\')." +
"prop(\'checked\', false);\r\n                                                });\r\n\r\n" +
"                                                form.submit();\r\n\r\n              " +
"                                  dialog.dialog(\"disable\");\r\n                   " +
"                             dialog.dialog(\"option\", \"buttons\", null);\r\n        " +
"                                    }\r\n\r\n                                       " +
"     $(function () {\r\n                                                $(\'#Config" +
"_DocumentTemplatePackages_JobSubTypes_Update\').click(showDialog);\r\n             " +
"                               });\r\n\r\n                                        })" +
"();\r\n                                </script>\r\n");

            
            #line 345 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                }

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

            
            #line 347 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                        }

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

            
            #line 353 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 353 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                         if (Model.DocumentTemplatesSelected.Count == 0)
                        {

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

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

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

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

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

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

WriteLiteral("></i>The package has no associated Document Templates and cannot be generated.\r\n " +
"                               </p>\r\n                            </div>\r\n");

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

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

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

WriteLiteral(">Choose Document Templates</button>\r\n                            </div>\r\n");

            
            #line 363 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                        }
                        else
                        {

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

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

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

WriteLiteral(">\r\n");

            
            #line 367 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 367 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                 foreach (var template in Model.DocumentTemplatesSelected)
                                {

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

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

WriteLiteral(">");

            
            #line 370 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                             Write(template.Description);

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

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

WriteLiteral(">");

            
            #line 371 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                    Write(Html.ActionLink(template.Id, MVC.Config.DocumentTemplate.Index(template.Id)));

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

            
            #line 373 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                }

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

WriteLiteral("                            <div");

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

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

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

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

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

WriteLiteral("></i>The package will be generated with the above Document Templates in the order" +
" they appear.\r\n                                </p>\r\n                           " +
" </div>\r\n");

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

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

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

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

            
            #line 383 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                        }

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

            
            #line 384 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                         if (canConfig)
                        {

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

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

WriteLiteral(" title=\"Change Document Templates\"");

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

WriteLiteral(">\r\n                                <div>\r\n                                    <h3" +
">Package Templates</h3>\r\n");

            
            #line 389 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 389 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                     using (Html.BeginForm(MVC.API.DocumentTemplatePackage.UpdateDocumentTemplates(Model.Package.Id, redirect: true)))
                                    {

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

WriteLiteral(" class=\"templates_connected none\"");

WriteLiteral(">\r\n");

            
            #line 392 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                            
            
            #line default
            #line hidden
            
            #line 392 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                             foreach (var template in Model.DocumentTemplatesSelected)
                                            {

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

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

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

WriteAttribute("value", Tuple.Create(" value=\"", 22938), Tuple.Create("\"", 22958)
            
            #line 395 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                        , Tuple.Create(Tuple.Create("", 22946), Tuple.Create<System.Object, System.Int32>(template.Id
            
            #line default
            #line hidden
, 22946), false)
);

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

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

WriteLiteral(">");

            
            #line 396 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                Write(template.Id);

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

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

WriteLiteral(">");

            
            #line 397 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                         Write(template.Description);

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

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

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

            
            #line 401 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.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>Include Document Templates by drag them from the list of Available Templates. Reorder Document Templates by dragging them within the list.
                                            </p>
                                        </div>
                                    </div>
                                </div>
                                <div>
                                    <h3>Available Templates</h3>
                                    <ul");

WriteLiteral(" class=\"templates_connected none\"");

WriteLiteral(">\r\n");

            
            #line 413 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                        
            
            #line default
            #line hidden
            
            #line 413 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                         foreach (var template in Model.DocumentTemplates.Where(t => !t.IsHidden).Except(Model.DocumentTemplatesSelected))
                                        {

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

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

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

WriteAttribute("value", Tuple.Create(" value=\"", 24444), Tuple.Create("\"", 24464)
            
            #line 416 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                    , Tuple.Create(Tuple.Create("", 24452), Tuple.Create<System.Object, System.Int32>(template.Id
            
            #line default
            #line hidden
, 24452), false)
);

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

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

WriteLiteral(">");

            
            #line 417 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                            Write(template.Id);

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

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

WriteLiteral(">");

            
            #line 418 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                     Write(template.Description);

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

            
            #line 420 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                        }

            
            #line default
            #line hidden
WriteLiteral("                                    </ul>\r\n                                </div>" +
"\r\n                            </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_DocumentTemplatePackages_Templ" +
"ates_Dialog\').dialog({\r\n                                                width: 8" +
"00,\r\n                                                resizable: false,\r\n        " +
"                                        modal: true,\r\n                          " +
"                      autoOpen: false,\r\n                                        " +
"        buttons: {\r\n                                                    \'Save Ch" +
"anges\': function () {\r\n                                                        v" +
"ar $form = dialog.find(\'form\');\r\n                                               " +
"         if ($form.find(\'input\').length > 0) {\r\n                                " +
"                            dialog.dialog(\'option\', \'buttons\', null);\r\n         " +
"                                                   dialog.dialog(\'disable\');\r\n  " +
"                                                          $form.submit();\r\n     " +
"                                                   } else {\r\n                   " +
"                                         alert(\'The package templates must inclu" +
"de at least one document template\');\r\n                                          " +
"              }\r\n                                                    },\r\n       " +
"                                             \'Cancel\': function () {\r\n          " +
"                                              dialog.dialog(\'close\');\r\n         " +
"                                           }\r\n                                  " +
"              }\r\n                                            });\r\n\r\n            " +
"                                dialog.find(\'.templates_connected\')\r\n           " +
"                                     .sortable({\r\n                              " +
"                      connectWith: \'.templates_connected\'\r\n                     " +
"                           })\r\n                                        }\r\n\r\n    " +
"                                    dialog.dialog(\'open\');\r\n\r\n                  " +
"                      return false;\r\n                                    }\r\n\r\n  " +
"                                  $(\'#Config_DocumentTemplatePackages_Templates_" +
"Button\').click(showDialog);\r\n                                });\r\n              " +
"              </script>\r\n");

            
            #line 466 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n            </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 482 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 482 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                         if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.ConfigureFilterExpression))
                        {
                            
            
            #line default
            #line hidden
            
            #line 484 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                       Write(Html.EditorFor(model => Model.Package.FilterExpression));

            
            #line default
            #line hidden
            
            #line 484 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                                    
                            
            
            #line default
            #line hidden
            
            #line 485 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                       Write(AjaxHelpers.AjaxRemove());

            
            #line default
            #line hidden
            
            #line 485 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                     
                            
            
            #line default
            #line hidden
            
            #line 486 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                       Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 486 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                   
                            
            
            #line default
            #line hidden
            
            #line 487 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                       Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 487 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                     

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

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

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

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

            
            #line 497 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                    Write(Url.Action(MVC.API.DocumentTemplatePackage.UpdateFilterExpression(Model.Package.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 526 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                        }
                        else
                        {
                            if (string.IsNullOrWhiteSpace(Model.Package.FilterExpression))
                            {

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

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

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

            
            #line 532 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                            }
                            else
                            {

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

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

WriteLiteral(">\r\n");

WriteLiteral("                                    ");

            
            #line 536 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                               Write(Model.Package.FilterExpression);

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

            
            #line 538 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.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 package is shown in the <em>Generate&nbsp;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 552 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 552 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                         if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.ConfigureFilterExpression))
                        {
                            
            
            #line default
            #line hidden
            
            #line 554 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                       Write(Html.EditorFor(model => Model.Package.OnGenerateExpression));

            
            #line default
            #line hidden
            
            #line 554 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                                        
                            
            
            #line default
            #line hidden
            
            #line 555 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                       Write(AjaxHelpers.AjaxRemove());

            
            #line default
            #line hidden
            
            #line 555 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                     
                            
            
            #line default
            #line hidden
            
            #line 556 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                       Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 556 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                   
                            
            
            #line default
            #line hidden
            
            #line 557 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                       Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 557 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                     

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

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

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

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

            
            #line 567 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                    Write(Url.Action(MVC.API.DocumentTemplatePackage.UpdateOnGenerateExpression(Model.Package.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 596 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                        }
                        else
                        {
                            if (string.IsNullOrWhiteSpace(Model.Package.OnGenerateExpression))
                            {

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

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

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

            
            #line 602 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                            }
                            else
                            {

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

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

WriteLiteral(">\r\n");

WriteLiteral("                                    ");

            
            #line 606 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                               Write(Model.Package.OnGenerateExpression);

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

            
            #line 608 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.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 the package is generated.
                            </p>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<div");

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

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

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

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

WriteLiteral("></i>This item will be permanently deleted.<br />\r\n        Are you sure?\r\n    </p" +
">\r\n</div>\r\n<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 657 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
    
            
            #line default
            #line hidden
            
            #line 657 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.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_DocumentTemplatePackages_Show').removeClass('Config_HideAdvanced');
                    $(this).remove();
                });
            });
        </script>
");

            
            #line 668 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
    }

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

            
            #line 669 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
     if (canBulkGenerate)
    {

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

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

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

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

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

WriteLiteral("        <div");

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

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

WriteAttribute("title", Tuple.Create(" title=\"", 37306), Tuple.Create("\"", 37348)
, Tuple.Create(Tuple.Create("", 37314), Tuple.Create("Bulk", 37314), true)
, Tuple.Create(Tuple.Create(" ", 37318), Tuple.Create("Generate:", 37319), true)
            
            #line 672 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
, Tuple.Create(Tuple.Create(" ", 37328), Tuple.Create<System.Object, System.Int32>(Model.Package.Id
            
            #line default
            #line hidden
, 37329), false)
);

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

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

WriteLiteral(">\r\n");

            
            #line 674 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                
            
            #line default
            #line hidden
            
            #line 674 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                 switch (Model.Package.Scope)
                {
                    case AttachmentTypes.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                            <d" +
"iv");

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

WriteLiteral(">\r\n                                01234567<br />\r\n                              " +
"  ABCD9876<br />\r\n                                8VQ6G2R\r\n                     " +
"       </div>\r\n                            <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 690 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                        break;
                    case AttachmentTypes.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                            <d" +
"iv");

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

WriteLiteral(">\r\n                                86<br />\r\n                                99<b" +
"r />\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 705 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                            break;
                        case AttachmentTypes.User:

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

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

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

WriteLiteral("                        <div");

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

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

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

WriteLiteral(">\r\n                                user6<br />\r\n                                s" +
"mi0099<br />");

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

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

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

WriteLiteral(">user6,smi0099,");

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

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

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

WriteLiteral(">user6;smi0099;");

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

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

            
            #line 719 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                        break;
                }

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

            
            #line 722 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
            
            
            #line default
            #line hidden
            
            #line 722 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
             using (Html.BeginForm(MVC.API.DocumentTemplatePackage.BulkGenerate(Model.Package.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");

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 729 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
            }

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

            
            #line 731 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.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 762 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
    }

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

            
            #line 763 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
     if (Authorization.Has(Claims.Config.DocumentTemplate.Delete))
    {
        
            
            #line default
            #line hidden
            
            #line 765 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
   Write(Html.ActionLinkButton("Delete", MVC.API.DocumentTemplatePackage.Delete(Model.Package.Id, true), "buttonDelete"));

            
            #line default
            #line hidden
            
            #line 765 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
                                                                                                                        
    }

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

        }
    }
}
#pragma warning restore 1591
