#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.JobQueue
{
    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\JobQueue\Show.cshtml"
    using Disco.Services.Jobs.JobQueues;
    
    #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/JobQueue/Show.cshtml")]
    public partial class Show : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.JobQueue.ShowModel>
    {
        public Show()
        {
        }
        public override void Execute()
        {
            
            #line 3 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
  
    Authorization.Require(Claims.Config.JobQueue.Show);

    ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Job Queues", MVC.Config.JobQueue.Index(null), Model.Token.JobQueue.ToString());

    var canConfig = Authorization.Has(Claims.Config.JobQueue.Configure);
    var canDelete = (Authorization.Has(Claims.Config.JobQueue.Delete) && Model.CanDelete);
    var canShowJobs = Model.OpenJobCount > 0 && Authorization.Has(Claims.Job.Lists.JobQueueLists);

    Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");

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

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

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

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

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

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

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

WriteLiteral("                ");

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

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

            
            #line 29 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 29 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                 if (canConfig)
            {
            
            #line default
            #line hidden
            
            #line 30 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
        Write(Html.EditorFor(model => model.Token.JobQueue.Name));

            
            #line default
            #line hidden
            
            #line 30 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                
                
            
            #line default
            #line hidden
            
            #line 31 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
           Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 31 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                       
                
            
            #line default
            #line hidden
            
            #line 32 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
           Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 32 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                         

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

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

WriteLiteral(">\r\n                    $(function () {\r\n                        document.DiscoFun" +
"ctions.PropertyChangeHelper(\r\n                            $(\'#Token_JobQueue_Nam" +
"e\'),\r\n                            \'Invalid Name\',\r\n                            \'" +
"");

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

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

            
            #line 43 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
            }
            else
            {
                
            
            #line default
            #line hidden
            
            #line 46 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
           Write(Model.Token.JobQueue.Name);

            
            #line default
            #line hidden
            
            #line 46 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                          
            }

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

            
            #line 55 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
            
            
            #line default
            #line hidden
            
            #line 55 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
             if (canConfig)
        {
            
            #line default
            #line hidden
            
            #line 56 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
    Write(Html.EditorFor(model => model.Token.JobQueue.Description));

            
            #line default
            #line hidden
            
            #line 56 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                   
            
            
            #line default
            #line hidden
            
            #line 57 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
       Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 57 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                   
            
            
            #line default
            #line hidden
            
            #line 58 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
       Write(AjaxHelpers.AjaxLoader());

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

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

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

WriteLiteral(">\r\n                $(function () {\r\n                    document.DiscoFunctions.P" +
"ropertyChangeHelper(\r\n                        $(\'#Token_JobQueue_Description\'),\r" +
"\n                        \'Invalid Description\',\r\n                        \'");

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

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

            
            #line 69 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
        }
        else
        {

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

            
            #line 72 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                  if (string.IsNullOrEmpty(Model.Token.JobQueue.Description))
                     {

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

WriteLiteral("&lt;None&gt;");

WriteLiteral("\r\n");

            
            #line 75 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                     }
                     else
                     {
                        
            
            #line default
            #line hidden
            
            #line 78 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                   Write(Model.Token.JobQueue.Description.ToHtmlComment());

            
            #line default
            #line hidden
            
            #line 78 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                         
                     }

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

            
            #line 81 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
        }

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

            
            #line 89 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                Write(Model.OpenJobCount);

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

            
            #line 89 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                        Write(Model.OpenJobCount != 1 ? "s" : null);

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

            
            #line 90 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
        Write(Model.TotalJobCount);

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

            
            #line 90 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                       Write(Model.TotalJobCount != 1 ? "s" : null);

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

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

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

            
            #line 98 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                             Write(Model.Token.JobQueue.Icon);

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

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

            
            #line 98 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                                        Write(Model.Token.JobQueue.IconColour);

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

WriteAttribute("class", Tuple.Create(" class=\"", 3441), Tuple.Create("\"", 3526)
, Tuple.Create(Tuple.Create("", 3449), Tuple.Create("fa", 3449), true)
, Tuple.Create(Tuple.Create(" ", 3451), Tuple.Create("fa-", 3452), true)
            
            #line 98 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                              , Tuple.Create(Tuple.Create("", 3455), Tuple.Create<System.Object, System.Int32>(Model.Token.JobQueue.Icon
            
            #line default
            #line hidden
, 3455), false)
, Tuple.Create(Tuple.Create(" ", 3483), Tuple.Create("fa-4x", 3484), true)
, Tuple.Create(Tuple.Create(" ", 3489), Tuple.Create("d-", 3490), true)
            
            #line 98 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                                                   , Tuple.Create(Tuple.Create("", 3492), Tuple.Create<System.Object, System.Int32>(Model.Token.JobQueue.IconColour
            
            #line default
            #line hidden
, 3492), false)
);

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

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

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

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

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

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

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

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

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

WriteLiteral(" title=\"Job Queue Icon\"");

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

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

WriteLiteral(">\r\n");

            
            #line 106 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 106 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                             foreach (var icon in Model.Icons)
                            {

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

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

            
            #line 108 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                          Write(icon.Key);

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

WriteAttribute("class", Tuple.Create(" class=\"", 4011), Tuple.Create("\"", 4036)
, Tuple.Create(Tuple.Create("", 4019), Tuple.Create("fa", 4019), true)
, Tuple.Create(Tuple.Create(" ", 4021), Tuple.Create("fa-", 4022), true)
            
            #line 108 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 4025), Tuple.Create<System.Object, System.Int32>(icon.Key
            
            #line default
            #line hidden
, 4025), false)
);

WriteAttribute("title", Tuple.Create(" title=\"", 4037), Tuple.Create("\"", 4056)
            
            #line 108 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
            , Tuple.Create(Tuple.Create("", 4045), Tuple.Create<System.Object, System.Int32>(icon.Value
            
            #line default
            #line hidden
, 4045), false)
);

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

            
            #line 109 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                            }

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

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

WriteLiteral(">\r\n");

            
            #line 112 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 112 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                             foreach (var colour in Model.ThemeColours)
                            {

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

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

            
            #line 114 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                            Write(colour.Key);

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

WriteAttribute("class", Tuple.Create(" class=\"", 4340), Tuple.Create("\"", 4376)
, Tuple.Create(Tuple.Create("", 4348), Tuple.Create("fa", 4348), true)
, Tuple.Create(Tuple.Create(" ", 4350), Tuple.Create("fa-square", 4351), true)
, Tuple.Create(Tuple.Create(" ", 4360), Tuple.Create("d-", 4361), true)
            
            #line 114 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
      , Tuple.Create(Tuple.Create("", 4363), Tuple.Create<System.Object, System.Int32>(colour.Key
            
            #line default
            #line hidden
, 4363), false)
);

WriteAttribute("title", Tuple.Create(" title=\"", 4377), Tuple.Create("\"", 4398)
            
            #line 114 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                           , Tuple.Create(Tuple.Create("", 4385), Tuple.Create<System.Object, System.Int32>(colour.Value
            
            #line default
            #line hidden
, 4385), false)
);

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

            
            #line 115 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </div>\r\n                    </div>\r\n                </div" +
">\r\n                <script>\r\n                    (function () {\r\n               " +
"         var dialog, icon, colours, icons;\r\n\r\n                        function s" +
"howDialog() {\r\n                            if (!dialog) {\r\n                     " +
"           dialog = $(\'#Config_JobQueues_Icon_Update_Dialog\').dialog({\r\n        " +
"                            resizable: false,\r\n                                 " +
"   modal: true,\r\n                                    autoOpen: false,\r\n         " +
"                           width: 780,\r\n                                    heig" +
"ht: 540,\r\n                                    buttons: {\r\n                      " +
"                  \"Save\": save,\r\n                                        Cancel:" +
" cancel\r\n                                    }\r\n                                " +
"});\r\n\r\n                                colours = dialog.find(\'.colours\');\r\n     " +
"                           icons = dialog.find(\'.icons\');\r\n\r\n                   " +
"             colours.on(\'click\', \'i\', selectColour);\r\n                          " +
"      icons.on(\'click\', \'i\', selectIcon);\r\n                            }\r\n\r\n    " +
"                        colours.find(\'i[data-colour=\"\' + icon.attr(\'data-colour\'" +
") + \'\"]\').each(selectColour);\r\n                            icons.find(\'i[data-ic" +
"on=\"\' + icon.attr(\'data-icon\') + \'\"]\').each(selectIcon);\r\n\r\n                    " +
"        dialog.dialog(\'open\');\r\n\r\n                            return false;\r\n   " +
"                     }\r\n\r\n                        function selectColour() {\r\n   " +
"                         var $this = $(this),\r\n                                c" +
"olourCode = $this.attr(\'data-colour\'),\r\n                                previous" +
"ColourCode = icons.attr(\'data-colour\');\r\n\r\n\r\n                            colours" +
".find(\'i\').removeClass(\'selected fa-check-square\').addClass(\'fa-square\');\r\n     " +
"                       $this.removeClass(\'fa-square\').addClass(\'fa-check-square " +
"selected\');\r\n\r\n                            if (previousColourCode)\r\n            " +
"                    icons.removeClass(\'d-\' + previousColourCode);\r\n             " +
"               icons.attr(\'data-colour\', colourCode)\r\n                          " +
"  icons.addClass(\'d-\' + colourCode);\r\n                        }\r\n               " +
"         function selectIcon() {\r\n                            var $this = $(this" +
"),\r\n                                iconCode = $this.attr(\'data-icon\');\r\n\r\n     " +
"                       icons.find(\'i\').removeClass(\'selected\');\r\n               " +
"             $this.addClass(\'selected\');\r\n                        }\r\n\r\n         " +
"               function save() {\r\n                            var url = \'");

            
            #line 175 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                   Write(Url.Action(MVC.API.JobQueue.UpdateIconAndColour(id: Model.Token.JobQueue.Id, redirect: true)));

            
            #line default
            #line hidden
WriteLiteral(@"',
                                data = {
                                    Icon: icons.find('i.selected').attr('data-icon'),
                                    IconColour: colours.find('i.selected').attr('data-colour')
                                };
                            window.location.href = url + '&' + $.param(data);

                            dialog.dialog(""disable"");
                            dialog.dialog(""option"", ""buttons"", null);
                        }

                        function cancel() {
                            $(this).dialog(""close"");
                        }

                        $(function () {
                            icon = $('#Config_JobQueues_Icon');
                            $('#Config_JobQueues_Icon_Update').click(showDialog);
                        });
                    }());
                </script>
            </div>
");

            
            #line 197 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
        }

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

            
            #line 205 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
        
            
            #line default
            #line hidden
            
            #line 205 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
         if (canConfig)
    {
        var priorityValue = Model.Token.JobQueue.Priority.ToString();
        var priorityItems = Enum.GetNames(typeof(JobQueuePriority)).Select(i => new SelectListItem() { Text = i, Value = i, Selected = (i == priorityValue) }).ToList();

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

WriteAttribute("class", Tuple.Create(" class=\"", 8536), Tuple.Create("\"", 8584)
, Tuple.Create(Tuple.Create("", 8544), Tuple.Create("fa", 8544), true)
, Tuple.Create(Tuple.Create(" ", 8546), Tuple.Create("d-priority-", 8547), true)
            
            #line 209 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 8558), Tuple.Create<System.Object, System.Int32>(priorityValue.ToLower()
            
            #line default
            #line hidden
, 8558), false)
);

WriteAttribute("title", Tuple.Create(" title=\"", 8585), Tuple.Create("\"", 8618)
            
            #line 209 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 8593), Tuple.Create<System.Object, System.Int32>(priorityValue
            
            #line default
            #line hidden
, 8593), false)
, Tuple.Create(Tuple.Create(" ", 8609), Tuple.Create("Priority", 8610), true)
);

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

            
            #line 210 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 210 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
           Write(Html.DropDownListFor(m => m.Token.JobQueue.Priority, priorityItems));

            
            #line default
            #line hidden
            
            #line 210 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                                    
                
            
            #line default
            #line hidden
            
            #line 211 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
           Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 211 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                       
                
            
            #line default
            #line hidden
            
            #line 212 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
           Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 212 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                         

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

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

WriteLiteral(@">
                    $(function () {
                        var element = $('#Token_JobQueue_Priority');

                        document.DiscoFunctions.PropertyChangeHelper(
                            element,
                            'Invalid Priority',
                            '");

            
            #line 220 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                         Write(Url.Action(MVC.API.JobQueue.UpdatePriority(Model.Token.JobQueue.Id)));

            
            #line default
            #line hidden
WriteLiteral(@"',
                            'Priority'
                        );

                        element.change(function () {
                            var icon = element.closest('td').find('i').first();
                            icon[0].className = '';
                            icon.addClass('fa d-priority-' + element.val().toLowerCase()).attr('title', element.val() + ' Priority');
                        });
                    });
                </script>
");

            
            #line 231 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
    }
    else
    {
        
            
            #line default
            #line hidden
            
            #line 234 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
   Write(Model.Token.JobQueue.Priority.ToString());

            
            #line default
            #line hidden
            
            #line 234 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                 
    }

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

            
            #line 243 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
        
            
            #line default
            #line hidden
            
            #line 243 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
         if (canConfig)
    {
        var slaOptions = JobQueueService.SlaOptions.Select(o => new SelectListItem() { Text = o.Value, Value = o.Key.ToString() }).ToList();

        if (this.Model.Token.JobQueue.DefaultSLAExpiry.HasValue)
        {
            var slaValue = this.Model.Token.JobQueue.DefaultSLAExpiry.Value;
            if (JobQueueService.SlaOptions.Where(o => o.Key == slaValue).Count() == 0)
            {
                string slaValueText;
                if (slaValue % (60 * 24 * 7 * 4) == 0)
                { slaValueText = string.Format("{0} months", slaValue / (60 * 24 * 7 * 4)); }
                else if (slaValue % (60 * 24 * 7) == 0)
                { slaValueText = string.Format("{0} weeks", slaValue / (60 * 24 * 7)); }
                else if (slaValue % (60 * 24) == 0)
                { slaValueText = string.Format("{0} days", slaValue / (60 * 24)); }
                else if (slaValue % (60) == 0)
                { slaValueText = string.Format("{0} hours", slaValue / 60); }
                else
                { slaValueText = string.Format("{0} minutes", slaValue); }

                slaOptions.Insert(0, new SelectListItem() { Text = string.Format("{0} <Custom>", slaValueText), Value = slaValue.ToString() });
            }
        }
        
            
            #line default
            #line hidden
            
            #line 267 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
   Write(Html.DropDownListFor(m => m.Token.JobQueue.DefaultSLAExpiry, slaOptions));

            
            #line default
            #line hidden
            
            #line 267 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                                 
        
            
            #line default
            #line hidden
            
            #line 268 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
   Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 268 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                               
        
            
            #line default
            #line hidden
            
            #line 269 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
   Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 269 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                 

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

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

WriteLiteral(">\r\n            $(function () {\r\n                document.DiscoFunctions.PropertyC" +
"hangeHelper(\r\n                    $(\'#Token_JobQueue_DefaultSLAExpiry\'),\r\n      " +
"              \'Invalid Default SLA\',\r\n                    \'");

            
            #line 275 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                 Write(Url.Action(MVC.API.JobQueue.UpdateDefaultSLAExpiry(Model.Token.JobQueue.Id)));

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

            
            #line 280 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
    }
    else
    {
        if (this.Model.Token.JobQueue.DefaultSLAExpiry.HasValue)
        {
            var slaValue = this.Model.Token.JobQueue.DefaultSLAExpiry.Value;
            var slaOption = JobQueueService.SlaOptions.Where(o => o.Key == slaValue).ToArray();
            if (slaOption.Length > 0)
            {
                
            
            #line default
            #line hidden
            
            #line 289 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
           Write(slaOption[0].Value);

            
            #line default
            #line hidden
            
            #line 289 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                   
            }
            else
            {

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

WriteLiteral("&lt;None&gt;");

WriteLiteral("\r\n");

            
            #line 294 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
            }
        }
        else
        {

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

WriteLiteral("&lt;None&gt;");

WriteLiteral("\r\n");

            
            #line 299 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
        }
    }

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n</tr>\r\n<tr>\r\n    <th>Member Groups/Users:</th>\r\n    <td>\r\n");

            
            #line 306 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
        
            
            #line default
            #line hidden
            
            #line 306 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
         if (Model.Token.SubjectIds.Count == 0)
        {

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

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

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

            
            #line 309 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
        }
        else
        {

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

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

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

WriteLiteral(">\r\n");

            
            #line 313 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                
            
            #line default
            #line hidden
            
            #line 313 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                 foreach (var sg in Model.Subjects)
                {
                    var displayName = sg.Id == sg.Name ? sg.Id : string.Format("{0} [{1}]", sg.Name, sg.Id);

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

WriteAttribute("class", Tuple.Create(" class=\"", 12796), Tuple.Create("\"", 12836)
            
            #line 316 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 12804), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
            
            #line default
            #line hidden
, 12804), false)
);

WriteLiteral(">\r\n");

            
            #line 317 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 317 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                         if (sg.IsGroup)
                    {

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

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

WriteLiteral("></i>");

            
            #line 319 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                         
            
            #line default
            #line hidden
            
            #line 319 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                    Write(displayName);

            
            #line default
            #line hidden
            
            #line 319 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                     
                    }
                    else
                    {

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

WriteAttribute("href", Tuple.Create(" href=\"", 13074), Tuple.Create("\"", 13116)
            
            #line 323 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 13081), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.User.Show(sg.Id))
            
            #line default
            #line hidden
, 13081), false)
);

WriteLiteral("><i");

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

WriteLiteral("></i>");

            
            #line 323 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                                                 Write(displayName);

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

            
            #line 324 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                    }

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

            
            #line 326 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                }

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

            
            #line 328 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
        }

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

            
            #line 329 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
         if (canConfig)
        {

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

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

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

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

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

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

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

WriteLiteral(" title=\"Job Queue Member Groups/Users\"");

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

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

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

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

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

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

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

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

WriteLiteral(">\r\n");

            
            #line 337 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 337 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                             foreach (var sg in Model.Subjects)
                            {
                                var displayName = sg.Id == sg.Name ? sg.Id : string.Format("{0} [{1}]", sg.Name, sg.Id);

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

WriteAttribute("class", Tuple.Create(" class=\"", 14095), Tuple.Create("\"", 14135)
            
            #line 340 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 14103), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
            
            #line default
            #line hidden
, 14103), false)
);

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

            
            #line 340 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                                        Write(sg.Id);

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

WriteLiteral(">\r\n");

            
            #line 341 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 341 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                     if (sg.IsGroup)
                                {

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

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

WriteLiteral("></i>");

            
            #line 343 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                     
            
            #line default
            #line hidden
            
            #line 343 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                Write(displayName);

            
            #line default
            #line hidden
            
            #line 343 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                                 
                                }
                                else
                                {

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

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

WriteLiteral("></i>");

            
            #line 347 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                    
            
            #line default
            #line hidden
            
            #line 347 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                               Write(displayName);

            
            #line default
            #line hidden
            
            #line 347 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                                
                                }
            
            #line default
            #line hidden
WriteLiteral("<i");

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

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

            
            #line 350 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                            }

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

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

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

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

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

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

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

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

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

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

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

WriteAttribute("action", Tuple.Create(" action=\"", 15129), Tuple.Create("\"", 15221)
            
            #line 357 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
    , Tuple.Create(Tuple.Create("", 15138), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.JobQueue.UpdateSubjects(Model.Token.JobQueue.Id, null, true))
            
            #line default
            #line hidden
, 15138), false)
);

WriteLiteral(" method=\"post\"");

WriteLiteral(@"></form>
                </div>
                <script>
                    (function () {
                        var dialog, textAdd, list, noSubjects, form;

                        function showDialog() {
                            if (!dialog) {
                                dialog = $('#Config_JobQueues_Subjects_Update_Dialog').dialog({
                                    resizable: false,
                                    modal: true,
                                    autoOpen: false,
                                    width: 350,
                                    height: 420,
                                    buttons: {
                                        ""Save Changes"": saveChanges,
                                        Cancel: cancel
                                    }
                                });

                                dialog.on('click', '.remove', remove);

                                list = $('#Config_JobQueues_Subjects_Update_Dialog_List');
                                noSubjects = $('#Config_JobQueues_Subjects_Update_Dialog_None');

                                textAdd = $('#Config_JobQueues_Subjects_Update_Dialog_TextAdd');

                                textAdd.watermark('Search Subjects')
                                    .autocomplete({
                                        source: '");

            
            #line 386 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                             Write(Url.Action(MVC.API.System.SearchSubjects()));

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                        minLength: 2,\r\n                      " +
"                  focus: function (e, ui) {\r\n                                   " +
"         textAdd.val(ui.item.Id);\r\n                                            r" +
"eturn false;\r\n                                        },\r\n                      " +
"                  select: function (e, ui) {\r\n                                  " +
"          textAdd.val(ui.item.Id).blur();\r\n                                     " +
"       return false;\r\n                                        }\r\n               " +
"                     }).data(\'ui-autocomplete\')._renderItem = function (ul, item" +
") {\r\n                                        return $(\"<li></li>\")\r\n            " +
"                                .data(\"item.autocomplete\", item)\r\n              " +
"                              .append(\"<a><strong>\" + item.Name + \"</strong><br>" +
"\" + item.Id + \" (\" + item.Type + \")</a>\")\r\n                                     " +
"       .appendTo(ul);\r\n                                    };\r\n\r\n               " +
"                 $(\'#Config_JobQueues_Subjects_Update_Dialog_Add\').click(add);\r\n" +
"                            }\r\n\r\n                            dialog.dialog(\'open" +
"\');\r\n\r\n                            updateNoSubjects();\r\n                        " +
"    return false;\r\n                        }\r\n\r\n                        function" +
" cancel() {\r\n                            $(this).dialog(\"close\");\r\n\r\n           " +
"                 list.find(\'li\').each(function () {\r\n                           " +
"     $this = $(this);\r\n                                if ($this.is(\'[data-subje" +
"ctstatus=\"new\"]\')) {\r\n                                    $this.remove();\r\n     " +
"                           } else {\r\n                                    if ($th" +
"is.is(\'[data-subjectstatus=\"removed\"]\')) {\r\n                                    " +
"    $this.show();\r\n                                        $this.attr(\'data-stat" +
"us\', \'\')\r\n                                    }\r\n                               " +
" }\r\n                            });\r\n                        }\r\n\r\n              " +
"          function remove() {\r\n                            $this = $(this).close" +
"st(\'li\');\r\n\r\n                            if ($this.is(\'[data-subjectstatus=\"new\"" +
"]\')) {\r\n                                $this.remove();\r\n                       " +
"     } else {\r\n                                $this.attr(\'data-subjectstatus\', " +
"\'removed\').hide();\r\n                            }\r\n\r\n                           " +
" updateNoSubjects();\r\n\r\n                            return false;\r\n             " +
"           }\r\n\r\n                        function add() {\r\n\r\n                    " +
"        var id = textAdd.val();\r\n\r\n                            $.ajax({\r\n       " +
"                         url: \'");

            
            #line 447 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                 Write(Url.Action(MVC.API.System.Subject()));

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                method: \'post\',\r\n                            " +
"    data: { Id: id }\r\n                            }).done(function (response) {\r" +
"\n                                if (response) {\r\n                              " +
"      if (response.IsGroup || response.IsUserAccount) {\r\n                       " +
"                 if (list.find(\'li[data-subjectid=\"\' + response.Id + \'\"]\').filte" +
"r(\'[data-status!=\"removed\"]\').length == 0) {\r\n\r\n                                " +
"            var liIcon = $(\'<i>\').addClass(\'fa fa-lg\');\r\n                       " +
"                     if (response.Type === \'user\')\r\n                            " +
"                    liIcon.addClass(\'fa-user\');\r\n                               " +
"             else\r\n                                                liIcon.addCla" +
"ss(\'fa-users\');\r\n\r\n                                            var li = $(\'<li>\'" +
")\r\n                                                .append(liIcon)\r\n            " +
"                                    .append($(\'<span>\').text(response.Id == resp" +
"onse.Name ? response.Id : response.Name + \' [\' + response.Id + \']\'))\r\n          " +
"                                      .append($(\'<i>\').addClass(\'fa fa-times-cir" +
"cle remove\'))\r\n                                                .addClass(respons" +
"e.Type)\r\n                                                .attr(\'data-subjectid\'," +
" response.Id)\r\n                                                .attr(\'data-subje" +
"ctstatus\', \'new\');\r\n\r\n                                            list.append(li" +
");\r\n\r\n                                            updateNoSubjects();\r\n         " +
"                               } else {\r\n                                       " +
"     alert(\'That subject has already been added\');\r\n                            " +
"            }\r\n                                    } else {\r\n                   " +
"                     alert(response.Name + \' [\' + response.Id + \'] is a \' + resp" +
"onse.Type + \'. Only users and groups can be added.\');\r\n                         " +
"           }\r\n                                } else {\r\n                        " +
"            alert(\'Unknown Id\');\r\n                                }\r\n           " +
"                 }).fail(function (jqXHR, textStatus, errorThrown) {\r\n          " +
"                      alert(\'Error: \' + errorThrown);\r\n                         " +
"   });\r\n\r\n                            return false;\r\n                        }\r\n" +
"\r\n                        function updateNoSubjects() {\r\n                       " +
"     if (list.find(\'li:visible\').length > 0)\r\n                                no" +
"Subjects.hide();\r\n                            else\r\n                            " +
"    noSubjects.show();\r\n                        }\r\n\r\n                        fun" +
"ction saveChanges() {\r\n                            var form = $(\'#Config_JobQueu" +
"es_Subjects_Update_Dialog_Form\').empty();\r\n\r\n                            list.fi" +
"nd(\'li[data-subjectstatus!=\"removed\"]\').each(function () {\r\n                    " +
"            var subjectId = $(this).attr(\'data-subjectid\');\r\n\r\n                 " +
"               form.append($(\'<input>\').attr({\r\n                                " +
"    \'name\': \'Subjects\',\r\n                                    \'type\': \'hidden\'\r\n " +
"                               }).val(subjectId));\r\n\r\n                          " +
"  }).get();\r\n\r\n                            form.submit();\r\n\r\n                   " +
"         dialog.dialog(\"disable\");\r\n                            dialog.dialog(\"o" +
"ption\", \"buttons\", null);\r\n                        }\r\n\r\n                        " +
"$(function () {\r\n                            $(\'#Config_JobQueues_Subjects_Updat" +
"e\').click(showDialog);\r\n                        });\r\n\r\n                    })();" +
"\r\n                </script>\r\n            </div>\r\n");

            
            #line 521 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
        }

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

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

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

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

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

WriteLiteral("                            ");

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

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

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

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

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

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

            
            #line 545 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                    }
                                }

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

            
            #line 549 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                    }

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

            
            #line 551 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
            }
            else
            {

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

WriteLiteral("&lt;None&gt;");

WriteLiteral("\r\n");

            
            #line 555 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
            }

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

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

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

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

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

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

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

WriteLiteral("                    <div");

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

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

WriteLiteral(" title=\"Job Queue Automatic Types\"");

WriteLiteral(">\r\n");

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

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

WriteAttribute("id", Tuple.Create(" id=\"", 25227), Tuple.Create("\"", 25249)
, Tuple.Create(Tuple.Create("", 25232), Tuple.Create("trJobType", 25232), true)
            
            #line 566 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 25241), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 25241), false)
);

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

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

WriteAttribute("id", Tuple.Create(" id=\"", 25358), Tuple.Create("\"", 25377)
, Tuple.Create(Tuple.Create("", 25363), Tuple.Create("Types_", 25363), true)
            
            #line 568 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 25369), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 25369), false)
);

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

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

WriteAttribute("value", Tuple.Create(" value=\"", 25410), Tuple.Create("\"", 25426)
            
            #line 568 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                          , Tuple.Create(Tuple.Create("", 25418), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 25418), false)
);

WriteLiteral(" ");

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

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

WriteAttribute("for", Tuple.Create(" for=\"", 25497), Tuple.Create("\"", 25517)
, Tuple.Create(Tuple.Create("", 25503), Tuple.Create("Types_", 25503), true)
            
            #line 568 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                                                                     , Tuple.Create(Tuple.Create("", 25509), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 25509), false)
);

WriteLiteral(">");

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

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

WriteAttribute("id", Tuple.Create(" id=\"", 25627), Tuple.Create("\"", 25649)
, Tuple.Create(Tuple.Create("", 25632), Tuple.Create("SubTypes_", 25632), true)
            
            #line 570 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 25641), Tuple.Create<System.Object, System.Int32>(jt.Id
            
            #line default
            #line hidden
, 25641), false)
);

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

WriteLiteral(">\r\n");

WriteLiteral("                                        ");

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

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

WriteLiteral("                                        ");

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

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

            
            #line 575 "..\..\Areas\Config\Views\JobQueue\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_JobQueues_JobSubTypes_Update_Dialog\').dialog({\r\n   " +
"                                     resizable: false,\r\n                        " +
"                modal: true,\r\n                                        autoOpen: " +
"false,\r\n                                        width: 750,\r\n                   " +
"                     height: 560,\r\n                                        butto" +
"ns: {\r\n                                            \"Save Changes\": saveChanges,\r" +
"\n                                            Cancel: cancel\r\n                   " +
"                     }\r\n                                    });\r\n\r\n             " +
"                       dialog.find(\'.jobSubTypes\').hide();\r\n                    " +
"                dialog.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_\' + $t" +
"his.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.dial" +
"og(\'open\');\r\n\r\n                                return false;\r\n                  " +
"          }\r\n\r\n                            function cancel() {\r\n                " +
"                dialog.dialog(\"disable\");\r\n                                dialo" +
"g.dialog(\"option\", \"buttons\", null);\r\n\r\n                                // Refre" +
"sh Page\r\n                                window.location.href = window.location." +
"href;\r\n                            }\r\n\r\n                            function sav" +
"eChanges() {\r\n                                var form = dialog.find(\'form\');\r\n\r" +
"\n                                $(\'input.jobType:unchecked\').each(function () {" +
"\r\n                                    $(\'#SubTypes_\' + $(this).val()).find(\'inpu" +
"t\').prop(\'checked\', false);\r\n                                });\r\n\r\n            " +
"                    form.submit();\r\n\r\n                                dialog.dia" +
"log(\"disable\");\r\n                                dialog.dialog(\"option\", \"button" +
"s\", null);\r\n                            }\r\n\r\n                            $(funct" +
"ion () {\r\n                                $(\'#Config_JobQueues_JobSubTypes_Updat" +
"e\').click(showDialog);\r\n                            });\r\n\r\n                     " +
"   })();\r\n                    </script>\r\n");

            
            #line 640 "..\..\Areas\Config\Views\JobQueue\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>When jobs of these types are created, they will automatically be added into " +
"this queue.\r\n            </p>\r\n        </div>\r\n    </td>\r\n</tr>\r\n</table>\r\n</div" +
">\r\n");

            
            #line 650 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
 if (canDelete || canShowJobs)
{

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

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

WriteLiteral(">\r\n");

            
            #line 653 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
        
            
            #line default
            #line hidden
            
            #line 653 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
         if (canDelete)
        {
            
            
            #line default
            #line hidden
            
            #line 655 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
       Write(Html.ActionLinkButton("Delete", MVC.API.JobQueue.Delete(Model.Token.JobQueue.Id, true), "Config_JobQueues_Actions_Delete_Button"));

            
            #line default
            #line hidden
            
            #line 655 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                                                                                              

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

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

WriteLiteral(" title=\"Delete this Job Queue?\"");

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

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

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

WriteLiteral("            <script");

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

WriteLiteral(@">
                $(function () {
                    var button = $('#Config_JobQueues_Actions_Delete_Button');
                    var buttonDialog = $('#Config_JobQueues_Actions_Delete_Dialog');
                    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 () {
                                var $this = $(this);
                                $this.dialog(""disable"");
                                $this.dialog(""option"", ""buttons"", null);
                                window.location.href = buttonLink;
                            },
                            Cancel: function () {
                                $(this).dialog(""close"");
                            }
                        }
                    });
                });
            </script>
");

            
            #line 692 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
        }

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

            
            #line 693 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
         if (canShowJobs)
        {
            
            
            #line default
            #line hidden
            
            #line 695 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
       Write(Html.ActionLinkButton(string.Format("Show {0} job{1}", Model.OpenJobCount, (Model.OpenJobCount == 1 ? null : "s")), MVC.Job.Queue(Model.Token.JobQueue.Id), "Config_JobQueues_Actions_ShowJobs_Button"));

            
            #line default
            #line hidden
            
            #line 695 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
                                                                                                                                                                                                                    
        }

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

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