#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.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.Models.Repository;
    using Disco.Services;
    using Disco.Services.Authorization;
    using Disco.Services.Web;
    using Disco.Web;
    
    #line 1 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
    using Disco.Web.Areas.Config.Models.UserFlag;
    
    #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/Export.cshtml")]
    public partial class Export : Disco.Services.Web.WebViewPage<ExportModel>
    {
        public Export()
        {
        }
        public override void Execute()
        {
            
            #line 3 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
  
    Authorization.RequireAny(Claims.Config.UserFlag.Export);

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

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

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

WriteLiteral(">\r\n");

            
            #line 9 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
    
            
            #line default
            #line hidden
            
            #line 9 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
     using (Html.BeginForm(MVC.API.UserFlag.Export(), FormMethod.Post, new { @data_saveaction = Url.Action(MVC.API.UserFlag.SaveExport()) }))
    {
        
            
            #line default
            #line hidden
            
            #line 11 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
   Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
            
            #line 11 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
                                

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

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

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

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

WriteLiteral(">\r\n            <h2>Export Scope</h2>\r\n            <table>\r\n                <tr>\r\n" +
"                    <th");

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

WriteLiteral(">\r\n                        User Flags:\r\n                    </th>\r\n              " +
"      <td>\r\n");

            
            #line 20 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 20 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
                         foreach (var userFlag in Model.UserFlags)
                        {

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

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

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

WriteLiteral(" name=\"Options.UserFlagIds\"");

WriteAttribute("value", Tuple.Create(" value=\"", 1064), Tuple.Create("\"", 1084)
            
            #line 24 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
                                      , Tuple.Create(Tuple.Create("", 1072), Tuple.Create<System.Object, System.Int32>(userFlag.Id
            
            #line default
            #line hidden
, 1072), false)
);

WriteLiteral(" ");

            
            #line 24 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
                                                                                                                                Write(((bool)Model.Options.UserFlagIds.Contains(userFlag.Id)) ? "checked " : null);

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

WriteAttribute("class", Tuple.Create(" class=\"", 1207), Tuple.Create("\"", 1268)
, Tuple.Create(Tuple.Create("", 1215), Tuple.Create("fa", 1215), true)
, Tuple.Create(Tuple.Create(" ", 1217), Tuple.Create("fa-", 1218), true)
            
            #line 25 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
, Tuple.Create(Tuple.Create("", 1221), Tuple.Create<System.Object, System.Int32>(userFlag.Icon
            
            #line default
            #line hidden
, 1221), false)
, Tuple.Create(Tuple.Create(" ", 1237), Tuple.Create("fa-lg", 1238), true)
, Tuple.Create(Tuple.Create(" ", 1243), Tuple.Create("d-", 1244), true)
            
            #line 25 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
, Tuple.Create(Tuple.Create("", 1246), Tuple.Create<System.Object, System.Int32>(userFlag.IconColour
            
            #line default
            #line hidden
, 1246), false)
);

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

            
            #line 26 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
                                     Write(userFlag.Name);

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

            
            #line 29 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
                        }

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

            
            #line 33 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
                   Write(Html.LabelFor(m => m.Options.CurrentOnly));

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

WriteLiteral("                        ");

            
            #line 35 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
                   Write(Html.CheckBoxFor(m => m.Options.CurrentOnly));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        <p>Uncheck to include all historical user flag assignme" +
"nts.</p>\r\n                    </td>\r\n                </tr>\r\n                <tr>" +
"\r\n                    <th>");

            
            #line 40 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
                   Write(Html.LabelFor(m => m.Options.Format));

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

WriteLiteral("                        ");

            
            #line 42 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
                   Write(Html.DropDownListFor(m => m.Options.Format, Enum.GetNames(typeof(Disco.Models.Exporting.ExportFormat)).Select(v => new SelectListItem() { Value = v, Text = v })));

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

            
            #line 47 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
        
            
            #line default
            #line hidden
            
            #line 47 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
   Write(Html.Partial(MVC.Shared.Views._ExportFields, Model.Fields.FieldGroups));

            
            #line default
            #line hidden
            
            #line 47 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
                                                                               

            
            #line default
            #line hidden
WriteLiteral("        <script>\r\n            $(function () {\r\n                const $exportField" +
"s = $(\'#Export_Fields\');\r\n                const $form = $exportFields.closest(\'f" +
"orm\');\r\n                let $exportingDialog = null;\r\n\r\n                $.valida" +
"tor.unobtrusive.parse($form);\r\n                $form.data(\"validator\").settings." +
"submitHandler = function () {\r\n                    const exportFieldCount = $exp" +
"ortFields.find(\'input:checked\').length;\r\n\r\n                    if (exportFieldCo" +
"unt > 0) {\r\n\r\n                        if ($exportingDialog == null) {\r\n         " +
"                   $exportingDialog = $(\'#Export_Exporting\').dialog({\r\n         " +
"                       width: 400,\r\n                                height: 164," +
"\r\n                                resizable: false,\r\n                           " +
"     modal: true,\r\n                                autoOpen: false\r\n            " +
"                });\r\n                        }\r\n                        $exporti" +
"ngDialog.dialog(\'open\');\r\n\r\n                        $form[0].submit();\r\n        " +
"                return;\r\n                    }\r\n\r\n                    alert(\'Sel" +
"ect at least one field to export.\');\r\n                };\r\n\r\n                $(\'#" +
"UserFlag_Export_Button\').on(\'click\', function () {\r\n                    $form.su" +
"bmit();\r\n                });\r\n                $(\'#UserFlag_Export_Save_Button\')." +
"on(\'click\', function () {\r\n                    $form.attr(\'action\', $form[0].dat" +
"aset.saveaction);\r\n                    $form.submit();\r\n                });\r\n   " +
"         });\r\n        </script>\r\n");

            
            #line 87 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
    }

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

            
            #line 89 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
 if (Model.ExportId.HasValue)
{

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

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

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

WriteLiteral(" title=\"Export User Flags\"");

WriteLiteral(">\r\n");

            
            #line 92 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
        
            
            #line default
            #line hidden
            
            #line 92 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
         if (Model.ExportResult.RecordCount == 0)
        {

            
            #line default
            #line hidden
WriteLiteral("            <h4>No records matched the filter criteria</h4>\r\n");

            
            #line 95 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
        }
        else
        {

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

            
            #line 98 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
           Write(Model.ExportResult.RecordCount);

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

            
            #line 98 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
                                                  Write(Model.ExportResult.RecordCount != 1 ? "s" : null);

            
            #line default
            #line hidden
WriteLiteral(" were successfully exported.</h4>\r\n");

WriteLiteral("            <a");

WriteAttribute("href", Tuple.Create(" href=\"", 4296), Tuple.Create("\"", 4369)
            
            #line 99 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
, Tuple.Create(Tuple.Create("", 4303), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.UserFlag.ExportRetrieve(Model.ExportId.Value))
            
            #line default
            #line hidden
, 4303), false)
);

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

WriteLiteral("><i");

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

WriteLiteral("></i>Download User Flag Export</a>\r\n");

            
            #line 100 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
        }

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

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

            
            #line 114 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
}

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

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

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

WriteLiteral(" title=\"Exporting User Flags...\"");

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

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

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

WriteLiteral("></i>Exporting user flags...</h4>\r\n</div>\r\n<div");

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

WriteLiteral(">\r\n");

            
            #line 119 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
    
            
            #line default
            #line hidden
            
            #line 119 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
     if (Authorization.Has(Claims.Config.ManageSavedExports))
    {

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

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

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

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

WriteLiteral(">Save Export</button>\r\n");

            
            #line 122 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
    }
    else
    {

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

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

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

WriteLiteral(" disabled");

WriteLiteral(" title=\"Requires Manage Saved Exports Permission\"");

WriteLiteral(">Save Export</button>\r\n");

            
            #line 126 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
    }

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

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

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

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

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

        }
    }
}
#pragma warning restore 1591
