From fa162c7ac889abaa98416c95303853827f866c87 Mon Sep 17 00:00:00 2001 From: andrerod Date: Mon, 10 Jan 2011 23:18:04 -0800 Subject: [PATCH] #17171: Adding gallery link to module/theme details page. --HG-- branch : 1.x --- .../GalleryServer/Reference.cs | 181 ++++++++++-------- .../GalleryServer/Reference.datasvcmap | 6 +- .../GalleryServer/service.edmx | 17 +- .../Services/PackagingEntry.cs | 1 + .../Services/PackagingSourceManager.cs | 1 + .../Views/Gallery/Modules.cshtml | 27 ++- .../Views/Gallery/Themes.cshtml | 8 +- 7 files changed, 148 insertions(+), 93 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Service References/GalleryServer/Reference.cs b/src/Orchard.Web/Modules/Orchard.Packaging/Service References/GalleryServer/Reference.cs index 62b1dacb5..289dfe858 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Service References/GalleryServer/Reference.cs +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Service References/GalleryServer/Reference.cs @@ -9,7 +9,7 @@ //------------------------------------------------------------------------------ // Original file name: -// Generation date: 12/16/2010 1:21:46 AM +// Generation date: 1/10/2011 10:36:55 PM namespace Orchard.Packaging.GalleryServer { @@ -128,17 +128,17 @@ namespace Orchard.Packaging.GalleryServer /// Initial value of Price. /// Initial value of RequireLicenseAcceptance. /// Initial value of IsLatestVersion. - /// Initial value of Rating. - /// Initial value of RatingsCount. - /// Initial value of DownloadCount. /// Initial value of VersionRating. /// Initial value of VersionRatingsCount. /// Initial value of VersionDownloadCount. /// Initial value of Created. /// Initial value of LastUpdated. /// Initial value of Published. + /// Initial value of Rating. + /// Initial value of RatingsCount. + /// Initial value of DownloadCount. [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] - public static PublishedPackage CreatePublishedPackage(string ID, string version, long packageSize, decimal price, bool requireLicenseAcceptance, bool isLatestVersion, double rating, int ratingsCount, int downloadCount, double versionRating, int versionRatingsCount, int versionDownloadCount, global::System.DateTime created, global::System.DateTime lastUpdated, global::System.DateTime published) + public static PublishedPackage CreatePublishedPackage(string ID, string version, long packageSize, decimal price, bool requireLicenseAcceptance, bool isLatestVersion, double versionRating, int versionRatingsCount, int versionDownloadCount, global::System.DateTime created, global::System.DateTime lastUpdated, global::System.DateTime published, double rating, int ratingsCount, int downloadCount) { PublishedPackage publishedPackage = new PublishedPackage(); publishedPackage.Id = ID; @@ -147,15 +147,15 @@ namespace Orchard.Packaging.GalleryServer publishedPackage.Price = price; publishedPackage.RequireLicenseAcceptance = requireLicenseAcceptance; publishedPackage.IsLatestVersion = isLatestVersion; - publishedPackage.Rating = rating; - publishedPackage.RatingsCount = ratingsCount; - publishedPackage.DownloadCount = downloadCount; publishedPackage.VersionRating = versionRating; publishedPackage.VersionRatingsCount = versionRatingsCount; publishedPackage.VersionDownloadCount = versionDownloadCount; publishedPackage.Created = created; publishedPackage.LastUpdated = lastUpdated; publishedPackage.Published = published; + publishedPackage.Rating = rating; + publishedPackage.RatingsCount = ratingsCount; + publishedPackage.DownloadCount = downloadCount; return publishedPackage; } /// @@ -453,69 +453,6 @@ namespace Orchard.Packaging.GalleryServer partial void OnIsLatestVersionChanging(bool value); partial void OnIsLatestVersionChanged(); /// - /// There are no comments for Property Rating in the schema. - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] - public double Rating - { - get - { - return this._Rating; - } - set - { - this.OnRatingChanging(value); - this._Rating = value; - this.OnRatingChanged(); - } - } - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] - private double _Rating; - partial void OnRatingChanging(double value); - partial void OnRatingChanged(); - /// - /// There are no comments for Property RatingsCount in the schema. - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] - public int RatingsCount - { - get - { - return this._RatingsCount; - } - set - { - this.OnRatingsCountChanging(value); - this._RatingsCount = value; - this.OnRatingsCountChanged(); - } - } - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] - private int _RatingsCount; - partial void OnRatingsCountChanging(int value); - partial void OnRatingsCountChanged(); - /// - /// There are no comments for Property DownloadCount in the schema. - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] - public int DownloadCount - { - get - { - return this._DownloadCount; - } - set - { - this.OnDownloadCountChanging(value); - this._DownloadCount = value; - this.OnDownloadCountChanged(); - } - } - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] - private int _DownloadCount; - partial void OnDownloadCountChanging(int value); - partial void OnDownloadCountChanged(); - /// /// There are no comments for Property VersionRating in the schema. /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] @@ -726,26 +663,68 @@ namespace Orchard.Packaging.GalleryServer partial void OnIconUrlChanging(string value); partial void OnIconUrlChanged(); /// - /// There are no comments for Property ReportAbuseUrl in the schema. + /// There are no comments for Property Rating in the schema. /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] - public string ReportAbuseUrl + public double Rating { get { - return this._ReportAbuseUrl; + return this._Rating; } set { - this.OnReportAbuseUrlChanging(value); - this._ReportAbuseUrl = value; - this.OnReportAbuseUrlChanged(); + this.OnRatingChanging(value); + this._Rating = value; + this.OnRatingChanged(); } } [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] - private string _ReportAbuseUrl; - partial void OnReportAbuseUrlChanging(string value); - partial void OnReportAbuseUrlChanged(); + private double _Rating; + partial void OnRatingChanging(double value); + partial void OnRatingChanged(); + /// + /// There are no comments for Property RatingsCount in the schema. + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] + public int RatingsCount + { + get + { + return this._RatingsCount; + } + set + { + this.OnRatingsCountChanging(value); + this._RatingsCount = value; + this.OnRatingsCountChanged(); + } + } + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] + private int _RatingsCount; + partial void OnRatingsCountChanging(int value); + partial void OnRatingsCountChanged(); + /// + /// There are no comments for Property DownloadCount in the schema. + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] + public int DownloadCount + { + get + { + return this._DownloadCount; + } + set + { + this.OnDownloadCountChanging(value); + this._DownloadCount = value; + this.OnDownloadCountChanged(); + } + } + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] + private int _DownloadCount; + partial void OnDownloadCountChanging(int value); + partial void OnDownloadCountChanged(); /// /// There are no comments for Property Categories in the schema. /// @@ -810,6 +789,48 @@ namespace Orchard.Packaging.GalleryServer partial void OnDependenciesChanging(string value); partial void OnDependenciesChanged(); /// + /// There are no comments for Property ReportAbuseUrl in the schema. + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] + public string ReportAbuseUrl + { + get + { + return this._ReportAbuseUrl; + } + set + { + this.OnReportAbuseUrlChanging(value); + this._ReportAbuseUrl = value; + this.OnReportAbuseUrlChanged(); + } + } + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] + private string _ReportAbuseUrl; + partial void OnReportAbuseUrlChanging(string value); + partial void OnReportAbuseUrlChanged(); + /// + /// There are no comments for Property GalleryDetailsUrl in the schema. + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] + public string GalleryDetailsUrl + { + get + { + return this._GalleryDetailsUrl; + } + set + { + this.OnGalleryDetailsUrlChanging(value); + this._GalleryDetailsUrl = value; + this.OnGalleryDetailsUrlChanged(); + } + } + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] + private string _GalleryDetailsUrl; + partial void OnGalleryDetailsUrlChanging(string value); + partial void OnGalleryDetailsUrlChanged(); + /// /// There are no comments for Screenshots in the schema. /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Service References/GalleryServer/Reference.datasvcmap b/src/Orchard.Web/Modules/Orchard.Packaging/Service References/GalleryServer/Reference.datasvcmap index ff392bc1a..209a9fb02 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Service References/GalleryServer/Reference.datasvcmap +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Service References/GalleryServer/Reference.datasvcmap @@ -1,10 +1,10 @@ - + - + - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Service References/GalleryServer/service.edmx b/src/Orchard.Web/Modules/Orchard.Packaging/Service References/GalleryServer/service.edmx index a85ff98d0..12fc9745d 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Service References/GalleryServer/service.edmx +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Service References/GalleryServer/service.edmx @@ -8,10 +8,10 @@ - - + + - + @@ -20,24 +20,25 @@ - - - - + - + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingEntry.cs b/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingEntry.cs index 18507b102..3db78265e 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingEntry.cs +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingEntry.cs @@ -9,6 +9,7 @@ namespace Orchard.Packaging.Services { public string Version { get; set; } public string PackageStreamUri { get; set; } public string ProjectUrl { get; set; } + public string GalleryDetailsUrl { get; set; } public DateTime LastUpdated { get; set; } public string Authors { get; set; } public string Description { get; set; } diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingSourceManager.cs b/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingSourceManager.cs index 30a071b93..740be42d5 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingSourceManager.cs +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackagingSourceManager.cs @@ -83,6 +83,7 @@ namespace Orchard.Packaging.Services { PackageId = package.Id, PackageStreamUri = downloadUri.ToString(), ProjectUrl = package.ProjectUrl, + GalleryDetailsUrl = package.GalleryDetailsUrl, Source = source, Version = package.Version ?? string.Empty, Description = package.Description, 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 bde5072f9..612f24f1e 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/Modules.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/Modules.cshtml @@ -31,7 +31,32 @@
-

@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() }
+
+ @if (!string.IsNullOrWhiteSpace(item.GalleryDetailsUrl)) { + +

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

+
+ } else { +

@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() } +
  • +
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 adb408d63..a17e04a7b 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/Themes.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/Themes.cshtml @@ -38,7 +38,13 @@
-

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

+ @if (!string.IsNullOrWhiteSpace(item.GalleryDetailsUrl)) { + +

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

+
+ } else { +

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

+ }