mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Adding an Information notification for pending comments
--HG-- branch : dev
This commit is contained in:
@@ -12,11 +12,13 @@ using Orchard.UI.Notify;
|
|||||||
|
|
||||||
namespace Orchard.Comments.Controllers {
|
namespace Orchard.Comments.Controllers {
|
||||||
public class CommentController : Controller {
|
public class CommentController : Controller {
|
||||||
|
public IOrchardServices Services { get; set; }
|
||||||
private readonly IAuthorizer _authorizer;
|
private readonly IAuthorizer _authorizer;
|
||||||
private readonly ICommentService _commentService;
|
private readonly ICommentService _commentService;
|
||||||
private readonly INotifier _notifier;
|
private readonly INotifier _notifier;
|
||||||
|
|
||||||
public CommentController(ICommentService commentService, INotifier notifier, IAuthorizer authorizer) {
|
public CommentController(IOrchardServices services, ICommentService commentService, INotifier notifier, IAuthorizer authorizer) {
|
||||||
|
Services = services;
|
||||||
_commentService = commentService;
|
_commentService = commentService;
|
||||||
_notifier = notifier;
|
_notifier = notifier;
|
||||||
_authorizer = authorizer;
|
_authorizer = authorizer;
|
||||||
@@ -53,6 +55,9 @@ namespace Orchard.Comments.Controllers {
|
|||||||
Comment comment = _commentService.CreateComment(context);
|
Comment comment = _commentService.CreateComment(context);
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(returnUrl)) {
|
if (!String.IsNullOrEmpty(returnUrl)) {
|
||||||
|
if (comment.Record.Status == CommentStatus.Pending)
|
||||||
|
Services.Notifier.Information(T("Your comment will appear after the site administrator approves it."));
|
||||||
|
|
||||||
return Redirect(returnUrl);
|
return Redirect(returnUrl);
|
||||||
}
|
}
|
||||||
return RedirectToAction("Index");
|
return RedirectToAction("Index");
|
||||||
|
|||||||
@@ -196,7 +196,6 @@
|
|||||||
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
|
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
|
||||||
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.BlogPost.Summary.ascx" />
|
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.BlogPost.Summary.ascx" />
|
||||||
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Pages.Page.ascx" />
|
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Pages.Page.ascx" />
|
||||||
<Content Include="Themes\Green\Views\DisplayTemplates\Parts\Comments.HasComments.ascx" />
|
|
||||||
<Content Include="Themes\Green\Views\Footer.ascx" />
|
<Content Include="Themes\Green\Views\Footer.ascx" />
|
||||||
<Content Include="Themes\Green\Views\Layout.ascx" />
|
<Content Include="Themes\Green\Views\Layout.ascx" />
|
||||||
<Content Include="Themes\Green\Views\ListOfComments.ascx" />
|
<Content Include="Themes\Green\Views\ListOfComments.ascx" />
|
||||||
|
|||||||
Reference in New Issue
Block a user