<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Page.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="MVCBlogo.NET.BO" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderPage" runat="server">

    <div class="post">
       <h3><%= ViewData["Title"].ToString()%></h3>
    </div>
    <%
        List<BlogEntry> list = this.Model as List<BlogEntry>;
        foreach (var post in list)
        {
     %>
        <div class="post">
        <div class="header"> 
        <h3><%=Html.ActionLink(post.title,"BlogEntry",new{page=post.id}) %></h3>
        <div class="date"><%=post.datecreated %></div>
        </div>
        <div class="content">
         <%=post.body %>
         <p><strong><%=post.author.username %></strong></p>
        </div>
        <div class="footer">
            <ul>
             <li class="tags">分类：
                 <%foreach (var tag in post.tags)
                   {
                  %>
                     <%=Html.ActionLink(tag.tagname,"BlogEntry",new{id=post.id}) %>
                  <%
                   } %>
             </li>
             <li class="comments">
                  <%=(bool)post.allowcomments ?"<a href=\"BlogEntry.aspx?page="+post.id+"#comments\">评论("+post.comments.Count+")</a>":"-disabled-"%>
             </li>
            </ul>
        </div>
     <%
        } %>
     </div>
     <%=Html.ActionLink("《前一页","Index",new{page=(int)ViewData["page"]-1}) %>|
       <%=Html.ActionLink("后一页》","Index",new{page=(int)ViewData["page"]+1}) %> 
</asp:Content>
