Adding an Information notification for pending comments

--HG--
branch : dev
This commit is contained in:
Nathan Heskew 2010-02-26 16:03:50 -08:00
parent 1dfdeb8d80
commit 9c86a8d552
2 changed files with 6 additions and 2 deletions

View File

@ -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");

View File

@ -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" />