public CommentFormDisplay(User user, Comment comment, PostDisplay post) { Post = post; User = user; Body = comment.Body; UserSubscribed = comment.UserSubscribed; }
public static string PublishedPost(this IUrlResolver resolver, PostDisplay post) { // TODO: _resolver.UrlFor<BlogController>() + "/" + ...; return ("~/blog/" + post.Published.Year + "/" + post.Published.Month + "/" + post.Published.Day + "/" + post.Slug).ToFullUrl(); }
public static string GetCommentsText(this IAltOxitePage viewPage, PostDisplay post) { var commentCount = (post.Comments == null) ? 0 : post.Comments.Count(); return "<a href=\"{0}#comments\">{1}</a>" .ToFormat( viewPage.UrlTo().PublishedPost(post), (commentCount == 1) ? "{0} comment".ToFormat(commentCount) : "{0} comments".ToFormat(commentCount)); }