mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-26 12:03:16 +08:00
#17444: Notification message for module or theme update should include a direct link to the Updates tab
--HG-- branch : 1.x
This commit is contained in:
@@ -235,7 +235,7 @@ namespace Orchard.Packaging.Controllers {
|
||||
packagings.Item2.Installed = true;
|
||||
|
||||
if (_extensionDisplayEventHandler != null) {
|
||||
foreach (string notification in _extensionDisplayEventHandler.Displaying(packagings.Item1)) {
|
||||
foreach (string notification in _extensionDisplayEventHandler.Displaying(packagings.Item1, ControllerContext.RequestContext)) {
|
||||
packagings.Item2.Notifications.Add(notification);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.DisplayManagement;
|
||||
@@ -11,7 +10,6 @@ using Orchard.Logging;
|
||||
using Orchard.Packaging.Models;
|
||||
using Orchard.Packaging.Services;
|
||||
using Orchard.Packaging.ViewModels;
|
||||
using Orchard.Reports;
|
||||
using Orchard.Reports.Services;
|
||||
using Orchard.Security;
|
||||
using Orchard.Themes;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Localization;
|
||||
@@ -26,7 +29,7 @@ namespace Orchard.Packaging.Events {
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public IEnumerable<string> Displaying(ExtensionDescriptor extensionDescriptor) {
|
||||
public IEnumerable<string> Displaying(ExtensionDescriptor extensionDescriptor, RequestContext requestContext) {
|
||||
// Get status from background task state or directly
|
||||
_backgroundPackageUpdateStatus.Value =
|
||||
_backgroundPackageUpdateStatus.Value ??
|
||||
@@ -37,7 +40,12 @@ namespace Orchard.Packaging.Events {
|
||||
|
||||
if (updatePackageEntry != null) {
|
||||
if (updatePackageEntry.NewVersionToInstall != null) {
|
||||
yield return T("Version {0} is available.", updatePackageEntry.NewVersionToInstall.Version).ToString();
|
||||
UrlHelper urlHelper = new UrlHelper(requestContext);
|
||||
yield return T("Version {0} is available (See <a href=\"{1}\">Updates</a>).", updatePackageEntry.NewVersionToInstall.Version,
|
||||
urlHelper.Action(DefaultExtensionTypes.IsTheme(updatePackageEntry.ExtensionsDescriptor.ExtensionType)
|
||||
? "ThemesUpdates"
|
||||
: "ModulesUpdates",
|
||||
"GalleryUpdates")).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Routing;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Events;
|
||||
|
||||
@@ -7,6 +8,6 @@ namespace Orchard.Packaging.Events {
|
||||
/// <summary>
|
||||
/// Called before an extension is displayed
|
||||
/// </summary>
|
||||
IEnumerable<string> Displaying(ExtensionDescriptor extensionDescriptor);
|
||||
IEnumerable<string> Displaying(ExtensionDescriptor extensionDescriptor, RequestContext requestContext);
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@
|
||||
@if (item.Notifications != null && item.Notifications.Count > 0) {
|
||||
<div class="notifications">
|
||||
@foreach (string notification in item.Notifications) {
|
||||
<h5>@notification</h5>
|
||||
<h5>@Html.Raw(notification)</h5>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
@if (item.Notifications != null && item.Notifications.Count > 0) {
|
||||
<div class="notifications">
|
||||
@foreach (string notification in item.Notifications) {
|
||||
<h5>@notification</h5>
|
||||
<h5>@Html.Raw(notification)</h5>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user