<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> <% Html.RegisterStyle("admin.css"); %>

<%:Html.TitleForPage(T("Search Index Management").ToString()) %>

<% using (Html.BeginForm("update", "admin", FormMethod.Post, new {area = "Orchard.Indexing"})) { %>
<% if (Model.IndexEntry == null) {%>

<%:T("There is currently no search index")%>

<% } else if (Model.IndexEntry.LastUpdateUtc == null) { %>

<%:T("The search index has not been built yet.")%>

<% } else { %> <% if (Model.IndexEntry.DocumentCount == 0) { %>

<%:T("The search index does not contain any document.")%>

<% } else { %>

<%:T("The search index contains {0} document(s).", Model.IndexEntry.DocumentCount)%>

<% } %> <% if (!Model.IndexEntry.Fields.Any()) { %>

<%:T("The search index does not contain any field.")%>

<% } else { %>

<%:T("The search index contains the following fields: {0}.", string.Join(T(", ").Text, Model.IndexEntry.Fields))%>

<% } %>

<%:T("The search index was last updated {0}.", Html.DateTimeRelative(Model.IndexEntry.LastUpdateUtc.Value, T))%>

<% } %>

<%:T("Update the search index now: ") %>

<%:Html.AntiForgeryTokenOrchard() %>
<% } using (Html.BeginForm("rebuild", "admin", FormMethod.Post, new {area = "Orchard.Search"})) { %>

<%:T("Rebuild the search index for a fresh start.") %>

<%:Html.AntiForgeryTokenOrchard() %>
<% } %>