#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.34014
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

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

    ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "User Flags", MVC.Config.UserFlag.Index(null), Model.UserFlag.ToString());

    var canConfig = Authorization.Has(Claims.Config.UserFlag.Configure);
    var canDelete = Authorization.Has(Claims.Config.UserFlag.Delete);
    var canBulkAssignment = Authorization.HasAll(Claims.User.Actions.AddFlags, Claims.User.Actions.RemoveFlags, Claims.User.ShowFlagAssignments);
    var canShowUsers = Model.CurrentAssignmentCount > 0 && Authorization.HasAll(Claims.User.Search, Claims.User.ShowFlagAssignments);

    var hideAdvanced =
        Model.UserFlag.UserDevicesLinkedGroup == null &&
        Model.UserFlag.UsersLinkedGroup == null;

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

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

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

WriteAttribute("class", Tuple.Create(" class=\"", 1092), Tuple.Create("\"", 1151)
, Tuple.Create(Tuple.Create("", 1100), Tuple.Create("form", 1100), true)
            
            #line 21 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
, Tuple.Create(Tuple.Create("", 1104), Tuple.Create<System.Object, System.Int32>(hideAdvanced ? " Config_HideAdvanced" : null
            
            #line default
            #line hidden
, 1104), false)
);

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

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

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

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

WriteLiteral("                ");

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

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

            
            #line 33 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                 if (canConfig)
                {
            
            #line default
            #line hidden
            
            #line 34 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
            Write(Html.EditorFor(model => model.UserFlag.Name));

            
            #line default
            #line hidden
            
            #line 34 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                              
                
            
            #line default
            #line hidden
            
            #line 35 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
           Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 35 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                       
                
            
            #line default
            #line hidden
            
            #line 36 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
           Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 36 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                         

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

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

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

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

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

            
            #line 47 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                }
                else
                {
                
            
            #line default
            #line hidden
            
            #line 50 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
           Write(Model.UserFlag.Name);

            
            #line default
            #line hidden
            
            #line 50 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                    
                }

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

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

            
            #line default
            #line hidden
            
            #line 58 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                                     
                
            
            #line default
            #line hidden
            
            #line 59 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
           Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 59 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                       
                
            
            #line default
            #line hidden
            
            #line 60 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
           Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 60 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                         

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

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

WriteLiteral(">\r\n                    $(function () {\r\n                        document.DiscoFun" +
"ctions.PropertyChangeHelper(\r\n                            $(\'#UserFlag_Descripti" +
"on\'),\r\n                            \'Invalid Description\',\r\n                     " +
"       \'");

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

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

            
            #line 71 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                }
                else
                {

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

            
            #line 75 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 75 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                     if (string.IsNullOrEmpty(Model.UserFlag.Description))
                    {

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

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

WriteLiteral("\r\n");

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

            
            #line default
            #line hidden
            
            #line 81 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                                   
                    }

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

            
            #line 84 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                }

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

            
            #line 91 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                        Write(Model.CurrentAssignmentCount);

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

            
            #line 91 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                           Write(Model.CurrentAssignmentCount != 1 ? "s" : null);

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

            
            #line 92 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                Write(Model.TotalAssignmentCount);

            
            #line default
            #line hidden
WriteLiteral(" total user historical assignment");

            
            #line 92 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                                             Write(Model.TotalAssignmentCount != 1 ? "s" : null);

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

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

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

            
            #line 99 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                     Write(Model.UserFlag.Icon);

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

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

            
            #line 99 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                                                          Write(Model.UserFlag.IconColour);

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

WriteAttribute("class", Tuple.Create(" class=\"", 4042), Tuple.Create("\"", 4115)
, Tuple.Create(Tuple.Create("", 4050), Tuple.Create("fa", 4050), true)
, Tuple.Create(Tuple.Create(" ", 4052), Tuple.Create("fa-", 4053), true)
            
            #line 99 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                          , Tuple.Create(Tuple.Create("", 4056), Tuple.Create<System.Object, System.Int32>(Model.UserFlag.Icon
            
            #line default
            #line hidden
, 4056), false)
, Tuple.Create(Tuple.Create(" ", 4078), Tuple.Create("fa-4x", 4079), true)
, Tuple.Create(Tuple.Create(" ", 4084), Tuple.Create("d-", 4085), true)
            
            #line 99 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                                                         , Tuple.Create(Tuple.Create("", 4087), Tuple.Create<System.Object, System.Int32>(Model.UserFlag.IconColour
            
            #line default
            #line hidden
, 4087), false)
);

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

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

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

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

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

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

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

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

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

WriteLiteral(" title=\"User Flag Icon\"");

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

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

WriteLiteral(">\r\n");

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

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

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

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

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

WriteAttribute("class", Tuple.Create(" class=\"", 4680), Tuple.Create("\"", 4705)
, Tuple.Create(Tuple.Create("", 4688), Tuple.Create("fa", 4688), true)
, Tuple.Create(Tuple.Create(" ", 4690), Tuple.Create("fa-", 4691), true)
            
            #line 109 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
 , Tuple.Create(Tuple.Create("", 4694), Tuple.Create<System.Object, System.Int32>(icon.Key
            
            #line default
            #line hidden
, 4694), false)
);

WriteAttribute("title", Tuple.Create(" title=\"", 4706), Tuple.Create("\"", 4725)
            
            #line 109 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                    , Tuple.Create(Tuple.Create("", 4714), Tuple.Create<System.Object, System.Int32>(icon.Value
            
            #line default
            #line hidden
, 4714), false)
);

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

            
            #line 110 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                    }

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

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

WriteLiteral(">\r\n");

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

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

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

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

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

WriteAttribute("class", Tuple.Create(" class=\"", 5057), Tuple.Create("\"", 5093)
, Tuple.Create(Tuple.Create("", 5065), Tuple.Create("fa", 5065), true)
, Tuple.Create(Tuple.Create(" ", 5067), Tuple.Create("fa-square", 5068), true)
, Tuple.Create(Tuple.Create(" ", 5077), Tuple.Create("d-", 5078), true)
            
            #line 115 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
              , Tuple.Create(Tuple.Create("", 5080), Tuple.Create<System.Object, System.Int32>(colour.Key
            
            #line default
            #line hidden
, 5080), false)
);

WriteAttribute("title", Tuple.Create(" title=\"", 5094), Tuple.Create("\"", 5115)
            
            #line 115 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                   , Tuple.Create(Tuple.Create("", 5102), Tuple.Create<System.Object, System.Int32>(colour.Value
            
            #line default
            #line hidden
, 5102), false)
);

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

            
            #line 116 "..\..\Areas\Config\Views\UserFlag\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, colou" +
"rs, icons;\r\n\r\n                                function showDialog() {\r\n         " +
"                           if (!dialog) {\r\n                                     " +
"   dialog = $(\'#Config_UserFlags_Icon_Update_Dialog\').dialog({\r\n                " +
"                            resizable: false,\r\n                                 " +
"           modal: true,\r\n                                            autoOpen: f" +
"alse,\r\n                                            width: 750,\r\n                " +
"                            height: 650,\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-icon=\"\' + icon.attr(\'data-icon\') +" +
" \'\"]\').each(selectIcon);\r\n\r\n                                    dialog.dialog(\'o" +
"pen\');\r\n\r\n                                    return false;\r\n                   " +
"             }\r\n\r\n                                function selectColour() {\r\n   " +
"                                 var $this = $(this),\r\n                         " +
"               colourCode = $this.attr(\'data-colour\'),\r\n                        " +
"                previousColourCode = 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                                        icon" +
"s.removeClass(\'d-\' + previousColourCode);\r\n                                    i" +
"cons.attr(\'data-colour\', colourCode)\r\n                                    icons." +
"addClass(\'d-\' + colourCode);\r\n                                }\r\n               " +
"                 function selectIcon() {\r\n                                    va" +
"r $this = $(this),\r\n                                        iconCode = $this.att" +
"r(\'data-icon\');\r\n\r\n                                    icons.find(\'i\').removeCla" +
"ss(\'selected\');\r\n                                    $this.addClass(\'selected\');" +
"\r\n                                }\r\n\r\n                                function " +
"save() {\r\n                                    var url = \'");

            
            #line 176 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                           Write(Url.Action(MVC.API.UserFlag.UpdateIconAndColour(id: Model.UserFlag.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_UserFlags_Icon');
                                    $('#Config_UserFlags_Icon_Update').click(showDialog);
                                });
                            }());
                        </script>
                    </div>
");

            
            #line 198 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                }

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

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

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

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

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

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

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

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

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

            
            #line 217 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
        }

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

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

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

WriteLiteral("                    ");

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

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

WriteLiteral("                    ");

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

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

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

            
            #line default
            #line hidden
            
            #line 241 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                                                
                    }

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

            
            #line 248 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
 if (canBulkAssignment || canDelete || canShowUsers)
{

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

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

WriteLiteral(">\r\n");

            
            #line 251 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
        
            
            #line default
            #line hidden
            
            #line 251 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
         if (canBulkAssignment)
        {

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

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

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

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

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

WriteLiteral("            <div");

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

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

WriteLiteral(" title=\"Bulk Assign User Mode\"");

WriteLiteral(">\r\n                <p>\r\n                    Select the mode used to assign users:" +
"\r\n                </p>\r\n                <div>\r\n                    <div");

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

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

WriteLiteral(" class=\"fa fa-plus fa-fw\"");

WriteLiteral(@"></i>Add</h5>
                        <p>
                            Specified users will have this flag <strong>added</strong>. Users who already have this flag will be skipped.
                        </p>
                    </div>
                    <div");

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

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

WriteLiteral(" class=\"fa fa-repeat fa-fw\"");

WriteLiteral(@"></i>Override</h5>
                        <p>
                            Specified users will have this flag <strong>added</strong>. Specified users which already have this flag will be skipped.
                                    Users who already have this flag but are not specified will have the flag <strong>removed</strong>.
                        </p>
                    </div>
                </div>
            </div>
");

WriteLiteral("            <div");

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

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

WriteLiteral(" title=\"Bulk Assign Users\"");

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

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

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

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

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

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

WriteLiteral(">\r\n                            user6<br />\r\n                            smi0099<b" +
"r />\r\n");

WriteLiteral("                            ");

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

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

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

WriteLiteral(">user6,smi0099,");

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

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

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

WriteLiteral(">user6;smi0099;");

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

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

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

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

WriteLiteral(" class=\"fa fa-lg fa-cog fa-spin\"");

WriteLiteral(" title=\"Please Wait\"");

WriteLiteral("></i>Loading current assignments...</h4>\r\n                </div>\r\n               " +
" <form");

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

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

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

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

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

WriteLiteral("></textarea>\r\n                    <h4>Comments:</h4>\r\n                    <textar" +
"ea");

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

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

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

WriteLiteral("            <script>\r\n                $(function () {\r\n                    var mo" +
"deDialog, assignDialog, assignUserIds;\r\n\r\n                    function showModeD" +
"ialog() {\r\n                        if (!modeDialog) {\r\n                         " +
"   modeDialog = $(\'#Config_UserFlags_BulkAssign_ModeDialog\').dialog({\r\n         " +
"                       resizable: false,\r\n                                modal:" +
" true,\r\n                                autoOpen: false,\r\n                      " +
"          width: 400,\r\n                                buttons: {\r\n             " +
"                       Cancel: function () {\r\n                                  " +
"      $(this).dialog(\'close\');\r\n                                    }\r\n         " +
"                       }\r\n                            });\r\n\r\n                   " +
"         modeDialog.find(\'.add\').click(function () {\r\n                          " +
"      modeDialog.dialog(\'close\');\r\n                                showAssignDia" +
"log(\'Add\');\r\n                            });\r\n                            modeDi" +
"alog.find(\'.override\').click(function () {\r\n                                mode" +
"Dialog.dialog(\'close\');\r\n                                showAssignDialog(\'Overr" +
"ide\');\r\n                            });\r\n                        }\r\n            " +
"            modeDialog.dialog(\'open\');\r\n                    }\r\n                 " +
"   function showAssignDialog(mode) {\r\n                        if (!assignDialog)" +
" {\r\n                            assignDialog = $(\'#Config_UserFlags_BulkAssign_A" +
"ssignDialog\').dialog({\r\n                                resizable: false,\r\n     " +
"                           modal: true,\r\n                                autoOpe" +
"n: false,\r\n                                width: 460\r\n                         " +
"   });\r\n\r\n                            assignUserIds = $(\'#Config_UserFlags_BulkA" +
"ssign_AssignDialog_UserIds\');\r\n                        }\r\n\r\n                    " +
"    assignDialog.removeClass(\'loading\');\r\n\r\n                        var buttons " +
"= {};\r\n                        buttons[mode + \" User Flags\"] = function () {\r\n  " +
"                          $(this).find(\'form\').submit();\r\n                      " +
"      $(this).dialog(\"disable\");\r\n                        }\r\n                   " +
"     buttons[\'Cancel\'] = function () {\r\n                            $(this).dial" +
"og(\'close\');\r\n                        }\r\n                        assignDialog.di" +
"alog(\'option\', \'buttons\', buttons);\r\n                        assignDialog.dialog" +
"(\'option\', \'title\', \'Bulk Assign Users: \' + mode);\r\n\r\n                        if" +
" (mode == \"Override\") {\r\n                            assignUserIds.closest(\'form" +
"\').attr(\'action\', \'");

            
            #line 354 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                                      Write(Url.Action(MVC.API.UserFlag.BulkAssignUsers(Model.UserFlag.Id, true)));

            
            #line default
            #line hidden
WriteLiteral("\');\r\n\r\n                            assignDialog.addClass(\'loading\');\r\n           " +
"                 $.getJSON(\'");

            
            #line 357 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                  Write(Url.Action(MVC.API.UserFlag.AssignedUsers(Model.UserFlag.Id)));

            
            #line default
            #line hidden
WriteLiteral(@"', function (response, result) {
                                assignDialog.removeClass('loading');

                                if (result != 'success') {
                                    alert('Unable to load current assignments:\n' + response);
                                    assignDialog.dialog('close');
                                } else {
                                    if (!!response) {
                                        assignUserIds.val(response.join('\n'));
                                    } else {
                                        assignUserIds.val('');
                                    }
                                }
                            });
                        }
                        else // Assume Add
                        {
                            assignUserIds.closest('form').attr('action', '");

            
            #line 374 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                                      Write(Url.Action(MVC.API.UserFlag.BulkAssignUsers(Model.UserFlag.Id, false)));

            
            #line default
            #line hidden
WriteLiteral(@"');
                        }

                        assignDialog.dialog('open');
                    }

                    $('#Config_UserFlags_BulkAssign_Button').click(function () {
                        showModeDialog();
                        return false;
                    });
                });
            </script>
");

            
            #line 386 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
        }

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

            
            #line 390 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
        
            
            #line default
            #line hidden
            
            #line 390 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
         if (canDelete)
        {
            
            
            #line default
            #line hidden
            
            #line 392 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
       Write(Html.ActionLinkButton("Delete", MVC.API.UserFlag.Delete(Model.UserFlag.Id, true), "Config_UserFlags_Actions_Delete_Button"));

            
            #line default
            #line hidden
            
            #line 392 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                                                                                                        

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

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

WriteLiteral(" title=\"Delete this User Flag?\"");

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

            
            #line 398 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 398 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                     if (Model.CurrentAssignmentCount > 0)
                    {

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

            
            #line 400 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                           Write(Model.CurrentAssignmentCount);

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

            
            #line 400 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                              Write(Model.CurrentAssignmentCount != 1 ? "s are" : " is");

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

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

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

            
            #line 403 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                    Are you sure?\r\n                </p>\r\n            </div>\r\n");

WriteLiteral("            <script");

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

WriteLiteral(@">
                $(function () {
                    var button = $('#Config_UserFlags_Actions_Delete_Button');
                    var buttonDialog = $('#Config_UserFlags_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 435 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
        }

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

            
            #line 436 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
         if (canShowUsers)
        {
            
            
            #line default
            #line hidden
            
            #line 438 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
       Write(Html.ActionLinkButton(string.Format("Show {0} user{1}", Model.CurrentAssignmentCount, (Model.CurrentAssignmentCount == 1 ? null : "s")), MVC.Search.Query(Model.UserFlag.Id.ToString(), "UserFlag"), "Config_UserFlags_Actions_ShowUsers_Button"));

            
            #line default
            #line hidden
            
            #line 438 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
                                                                                                                                                                                                                                                              
        }

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

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