mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +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.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -151,7 +150,8 @@ namespace Orchard.Packaging.Controllers {
|
||||
source,
|
||||
packages => {
|
||||
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) {
|
||||
case PackagingExtensionsOrder.Downloads:
|
||||
@@ -170,14 +170,14 @@ namespace Orchard.Packaging.Controllers {
|
||||
}
|
||||
|
||||
return packages;
|
||||
}
|
||||
).ToArray();
|
||||
}).ToArray();
|
||||
|
||||
// count packages separately to prevent loading everything just to count
|
||||
totalCount += _packagingSourceManager.GetExtensionCount(
|
||||
source,
|
||||
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);
|
||||
|
@@ -14,11 +14,11 @@
|
||||
Layout.Title = T("Modules").ToString();
|
||||
}
|
||||
|
||||
@using ( Html.BeginFormAntiForgeryPost(Url.Action("Modules", "Gallery")) ) {
|
||||
@using (Html.BeginFormAntiForgeryPost(Url.Action("Modules", "Gallery")) ) {
|
||||
<fieldset class="bulk-actions">
|
||||
<label for="filterResults" class="bulk-filter">@T("Feed:")</label>
|
||||
<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) {
|
||||
@Html.SelectOption(source.Id, Model.SelectedSource != null && Model.SelectedSource.Id == source.Id, source.FeedTitle)
|
||||
}
|
||||
@@ -36,7 +36,7 @@
|
||||
<label for="pageSize">@T("Show:")</label>
|
||||
<select id="pageSize" name="PageSize">
|
||||
@Html.SelectOption((int)Model.Pager.PageSize, 0, T("All").ToString())
|
||||
@foreach(int size in pageSizes.OrderBy(p => p)) {
|
||||
@foreach (int size in pageSizes.OrderBy(p => p)) {
|
||||
@Html.SelectOption((int)Model.Pager.PageSize, size, size.ToString())
|
||||
}
|
||||
</select>
|
||||
@@ -44,7 +44,7 @@
|
||||
</fieldset>
|
||||
|
||||
<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>
|
||||
</fieldset>
|
||||
@@ -54,10 +54,10 @@
|
||||
@foreach (var item in Model.Extensions) {
|
||||
<li>
|
||||
@{
|
||||
string iconUrl = @item.IconUrl;
|
||||
if (string.IsNullOrWhiteSpace(iconUrl)) {
|
||||
iconUrl = Href("../../Content/Images/ModuleDefaultIcon.png");
|
||||
}
|
||||
string iconUrl = @item.IconUrl;
|
||||
if (string.IsNullOrWhiteSpace(iconUrl)) {
|
||||
iconUrl = Href("../../Content/Images/ModuleDefaultIcon.png");
|
||||
}
|
||||
}
|
||||
|
||||
<div class="iconThumbnail">
|
||||
@@ -80,7 +80,7 @@
|
||||
<div class="properties">
|
||||
<p>@(item.Description == null ? T("(No description").Text : item.Description)</p>
|
||||
<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("Downloads: {0}", item.DownloadCount)</li>
|
||||
<li> | @T("Website: ")
|
||||
|
@@ -54,15 +54,15 @@
|
||||
@foreach (var item in Model.Extensions) {
|
||||
<li>
|
||||
@{
|
||||
string extensionClass = "iconThumbnail";
|
||||
string iconUrl = @item.IconUrl;
|
||||
if (!string.IsNullOrWhiteSpace(@item.FirstScreenshot)) {
|
||||
iconUrl = @item.FirstScreenshot;
|
||||
extensionClass = "screenshotThumbnail";
|
||||
} else if (string.IsNullOrWhiteSpace(iconUrl)) {
|
||||
iconUrl = Href("../../Content/Images/imagePlaceholder.png");
|
||||
extensionClass = "screenshotThumbnail";
|
||||
}
|
||||
string extensionClass = "iconThumbnail";
|
||||
string iconUrl = @item.IconUrl;
|
||||
if (!string.IsNullOrWhiteSpace(@item.FirstScreenshot)) {
|
||||
iconUrl = @item.FirstScreenshot;
|
||||
extensionClass = "screenshotThumbnail";
|
||||
} else if (string.IsNullOrWhiteSpace(iconUrl)) {
|
||||
iconUrl = Href("../../Content/Images/imagePlaceholder.png");
|
||||
extensionClass = "screenshotThumbnail";
|
||||
}
|
||||
}
|
||||
|
||||
<div class="@extensionClass">
|
||||
@@ -85,7 +85,7 @@
|
||||
<div class="properties">
|
||||
<p>@(item.Description == null ? T("(No description").Text : item.Description)</p>
|
||||
<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("Downloads: {0}", item.DownloadCount)</li>
|
||||
<li> | @T("Website: ")
|
||||
@@ -108,4 +108,6 @@
|
||||
</li>}
|
||||
</ul>
|
||||
}
|
||||
|
||||
@Display(Model.Pager)
|
||||
}
|
Reference in New Issue
Block a user