Adding link to Gallery in "Modules" and "Themes" pages

--HG--
branch : 1.x
This commit is contained in:
Renaud Paquay
2011-01-11 19:01:46 -08:00
parent 29cefd8a13
commit de42a2d4a9
6 changed files with 19 additions and 5 deletions

View File

@@ -52,7 +52,8 @@ namespace Orchard.Modules.Controllers {
return View(new ModulesIndexViewModel { return View(new ModulesIndexViewModel {
Modules = modules, Modules = modules,
InstallModules = _featureManager.GetEnabledFeatures().FirstOrDefault(f => f.Id == "PackagingServices") != null InstallModules = _featureManager.GetEnabledFeatures().FirstOrDefault(f => f.Id == "PackagingServices") != null,
BrowseToGallery = _featureManager.GetEnabledFeatures().FirstOrDefault(f => f.Id == "Gallery") != null
}); });
} }

View File

@@ -1,9 +1,11 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using Orchard.Environment.Extensions.Models; using Orchard.Environment.Extensions.Models;
namespace Orchard.Modules.ViewModels { namespace Orchard.Modules.ViewModels {
public class ModulesIndexViewModel { public class ModulesIndexViewModel {
public bool InstallModules { get; set; } public bool InstallModules { get; set; }
public bool BrowseToGallery { get; set; }
public IEnumerable<ExtensionDescriptor> Modules { get; set; } public IEnumerable<ExtensionDescriptor> Modules { get; set; }
} }
} }

View File

@@ -9,6 +9,10 @@
<h1>@Html.TitleForPage(T("Installed Modules").ToString())</h1> <h1>@Html.TitleForPage(T("Installed Modules").ToString())</h1>
@if (Model.BrowseToGallery) {
<div class="manage">@Html.ActionLink(T("Install a module from the Gallery").ToString(), "Modules", "Gallery", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl }, new { @class = "button primaryAction" })</div>
}
@if (Model.InstallModules) { @if (Model.InstallModules) {
<div class="manage">@Html.ActionLink(T("Install a module").ToString(), "AddModule", "PackagingServices", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl }, new { @class = "button primaryAction" })</div> <div class="manage">@Html.ActionLink(T("Install a module").ToString(), "AddModule", "PackagingServices", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl }, new { @class = "button primaryAction" })</div>
} }

View File

@@ -71,7 +71,8 @@ namespace Orchard.Themes.Controllers {
return View(new ThemesIndexViewModel { return View(new ThemesIndexViewModel {
CurrentTheme = currentTheme, Themes = themes, CurrentTheme = currentTheme, Themes = themes,
InstallThemes = _featureManager.GetEnabledFeatures().FirstOrDefault(f => f.Id == "PackagingServices") != null InstallThemes = _featureManager.GetEnabledFeatures().FirstOrDefault(f => f.Id == "PackagingServices") != null,
BrowseToGallery = _featureManager.GetEnabledFeatures().FirstOrDefault(f => f.Id == "Gallery") != null
}); });
} }
catch (Exception exception) { catch (Exception exception) {

View File

@@ -1,9 +1,11 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using Orchard.Environment.Extensions.Models; using Orchard.Environment.Extensions.Models;
namespace Orchard.Themes.ViewModels { namespace Orchard.Themes.ViewModels {
public class ThemesIndexViewModel { public class ThemesIndexViewModel {
public bool InstallThemes { get; set; } public bool InstallThemes { get; set; }
public bool BrowseToGallery { get; set; }
public ExtensionDescriptor CurrentTheme { get; set; } public ExtensionDescriptor CurrentTheme { get; set; }
public IEnumerable<ThemeEntry> Themes { get; set; } public IEnumerable<ThemeEntry> Themes { get; set; }
} }

View File

@@ -19,7 +19,11 @@
</p> </p>
if (Model.InstallThemes) { if (Model.InstallThemes) {
@Html.ActionLink(T("Install a new Theme").ToString(), "AddTheme", "PackagingServices", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl }, new { @class = "button primaryAction" }) <p>@Html.ActionLink(T("Install a theme").ToString(), "AddTheme", "PackagingServices", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl }, new { @class = "button primaryAction" })</p>
}
if (Model.BrowseToGallery) {
<p>@Html.ActionLink(T("Install a theme from the Gallery").ToString(), "Themes", "Gallery", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl }, new { @class = "button primaryAction" })</p>
} }
} }