#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 ASP
{
    using System;
    using System.Collections.Generic;
    using System.Globalization;
    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 Epinova.ElasticSearch.Core.EPiServer.Extensions;
    using Epinova.ElasticSearch.Core.EPiServer.Models.ViewModels;
    using Epinova.ElasticSearch.Core.Models;
    using EPiServer;
    using EPiServer.Core;
    using EPiServer.Editor;
    using EPiServer.Security;
    using EPiServer.SpecializedProperties;
    using EPiServer.Web;
    using EPiServer.Web.Mvc.Html;
    using EPiServer.Web.Routing;
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
    [System.Web.WebPages.PageVirtualPathAttribute("~/Views/ElasticSearchAdmin/IndexInspector/Index.cshtml")]
    public partial class _Views_ElasticSearchAdmin_IndexInspector_Index_cshtml : System.Web.Mvc.WebViewPage<InspectViewModel>
    {
        public _Views_ElasticSearchAdmin_IndexInspector_Index_cshtml()
        {
        }
        public override void Execute()
        {
WriteLiteral("\r\n");

WriteLiteral("\r\n");

  
    Layout = "~/Views/ElasticSearchAdmin/_ElasticSearch.cshtml";

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

 if (Model == null)
{
    return;
}

WriteLiteral("\r\n");

  
    string localizationPath = "/epinovaelasticsearch/indexinspector/";

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

DefineSection("Scripts", () => {

WriteLiteral(@"
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            var accordions = document.getElementsByClassName(""_jsAccordion"");

            for (var i = 0; i < accordions.length; i++) {
                accordions[i].onclick = function (e) {
                    e.preventDefault();

                    if (this.getAttribute('aria-expanded') === 'false') {
                        this.setAttribute(""aria-expanded"", ""true"");
                    } else {
                        this.setAttribute(""aria-expanded"", ""false"");
                    }

                    var controls = this.getAttribute('aria-controls'),
                        content = document.getElementById(controls);

                    if (content.style.display === ""block"") {
                        content.style.display = ""none"";
                    } else {
                        content.style.display = ""block"";
                    }
                }
            }
        }, false);
    </script>
");

});

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

WriteLiteral(" class=\"epi-padding-small\"");

WriteLiteral(">\r\n");

    
     if (Model.Indices.Count > 1)
    {

WriteLiteral("        <h2>");

       Write(Html.TranslateWithPathRaw("indexes", localizationPath));

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

WriteLiteral("        <div");

WriteLiteral(" data-dojo-type=\"dijit/form/DropDownButton\"");

WriteLiteral(" class=\"epi-primary\"");

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

             Write(Model.SelectedIndexName);

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

WriteLiteral(" data-dojo-type=\"dijit/DropDownMenu\"");

WriteLiteral(">\r\n");

                
                 foreach (var index in Model.Indices)
                {
                    if (index.Key != Model.SelectedIndex)
                    {

WriteLiteral("                        <div");

WriteLiteral(" data-dojo-type=\"dijit/MenuItem\"");

WriteLiteral(" data-dojo-props=\"onClick:function(){document.location=\'?index=");

                                                                                                                      Write(index.Key);

WriteLiteral("\';}\"");

WriteLiteral(">\r\n");

WriteLiteral("                            ");

                       Write(index.Value);

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

                    }
                }

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

    }

WriteLiteral("\r\n");

    
     using (Html.BeginForm("Index", "ElasticIndexInspector", new { index = Model.SelectedIndex }, FormMethod.Post, null))
    {

WriteLiteral("        <div");

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

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

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

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

WriteLiteral(" class=\"EP-prefix\"");

WriteLiteral(">");

                                 Write(Html.TranslateWithPath("heading", localizationPath));

WriteLiteral("</h1>\r\n                <p>\r\n                    <input");

WriteLiteral(" data-dojo-type=\"dijit/form/ValidationTextBox\"");

WriteLiteral(" data-dojo-props=\"placeholder:\'");

                                                                                                  Write(Html.TranslateWithPathRaw("placeholder", localizationPath));

WriteLiteral("\'\"");

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

WriteAttribute("value", Tuple.Create(" value=\"", 2805), Tuple.Create("\"", 2830)
                                                                                                              , Tuple.Create(Tuple.Create("", 2813), Tuple.Create<System.Object, System.Int32>(Model.SearchText
, 2813), false)
);

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

WriteLiteral(" data-dojo-type=\"dijit/form/Button\"");

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

WriteLiteral(" class=\"epi-primary\"");

WriteLiteral(">");

                                                                                            Write(Html.TranslateWithPath("execute", localizationPath));

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

WriteLiteral("                    ");

               Write(Html.CheckBoxFor(m => m.Analyzed));

WriteLiteral("\r\n");

WriteLiteral("                    ");

               Write(Html.TranslateWithPath("Analyzed", localizationPath));

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

                
                 if (String.IsNullOrWhiteSpace(Model.SearchText) && String.IsNullOrWhiteSpace(Model.SelectedType))
                {

WriteLiteral("                    <h2>");

                   Write(Html.TranslateWithPath("unfiltered", localizationPath));

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

                }
                else if (Model.SearchHits == null || !Model.SearchHits.Any())
                {

WriteLiteral("                    <h2>");

                   Write(Html.TranslateWithPath("nohits", localizationPath));

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

                }
                else
                {

WriteLiteral("                    <ol");

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

WriteLiteral(">\r\n");

                        
                         for (var index = 0; index < Model.SearchHits.Count; index++)
                        {
                            InspectItem item = Model.SearchHits[index];

WriteLiteral("                            <li");

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

WriteLiteral(">\r\n                                <h3>\r\n                                    <but" +
"ton");

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

WriteAttribute("aria-controls", Tuple.Create(" aria-controls=\"", 4007), Tuple.Create("\"", 4034)
, Tuple.Create(Tuple.Create("", 4023), Tuple.Create("item-", 4023), true)
, Tuple.Create(Tuple.Create("", 4028), Tuple.Create<System.Object, System.Int32>(index
, 4028), false)
);

WriteLiteral(" aria-expanded=\"false\"");

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

WriteLiteral(">");

                                                                                                                            Write(item.Title);

WriteLiteral(" - <i>");

                                                                                                                                             Write(item.ShortTypeName);

WriteLiteral("</i></button>\r\n                                </h3>\r\n                           " +
"     <div");

WriteLiteral(" class=\"accordion-panel\"");

WriteLiteral(" style=\"display: none;\"");

WriteAttribute("id", Tuple.Create(" id=\"", 4252), Tuple.Create("\"", 4268)
, Tuple.Create(Tuple.Create("", 4257), Tuple.Create("item-", 4257), true)
             , Tuple.Create(Tuple.Create("", 4262), Tuple.Create<System.Object, System.Int32>(index
, 4262), false)
);

WriteLiteral(">\r\n                                    <pre><code>");

                                          Write(item.Content);

WriteLiteral("</code></pre>\r\n                                </div>\r\n                          " +
"  </li>\r\n");

                        }

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

                }

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

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

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

               Write(Html.TranslateWithPath("count", localizationPath));

WriteLiteral("</h2>\r\n                <ul>\r\n");

                    
                     foreach (int numberOfItems in Model.NumberOfItems)
                    {

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

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

WriteLiteral(" data-dojo-type=\"dijit/form/RadioButton\"");

WriteAttribute("name", Tuple.Create(" name=\"", 4903), Tuple.Create("\"", 4953)
                  , Tuple.Create(Tuple.Create("", 4910), Tuple.Create<System.Object, System.Int32>(Html.NameFor(m => m.SelectedNumberOfItems)
, 4910), false)
);

WriteAttribute("value", Tuple.Create(" value=\"", 4954), Tuple.Create("\"", 4976)
                                                                      , Tuple.Create(Tuple.Create("", 4962), Tuple.Create<System.Object, System.Int32>(numberOfItems
, 4962), false)
);

WriteAttribute("checked", Tuple.Create(" checked=\"", 4977), Tuple.Create("\"", 5046)
                                                                                                , Tuple.Create(Tuple.Create("", 4987), Tuple.Create<System.Object, System.Int32>(numberOfItems == Model.SelectedNumberOfItems ? "" : null
, 4987), false)
);

WriteLiteral(" /> ");

                                                                                                                                                                                                                                          Write(numberOfItems);

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

                    }

WriteLiteral("                </ul>\r\n                <p>\r\n                    <button");

WriteLiteral(" data-dojo-type=\"dijit/form/Button\"");

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

WriteLiteral(" class=\"epi-primary _jsAccordion\"");

WriteLiteral(">");

                                                                                                         Write(Html.TranslateWithPath("execute", localizationPath));

WriteLiteral("</button>\r\n                </p>\r\n\r\n                <h2>");

               Write(Html.TranslateWithPath("types", localizationPath));

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

                
                 foreach (var group in Model.TypeCounts)
                {
                    if (Model.TypeCounts.Count > 1)
                    {

WriteLiteral("                        <h3>");

                       Write(group.Key);

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

                    }

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

                        
                         foreach (var type in group.Value.OrderBy(t => t.Name))
                        {

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

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

WriteLiteral(" data-dojo-type=\"dijit/form/RadioButton\"");

WriteAttribute("name", Tuple.Create(" name=\"", 6004), Tuple.Create("\"", 6045)
                      , Tuple.Create(Tuple.Create("", 6011), Tuple.Create<System.Object, System.Int32>(Html.NameFor(m => m.SelectedType)
, 6011), false)
);

WriteAttribute("value", Tuple.Create(" value=\"", 6046), Tuple.Create("\"", 6064)
                                                                 , Tuple.Create(Tuple.Create("", 6054), Tuple.Create<System.Object, System.Int32>(type.Type
, 6054), false)
);

WriteAttribute("checked", Tuple.Create(" checked=\"", 6065), Tuple.Create("\"", 6121)
                                                                                       , Tuple.Create(Tuple.Create("", 6075), Tuple.Create<System.Object, System.Int32>(Model.SelectedType == type.Type ? "" : null
, 6075), false)
);

WriteLiteral(" /> ");

                                                                                                                                                                                                                    Write(type.Name);

WriteLiteral(" (");

                                                                                                                                                                                                                                Write(type.Count);

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

                        }

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

                }

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

WriteLiteral(" data-dojo-type=\"dijit/form/Button\"");

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

WriteLiteral(" class=\"epi-primary _jsAccordion\"");

WriteLiteral(">");

                                                                                                         Write(Html.TranslateWithPath("execute", localizationPath));

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

    }

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

        }
    }
}
#pragma warning restore 1591
