diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj b/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj index 4719651ca..81ccc3d54 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj @@ -93,6 +93,9 @@ + + + DataServiceClientGenerator diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingEntry.cs b/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingEntry.cs index ce78e22f0..18507b102 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingEntry.cs +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingEntry.cs @@ -12,5 +12,9 @@ namespace Orchard.Packaging.Services { public DateTime LastUpdated { get; set; } public string Authors { get; set; } public string Description { get; set; } + public string FirstScreenshot { get; set; } + public string IconUrl { get; set; } + public double Rating { get; set; } + public int RatingsCount { get; set; } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingSourceManager.cs b/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingSourceManager.cs index 47a981aed..892c1b5db 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingSourceManager.cs +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingSourceManager.cs @@ -63,19 +63,25 @@ namespace Orchard.Packaging.Services { } private static PackagingEntry CreatePackageEntry(PublishedPackage package, PackagingSource source, Uri downloadUri) { + PublishedScreenshot firstScreenshot = package.Screenshots.FirstOrDefault(); + return new PackagingEntry { - Title = String.IsNullOrWhiteSpace(package.Title) ? package.Id : package.Title, + Title = string.IsNullOrWhiteSpace(package.Title) ? package.Id : package.Title, PackageId = package.Id, PackageStreamUri = downloadUri.ToString(), ProjectUrl = package.ProjectUrl, Source = source, - Version = package.Version ?? String.Empty, + Version = package.Version ?? string.Empty, Description = package.Description, Authors = package.Authors, - LastUpdated = package.LastUpdated + LastUpdated = package.LastUpdated, + IconUrl = package.IconUrl, + FirstScreenshot = firstScreenshot != null ? firstScreenshot.ScreenshotUri : string.Empty, + Rating = package.Rating, + RatingsCount = package.RatingsCount }; } - #endregion + #endregion } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Styles/orchard-packaging-admin.css b/src/Orchard.Web/Modules/Orchard.Packaging/Styles/orchard-packaging-admin.css index e442a1aa6..6101abb10 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Styles/orchard-packaging-admin.css +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Styles/orchard-packaging-admin.css @@ -2,13 +2,21 @@ float:left; } .contentItems .related { - padding:1.2em 0.4em 0.5em + padding: 1.2em 0.4em 0.5em } .contentItems .properties { - float:none; - clear:both; + float:left; } .contentItems .pageStatus { margin:.8em 0; color:#666; +} +.thumbnail { + float: left; + padding: 1.2em 1.2em 0.5em 0em; + width: 10%; +} +.extensionDetails { + float: left; + width: 85%; } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/Modules.cshtml b/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/Modules.cshtml index bdb2ce7ad..0b7a99566 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/Modules.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/Modules.cshtml @@ -22,26 +22,38 @@
    @foreach (var item in Model.Extensions) {
  • -
    -

    @item.Title - @T("Version: {0}", item.Version)

    + @{ + string iconUrl = @item.IconUrl; + if (string.IsNullOrWhiteSpace(iconUrl)) { + iconUrl = Href("../../Content/Images/ModuleDefaultIcon.png"); + } + } + + +
    +
    +

    @item.Title - @T("Version: {0}", item.Version)

    +
    + + + +
    +

    @(item.Description == null ? T("(No description").Text : item.Description)

    +
      +
    • @T("Last Updated: {0}", DateTime.Now.ToLocalTime())
    • +
    •  | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())
    • +
    •  | @T("Rating: {0}", item.Rating)
    • +
    •  | @T("Ratings Count: {0}", item.RatingsCount)
    • +
    •  | @T("Website: ") + @if(!string.IsNullOrEmpty(item.ProjectUrl)) { @item.ProjectUrl } + else { @T("Unknown").ToString() } +
    • +
    +
    - - - -
    -

    @(item.Description == null ? T("(No description").Text : item.Description)

    -
      -
    • @T("Last Updated: {0}", DateTime.Now.ToLocalTime())
    • -
    •  | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())
    • -
    •  | @T("Website: ") - @if(!string.IsNullOrEmpty(item.ProjectUrl)) { @item.ProjectUrl } - else { @T("Unknown").ToString() } -
    • -
    -
  • }
} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/Themes.cshtml b/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/Themes.cshtml index 0ff88c9bc..a29171c47 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/Themes.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/Themes.cshtml @@ -22,26 +22,41 @@
    @foreach (var item in Model.Extensions) {
  • -
    -

    @item.Title - @T("Version: {0}", item.Version)

    + @{ + string iconUrl = @item.IconUrl; + if (!string.IsNullOrWhiteSpace(@item.FirstScreenshot)) { + iconUrl = Href(@item.FirstScreenshot); + } + else if (string.IsNullOrWhiteSpace(iconUrl)) { + iconUrl = Href("../../Content/Images/imagePlaceholder.png"); + } + } + + +
    +
    +

    @item.Title - @T("Version: {0}", item.Version)

    +
    + + + +
    +

    @(item.Description == null ? T("(No description").Text : item.Description)

    +
      +
    • @T("Last Updated: {0}", DateTime.Now.ToLocalTime())
    • +
    •  | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())
    • +
    •  | @T("Rating: {0}", item.Rating)
    • +
    •  | @T("Ratings Count: {0}", item.RatingsCount)
    • +
    •  | @T("Website: ") + @if(!string.IsNullOrEmpty(item.ProjectUrl)) { @item.ProjectUrl } + else { @T("Unknown").ToString() } +
    • +
    +
    - - - -
    -

    @(item.Description == null ? T("(No description").Text : item.Description)

    -
      -
    • @T("Last Updated: {0}", DateTime.Now.ToLocalTime())
    • -
    •  | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())
    • -
    •  | @T("Website: ") - @if(!string.IsNullOrEmpty(item.ProjectUrl)) { @item.ProjectUrl } - else { @T("Unknown").ToString() } -
    • -
    -
  • }
} \ No newline at end of file