mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
A bit of an improvement in paging
- generic collection and display but only used for search results at the moment and does nothing for other queries. in other words, build your own IPageOfItems --HG-- branch : dev
This commit is contained in:
@@ -4,14 +4,14 @@ Html.RegisterStyle("search.css"); %>
|
||||
<h1><%=Html.TitleForPage(T("Search").Text)%></h1><%
|
||||
Html.Zone("search");
|
||||
if (!string.IsNullOrWhiteSpace(Model.Query)) {
|
||||
if (Model.Count == 0) { %>
|
||||
if (Model.PageOfResults.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><%
|
||||
<p class="search-summary"><%=T("<em>{0} - {1}</em> of <em>{2}</em> results", Model.PageOfResults.StartPosition, Model.PageOfResults.EndPosition, Model.PageOfResults.TotalItemCount)%></p><%
|
||||
}
|
||||
}
|
||||
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}) %><%
|
||||
if (Model.PageOfResults != null && Model.PageOfResults.Count() > 0) { %>
|
||||
<%=Html.UnorderedList(Model.PageOfResults, (r, i) => Html.DisplayForItem(r.Content).ToHtmlString() , "search-results contentItems") %>
|
||||
<%=Html.Pager(Model.PageOfResults, Model.PageOfResults.PageNumber, Model.DefaultPageSize, new {q = Model.Query}) %><%
|
||||
} %>
|
Reference in New Issue
Block a user