<%@ Page Title="Billet" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master"%> <% Title = Model.Title+ " - " + ViewData ["BlogTitle"] ; %>

<% if (ViewData["Avatar"]!=null) { %> " alt="" id="logo"/> <% } %> <%= Html.ActionLink(Model.Title,"UserPost", new{user=Model.UserName, title = Model.Title}, null) %> - <%= Html.ActionLink((string)ViewData ["BlogTitle"] ,"UserPosts",new{user=Model.UserName}, null) %> - "><%= YavscHelpers.SiteName %>

<% foreach (var be in Model) { %>
<%= Html.Markdown(be.Content) %>
<% if (Membership.GetUser()!=null) { if (Membership.GetUser().UserName==be.UserName) { %>
<%= Html.ActionLink("Editer","Edit", new { id = be.Id }, new { @class="actionlink" }) %> <%= Html.ActionLink("Supprimer","RemovePost", new { id = be.Id }, new { @class="actionlink" } ) %>
<% } %> <% string username = Membership.GetUser().UserName; %> <% foreach (var c in (Comment[]) BlogManager.GetComments(be.Id)) { %>
<%=c.From%> <%= Html.Markdown(c.CommentText) %> <% if ( username == Model.UserName || c.From == username ) { %> <%= Html.ActionLink("Supprimer","RemoveComment", new { cmtid = c.Id } , new { @class="actionlink" })%> <% } %>
<% } %>
<% using (Html.BeginForm("Comment","Blogs")) { %> <%=Html.Hidden("UserName")%> <%=Html.Hidden("Title")%> <%=Html.TextArea("CommentText","")%> <%=Html.Hidden("PostId",be.Id)%> <% } %>
<% } %><% } %>