mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-21 11:17:28 +08:00
Theme and module install links from inline linke in installed page to an "Install" tab (LocalNav)
--HG-- branch : dev
This commit is contained in:
@@ -93,7 +93,6 @@ 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,
|
|
||||||
Options = options,
|
Options = options,
|
||||||
Pager = Shape.Pager(pager).TotalItemCount(totalItemCount)
|
Pager = Shape.Pager(pager).TotalItemCount(totalItemCount)
|
||||||
});
|
});
|
||||||
|
@@ -3,7 +3,6 @@ using Orchard.Modules.Models;
|
|||||||
|
|
||||||
namespace Orchard.Modules.ViewModels {
|
namespace Orchard.Modules.ViewModels {
|
||||||
public class ModulesIndexViewModel {
|
public class ModulesIndexViewModel {
|
||||||
public bool InstallModules { get; set; }
|
|
||||||
public IEnumerable<ModuleEntry> Modules { get; set; }
|
public IEnumerable<ModuleEntry> Modules { get; set; }
|
||||||
|
|
||||||
public ModulesIndexOptions Options { get; set; }
|
public ModulesIndexOptions Options { get; set; }
|
||||||
|
@@ -34,10 +34,6 @@
|
|||||||
<input type="text" id="searchText" name="@Html.NameOf(m => m.Options.SearchText)" value="@Model.Options.SearchText" />
|
<input type="text" id="searchText" name="@Html.NameOf(m => m.Options.SearchText)" value="@Model.Options.SearchText" />
|
||||||
|
|
||||||
<button type="submit">@T("Search").ToString()</button>
|
<button type="submit">@T("Search").ToString()</button>
|
||||||
|
|
||||||
@if (Model.InstallModules) {
|
|
||||||
@Html.ActionLink(T("Install a module").ToString(), "AddModule", "PackagingServices", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl }, new { @class = "button primaryAction" })
|
|
||||||
}
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
if (Model.Modules.Count() > 0) {
|
if (Model.Modules.Count() > 0) {
|
||||||
|
@@ -21,18 +21,26 @@ namespace Orchard.Packaging {
|
|||||||
public AdminMenu() {}
|
public AdminMenu() {}
|
||||||
|
|
||||||
public void GetNavigation(NavigationBuilder builder) {
|
public void GetNavigation(NavigationBuilder builder) {
|
||||||
builder.Add(T("Themes"), "25", menu => menu
|
builder.Add(T("Themes"), menu => menu
|
||||||
.Add(T("Available"), "1", item => item.Action("Themes", "Gallery", new { area = "Orchard.Packaging" })
|
.Add(T("Available"), "1", item => item.Action("Themes", "Gallery", new { area = "Orchard.Packaging" })
|
||||||
.Permission(StandardPermissions.SiteOwner).LocalNav()));
|
.Permission(StandardPermissions.SiteOwner).LocalNav()));
|
||||||
|
|
||||||
builder.Add(T("Modules"), "20", menu => menu
|
builder.Add(T("Modules"), menu => menu
|
||||||
.Add(T("Available"), "2", item => item.Action("Modules", "Gallery", new { area = "Orchard.Packaging" })
|
.Add(T("Available"), "2", item => item.Action("Modules", "Gallery", new { area = "Orchard.Packaging" })
|
||||||
.Permission(StandardPermissions.SiteOwner).LocalNav()));
|
.Permission(StandardPermissions.SiteOwner).LocalNav()));
|
||||||
|
|
||||||
builder.Add(T("Configuration"), "50", menu => menu
|
builder.Add(T("Settings"), menu => menu
|
||||||
.Add(T("Feeds"), "25", item => item.Action("Sources", "Gallery", new { area = "Orchard.Packaging" })
|
.Add(T("Gallery"), "1", item => item.Action("Sources", "Gallery", new { area = "Orchard.Packaging" })
|
||||||
.Permission(StandardPermissions.SiteOwner)));
|
.Permission(StandardPermissions.SiteOwner)));
|
||||||
|
|
||||||
|
builder.Add(T("Modules"), menu => menu
|
||||||
|
.Add(T("Install"), "99", item => item.Action("AddModule", "PackagingServices", new { area = "Orchard.Packaging" })
|
||||||
|
.Permission(StandardPermissions.SiteOwner).LocalNav()));
|
||||||
|
|
||||||
|
builder.Add(T("Themes"), menu => menu
|
||||||
|
.Add(T("Install"), "99", item => item.Action("AddTheme", "PackagingServices", new { area = "Orchard.Packaging" })
|
||||||
|
.Permission(StandardPermissions.SiteOwner).LocalNav()));
|
||||||
|
|
||||||
if (_backgroundPackageUpdateStatus != null) {
|
if (_backgroundPackageUpdateStatus != null) {
|
||||||
// Only available if feature is enabled
|
// Only available if feature is enabled
|
||||||
|
|
||||||
|
@@ -103,8 +103,7 @@ namespace Orchard.Themes.Controllers {
|
|||||||
|
|
||||||
return View(new ThemesIndexViewModel {
|
return View(new ThemesIndexViewModel {
|
||||||
CurrentTheme = currentTheme,
|
CurrentTheme = currentTheme,
|
||||||
Themes = themes,
|
Themes = themes
|
||||||
InstallThemes = installThemes
|
|
||||||
});
|
});
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
this.Error(exception, T("Listing themes failed: {0}", exception.Message), Logger, Services.Notifier);
|
this.Error(exception, T("Listing themes failed: {0}", exception.Message), Logger, Services.Notifier);
|
||||||
|
@@ -3,7 +3,6 @@ using Orchard.Themes.Models;
|
|||||||
|
|
||||||
namespace Orchard.Themes.ViewModels {
|
namespace Orchard.Themes.ViewModels {
|
||||||
public class ThemesIndexViewModel {
|
public class ThemesIndexViewModel {
|
||||||
public bool InstallThemes { get; set; }
|
|
||||||
public ThemeEntry CurrentTheme { get; set; }
|
public ThemeEntry CurrentTheme { get; set; }
|
||||||
public IEnumerable<ThemeEntry> Themes { get; set; }
|
public IEnumerable<ThemeEntry> Themes { get; set; }
|
||||||
}
|
}
|
||||||
|
@@ -20,10 +20,6 @@
|
|||||||
|
|
||||||
<div id="installedBar">
|
<div id="installedBar">
|
||||||
<h3>@T("Installed")</h3>
|
<h3>@T("Installed")</h3>
|
||||||
|
|
||||||
@if (Model.InstallThemes) {
|
|
||||||
<p>@Html.ActionLink(T("Install theme").ToString(), "AddTheme", "PackagingServices", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl }, new { @class = "primaryAction" })</p>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if (Model.Themes == null || Model.Themes.Count() <= 0) {
|
@if (Model.Themes == null || Model.Themes.Count() <= 0) {
|
||||||
|
Reference in New Issue
Block a user