mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Adding an Information notification for pending comments
--HG-- branch : dev
This commit is contained in:
parent
1dfdeb8d80
commit
9c86a8d552
@ -12,11 +12,13 @@ using Orchard.UI.Notify;
|
||||
|
||||
namespace Orchard.Comments.Controllers {
|
||||
public class CommentController : Controller {
|
||||
public IOrchardServices Services { get; set; }
|
||||
private readonly IAuthorizer _authorizer;
|
||||
private readonly ICommentService _commentService;
|
||||
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;
|
||||
_notifier = notifier;
|
||||
_authorizer = authorizer;
|
||||
@ -53,6 +55,9 @@ namespace Orchard.Comments.Controllers {
|
||||
Comment comment = _commentService.CreateComment(context);
|
||||
|
||||
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 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.BlogPost.Summary.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\Layout.ascx" />
|
||||
<Content Include="Themes\Green\Views\ListOfComments.ascx" />
|
||||
|
Loading…
Reference in New Issue
Block a user