mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
#17032: Fixing gallery download link. Moving Project URL to the Views as additional information.
--HG-- branch : dev
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Services.Client;
|
||||
using System.Linq;
|
||||
using System.Web.Hosting;
|
||||
using System.Web.Mvc;
|
||||
|
@@ -1,4 +1,3 @@
|
||||
|
||||
using System;
|
||||
using Orchard.Packaging.Models;
|
||||
|
||||
@@ -9,6 +8,7 @@ namespace Orchard.Packaging.Services {
|
||||
public string PackageId { get; set; }
|
||||
public string Version { get; set; }
|
||||
public string PackageStreamUri { get; set; }
|
||||
public string ProjectUrl { get; set; }
|
||||
public DateTime LastUpdated { get; set; }
|
||||
public string Authors { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
@@ -52,19 +52,22 @@ namespace Orchard.Packaging.Services {
|
||||
private IEnumerable<PackagingEntry> GetExtensionList(string filter = null, PackagingSource packagingSource = null) {
|
||||
return (packagingSource == null ? GetSources() : new[] {packagingSource})
|
||||
.SelectMany(
|
||||
source =>
|
||||
new GalleryFeedContext(new Uri(source.FeedUrl)).Packages
|
||||
.Where(p => p.PackageType == filter)
|
||||
.ToList()
|
||||
.Select(p => CreatePackageEntry(p, packagingSource))
|
||||
source => {
|
||||
GalleryFeedContext galleryFeedContext = new GalleryFeedContext(new Uri(source.FeedUrl));
|
||||
return galleryFeedContext.Packages
|
||||
.Where(p => p.PackageType == filter)
|
||||
.ToList()
|
||||
.Select(p => CreatePackageEntry(p, packagingSource, galleryFeedContext.GetReadStreamUri(p)));
|
||||
}
|
||||
).ToArray();
|
||||
}
|
||||
|
||||
private static PackagingEntry CreatePackageEntry(PublishedPackage package, PackagingSource source) {
|
||||
private static PackagingEntry CreatePackageEntry(PublishedPackage package, PackagingSource source, Uri downloadUri) {
|
||||
return new PackagingEntry {
|
||||
Title = String.IsNullOrWhiteSpace(package.Title) ? package.Id : package.Title,
|
||||
PackageId = package.Id,
|
||||
PackageStreamUri = package.ProjectUrl != null ? package.ProjectUrl.ToString() : String.Empty,
|
||||
PackageStreamUri = downloadUri.ToString(),
|
||||
ProjectUrl = package.ProjectUrl,
|
||||
Source = source,
|
||||
Version = package.Version ?? String.Empty,
|
||||
Description = package.Description,
|
||||
|
@@ -36,6 +36,7 @@
|
||||
<ul class="pageStatus">
|
||||
<li>@T("Last Updated: {0}", DateTime.Now.ToLocalTime())</li>
|
||||
<li> | @T("Author: {0}", item.Authors)</li>
|
||||
<li> | @T("Project Url: ")<a href="@item.ProjectUrl">@item.ProjectUrl</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>}
|
||||
|
@@ -36,6 +36,7 @@
|
||||
<ul class="pageStatus">
|
||||
<li>@T("Last Updated: {0}", DateTime.Now.ToLocalTime())</li>
|
||||
<li> | @T("Author: {0}", item.Authors)</li>
|
||||
<li> | @T("Project Url: ")<a href="@item.ProjectUrl">@item.ProjectUrl</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>}
|
||||
|
Reference in New Issue
Block a user