private ActionResult ReturnView(CommentsViewInfo info) { if (info.Disabled) return new EmptyResult(); ViewData = info.ViewData; return PartialView(info.View, info.Model); }
public CommentsViewInfo GetShowCommentsInfo(Webpage webpage) { if (!webpage.AreCommentsEnabled(_getWebpageCommentingInfo.Get(webpage), _settings)) { return new CommentsViewInfo { Disabled = true }; } var showCommentsInfo = new CommentsViewInfo { View = "Show", Model = _session.QueryOver<Comment>() .Where( comment => comment.Webpage == webpage && comment.Approved == true && comment.InReplyTo == null) //.Take(_settings.InitialNumberOfCommentsToShow) .List(), }; showCommentsInfo.ViewData["allow-reply"] = _settings.AllowGuestComments || CurrentRequestData.CurrentUser != null; showCommentsInfo.ViewData["webpage"] = webpage; return showCommentsInfo; }