mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Correcting last updated, adding paging footer, and searching packages by title instead of id.
--HG-- branch : dev
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -151,7 +150,8 @@ namespace Orchard.Packaging.Controllers {
|
|||||||
source,
|
source,
|
||||||
packages => {
|
packages => {
|
||||||
packages = packages.Where(p => p.PackageType == packageType &&
|
packages = packages.Where(p => p.PackageType == packageType &&
|
||||||
(string.IsNullOrEmpty(options.SearchText) || p.Id.Contains(options.SearchText)));
|
p.IsLatestVersion &&
|
||||||
|
(string.IsNullOrEmpty(options.SearchText) || p.Title.Contains(options.SearchText)));
|
||||||
|
|
||||||
switch (options.Order) {
|
switch (options.Order) {
|
||||||
case PackagingExtensionsOrder.Downloads:
|
case PackagingExtensionsOrder.Downloads:
|
||||||
@@ -170,14 +170,14 @@ namespace Orchard.Packaging.Controllers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return packages;
|
return packages;
|
||||||
}
|
}).ToArray();
|
||||||
).ToArray();
|
|
||||||
|
|
||||||
// count packages separately to prevent loading everything just to count
|
// count packages separately to prevent loading everything just to count
|
||||||
totalCount += _packagingSourceManager.GetExtensionCount(
|
totalCount += _packagingSourceManager.GetExtensionCount(
|
||||||
source,
|
source,
|
||||||
packages => packages.Where(p => p.PackageType == packageType &&
|
packages => packages.Where(p => p.PackageType == packageType &&
|
||||||
(string.IsNullOrEmpty(options.SearchText) || p.Id.Contains(options.SearchText)))
|
p.IsLatestVersion &&
|
||||||
|
(string.IsNullOrEmpty(options.SearchText) || p.Title.Contains(options.SearchText)))
|
||||||
);
|
);
|
||||||
|
|
||||||
extensions = extensions == null ? sourceExtensions : extensions.Concat(sourceExtensions);
|
extensions = extensions == null ? sourceExtensions : extensions.Concat(sourceExtensions);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<fieldset class="bulk-actions">
|
<fieldset class="bulk-actions">
|
||||||
<label for="filterResults" class="bulk-filter">@T("Feed:")</label>
|
<label for="filterResults" class="bulk-filter">@T("Feed:")</label>
|
||||||
<select id="sourceId" name="sourceId">
|
<select id="sourceId" name="sourceId">
|
||||||
@Html.SelectOption("", Model.SelectedSource == null, T("Any (show all feeds)").ToString())
|
@Html.SelectOption("", Model.SelectedSource == null, T("All feeds").ToString())
|
||||||
@foreach (var source in Model.Sources) {
|
@foreach (var source in Model.Sources) {
|
||||||
@Html.SelectOption(source.Id, Model.SelectedSource != null && Model.SelectedSource.Id == source.Id, source.FeedTitle)
|
@Html.SelectOption(source.Id, Model.SelectedSource != null && Model.SelectedSource.Id == source.Id, source.FeedTitle)
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset class="search-actions">
|
<fieldset class="search-actions">
|
||||||
<input type="text" id="searchText" name="@Html.NameOf(m => m.Options.SearchText)" />
|
<input type="text" id="searchText" name="@Html.NameOf(m => m.Options.SearchText)" value="@Model.Options.SearchText" />
|
||||||
|
|
||||||
<button type="submit">@T("Search")</button>
|
<button type="submit">@T("Search")</button>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
<div class="properties">
|
<div class="properties">
|
||||||
<p>@(item.Description == null ? T("(No description").Text : item.Description)</p>
|
<p>@(item.Description == null ? T("(No description").Text : item.Description)</p>
|
||||||
<ul class="pageStatus">
|
<ul class="pageStatus">
|
||||||
<li>@T("Last Updated: {0}", DateTime.Now.ToLocalTime())</li>
|
<li>@T("Last Updated: {0}", item.LastUpdated)</li>
|
||||||
<li> | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())</li>
|
<li> | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())</li>
|
||||||
<li> | @T("Downloads: {0}", item.DownloadCount)</li>
|
<li> | @T("Downloads: {0}", item.DownloadCount)</li>
|
||||||
<li> | @T("Website: ")
|
<li> | @T("Website: ")
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
<div class="properties">
|
<div class="properties">
|
||||||
<p>@(item.Description == null ? T("(No description").Text : item.Description)</p>
|
<p>@(item.Description == null ? T("(No description").Text : item.Description)</p>
|
||||||
<ul class="pageStatus">
|
<ul class="pageStatus">
|
||||||
<li>@T("Last Updated: {0}", DateTime.Now.ToLocalTime())</li>
|
<li>@T("Last Updated: {0}", item.LastUpdated)</li>
|
||||||
<li> | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())</li>
|
<li> | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())</li>
|
||||||
<li> | @T("Downloads: {0}", item.DownloadCount)</li>
|
<li> | @T("Downloads: {0}", item.DownloadCount)</li>
|
||||||
<li> | @T("Website: ")
|
<li> | @T("Website: ")
|
||||||
@@ -108,4 +108,6 @@
|
|||||||
</li>}
|
</li>}
|
||||||
</ul>
|
</ul>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Display(Model.Pager)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user