Click here to Skip to main content
15,896,359 members
Articles / Web Development / HTML

sBlog.Net - A Minimalistic Blog Engine - Using ASP.NET MVC 3

Rate me:
Please Sign up or sign in to vote.
4.94/5 (55 votes)
16 Aug 2013CPOL51 min read 198.2K   6.4K   182  
sBlog.Net is a minimalistic blog engine created using the ASP.NET MVC 3 framework.
@model sBlog.Net.Domain.Entities.PostEntity

<script type="text/javascript" language="javascript">
    $(function () {
        var pageUrl = document.location.href;
        if (pageUrl.indexOf('comment-posted') >= 0) {
            var commentsTop = $('#user-comments').offset().top;
            $("html, body").animate({ scrollTop: commentsTop }, 1000);
        }
    });
</script>

<div id="user-comments">
    <br />
    <b>comments</b>
    <br /><br />

    @if (Model.UserCanAddComments && Model.Comments.Count == 0)
    {
        <span>there are no comments for this post. be the first to post one!</span>
    }
    
    <br />
    @foreach (var comment in Model.Comments)
    {
        var site = comment.CommenterSite.GetValidUrl();
       <div class="comment">
	        @if (comment.CommentStatus == 1)
            {
                <div style="float: right; color: #5858FA; font-size: x-small"><i title="your comment is awaiting moderator action. if the content of the message is not acceptable as per this blog's standards, it might be deleted.">comment awaiting moderation</i></div>
            }
            @comment.CommentContent
            <br /><br />
	        posted by <a href="@site" target="_blank"><b>@comment.CommentUserFullName</b></a> at <i title="@comment.CommentPostedDate.ToLongDateString()">@comment.CommentPostedDate.ToString()</i><br/><br/>
        </div>
        <br />
    }
    
    @if (!Model.UserCanAddComments)
    {
       <span>administrator or the author has disabled comments for this post</span>
    }
</div>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
Just another passionate software developer!

Some of the contributions to the open source world - a blog engine written in MVC 4 - sBlog.Net. Check it out here. For the codeproject article regarding sBlog.Net click here!

(Figuring out this section!)

Comments and Discussions