From 39bb7a335722dd6072456f0a4188ace593a9e387 Mon Sep 17 00:00:00 2001 From: Andre Rodrigues Date: Fri, 25 Feb 2011 14:34:19 -0800 Subject: [PATCH] Avoiding details page if there are no features to enable. --HG-- branch : dev --- .../Controllers/GalleryController.cs | 12 ++++++++---- .../Views/Gallery/InstallModule.cshtml | 2 -- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Controllers/GalleryController.cs b/src/Orchard.Web/Modules/Orchard.Packaging/Controllers/GalleryController.cs index 0b0355b68..b59c29aec 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Controllers/GalleryController.cs +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Controllers/GalleryController.cs @@ -256,10 +256,14 @@ namespace Orchard.Packaging.Controllers { FeatureDescriptor = featureDescriptor }).ToList(); - return View("InstallModule", new PackagingInstallViewModel { - Features = features, - ExtensionDescriptor = extensionDescriptor - }); + if (features.Count > 0) { + return View("InstallModule", new PackagingInstallViewModel { + Features = features, + ExtensionDescriptor = extensionDescriptor + }); + } + + return InstallPOST(packageId, version, sourceId, redirectTo); } [HttpPost, ActionName("InstallModule")] diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/InstallModule.cshtml b/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/InstallModule.cshtml index b9afb09db..f99b88c62 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/InstallModule.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Views/Gallery/InstallModule.cshtml @@ -12,7 +12,6 @@ @using (Html.BeginFormAntiForgeryPost(Url.Action("InstallModule", "Gallery", new { packageId = Request.QueryString["packageId"], version = Request.QueryString["version"], sourceId = Request.QueryString["sourceId"], redirectTo = Request.QueryString["redirectTo"] }))) {

@T("Pick the features you want enabled during install").ToString()

- if (Model.Features.Count > 0) {
@{ var index = 0; } @foreach (PackagingInstallFeatureViewModel feature in Model.Features) { @@ -27,7 +26,6 @@ }
- } } \ No newline at end of file