mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Pulling search result page selection back into the service and cleaning up a few other bits
--HG-- branch : dev
This commit is contained in:
@@ -3,13 +3,15 @@
|
||||
Html.RegisterStyle("search.css"); %>
|
||||
<h1><%=Html.TitleForPage(T("Search").Text)%></h1><%
|
||||
Html.Zone("search");
|
||||
if (Model.Count == 0) { %>
|
||||
<p class="search-summary"><%=T("<em>zero</em> results")%></p><%
|
||||
if (!string.IsNullOrWhiteSpace(Model.Query)) {
|
||||
if (Model.Count == 0) { %>
|
||||
<p class="search-summary"><%=T("<em>zero</em> results") %></p><%
|
||||
}
|
||||
else { %>
|
||||
<p class="search-summary"><%=T("<em>{0} - {1}</em> of <em>{2}</em> results", (Model.Page - 1) * Model.PageSize + 1, Model.Page * Model.PageSize > Model.Count ? Model.Count : Model.Page * Model.PageSize, Model.Count)%></p><%
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(Model.Query)) { %>
|
||||
<p class="search-summary"><%=T("<em>{0} - {1}</em> of <em>{2}</em> results", (Model.Page - 1) * Model.PageSize + 1, Model.Page * Model.PageSize > Model.Count ? Model.Count : Model.Page * Model.PageSize, Model.Count)%></p><%
|
||||
}
|
||||
if (Model.ResultsPage.Count() > 0) { %>
|
||||
if (Model.ResultsPage != null && Model.ResultsPage.Count() > 0) { %>
|
||||
<%=Html.UnorderedList(Model.ResultsPage, (r, i) => Html.DisplayForItem(r.Content).ToHtmlString(), "search-results contentItems") %>
|
||||
<%=Html.Pager(Model.TotalPageCount, Model.Page, new {q = Model.Query}, "<", ">", false) %><%
|
||||
<%=Html.Pager(Model.TotalPageCount, Model.Page, new {q = Model.Query}) %><%
|
||||
} %>
|
Reference in New Issue
Block a user