#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 EPiServer;
    using EPiServer.Core;
    using EPiServer.Editor;
    using EPiServer.Framework.Localization;
    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/AutoSuggest/Index.cshtml")]
    public partial class _Views_ElasticSearchAdmin_AutoSuggest_Index_cshtml : System.Web.Mvc.WebViewPage<AutoSuggestViewModel>
    {
        public _Views_ElasticSearchAdmin_AutoSuggest_Index_cshtml()
        {
        }
        public override void Execute()
        {
WriteLiteral("\r\n");

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

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

 if (Model == null)
{
    return;
}

WriteLiteral("\r\n");

DefineSection("Styles", () => {

WriteLiteral("\r\n    <style>\r\n        #tabContainer .field-actions {\r\n            width: 120px;\r" +
"\n            text-align: center;\r\n        }\r\n    </style>\r\n");

});

WriteLiteral("\r\n");

  
    string localizationPath = "/epinovaelasticsearch/autosuggest/";

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

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

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

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

WriteLiteral(" doLayout=\"false\"");

WriteLiteral(">\r\n");

        
         foreach (LanguageAutoSuggestWords lang in Model.WordsByLanguage)
        {

WriteLiteral("            <div");

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

WriteAttribute("title", Tuple.Create(" title=\"", 850), Tuple.Create("\"", 876)
, Tuple.Create(Tuple.Create("", 858), Tuple.Create<System.Object, System.Int32>(lang.LanguageName
, 858), false)
);

WriteLiteral(" data-dojo-props=\"");

                                                                                                   Write(lang.LanguageId == Model.CurrentLanguage ? "selected:true" : null);

WriteLiteral("\"");

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

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

WriteLiteral(">\r\n");

                    
                     using (Html.BeginForm("AddWord", "ElasticAutoSuggest"))
                    {

WriteLiteral("                        <input");

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

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

WriteAttribute("value", Tuple.Create(" value=\"", 1179), Tuple.Create("\"", 1203)
, Tuple.Create(Tuple.Create("", 1187), Tuple.Create<System.Object, System.Int32>(lang.LanguageId
, 1187), false)
);

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



WriteLiteral("                        <h2>");

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

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

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

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

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

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

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

WriteLiteral("\',required:true\"");

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

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

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

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

WriteLiteral(">");

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

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



WriteLiteral("                        <h2>");

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

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

WriteLiteral("                        <div");

WriteAttribute("id", Tuple.Create(" id=\"", 1846), Tuple.Create("\"", 1879)
, Tuple.Create(Tuple.Create("", 1851), Tuple.Create<System.Object, System.Int32>(lang.LanguageId
, 1851), false)
, Tuple.Create(Tuple.Create("", 1869), Tuple.Create("-wordsGrid", 1869), true)
);

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

                    }

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

        }

WriteLiteral("    </div>\r\n</div>\r\n\r\n\r\n<script>\r\n    require(\r\n        [\"dojo/_base/declare\", \"d" +
"grid/Grid\", \"dijit/form/Button\", \"dojo/domReady!\"],\r\n        function (declare, " +
"Grid, Button) {\r\n");

            
             foreach (LanguageAutoSuggestWords lang in Model.WordsByLanguage)
            {

WriteLiteral("                ");

WriteLiteral(@"
                new Grid({
                        ""class"": ""epi-grid-height--300 epi-grid--with-border"",
                        columns: {
                            word: ""Word"",
                            actions: {
                                label: """",
                                renderCell: function (object, value, node) {
                                    new Button({
                                            label: """);

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

WriteLiteral("\",\r\n                                            iconClass: \"dijitIcon epi-iconTra" +
"sh\",\r\n                                            onClick: function() {\r\n       " +
"                                         if (confirm(\"");

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

WriteLiteral("\")) {\r\n                                                    window.location = \"");

                                                                  Write(Url.Action("DeleteWord", "ElasticAutoSuggest"));

WriteLiteral(@"?languageId="" + object.lang + ""&word="" + object.word;
                                                }
                                            }
                                        })
                                        .placeAt(node)
                                        .startup();
                                }

                            }
                        }
                    }, """);

                    Write(lang.LanguageId);

WriteLiteral("-wordsGrid\")\r\n                    .renderArray([\r\n");

                        
                         foreach (string word in lang.Words)
                        {

WriteLiteral("                            ");

WriteLiteral("\r\n                                {\r\n                                    word: \"");

                                      Write(Html.Raw(word));

WriteLiteral("\",\r\n                                    lang: \"");

                                      Write(lang.LanguageId);

WriteLiteral("\",\r\n                                    actions: \"\"\r\n                            " +
"    }\r\n                            ");

WriteLiteral("\r\n");

                            
                        Write(word != lang.Words.Last() ? "," : null);

                                                                     
                        }

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

WriteLiteral("\r\n");

            }

WriteLiteral("        }\r\n    );\r\n</script>");

        }
    }
}
#pragma warning restore 1591
