* BlogsController.cs: sets ViewData["Avatar"]

* UserPost.aspx: magnify the header

* UserPosts.aspx: beautyfull header

* Profile.cs: A default Blog title to "<Username>'s blog"
vnext
Paul Schneider 10 years ago
parent 1b7b3595e2
commit 495f859243
4 changed files with 27 additions and 13 deletions

@ -95,6 +95,9 @@ namespace Yavsc.Controllers
ViewData ["PageIndex"] = pageIndex;
return View ("Index", bs);
}
/// <summary>
/// Users the posts.
/// </summary>
@ -117,6 +120,7 @@ namespace Yavsc.Controllers
Profile bupr = AccountController.GetProfile (user);
ViewData ["BlogUserProfile"] = bupr;
ViewData ["BlogTitle"] = bupr.BlogTitle;
ViewData ["Avatar"] = bupr.avatar;
ViewData ["PageIndex"] = pageIndex;
ViewData ["PageSize"] = pageSize;
ViewData ["RecordCount"] = tr;
@ -138,7 +142,6 @@ namespace Yavsc.Controllers
private ActionResult UserPost (long id)
{
ViewData ["PostId"] = id;
BlogEntry e = BlogManager.GetPost (id);
return UserPost (e);
}

@ -3,16 +3,15 @@
<% Title = Model.Title+" - "+((string) ((Profile)ViewData["BlogUserProfile"]).BlogTitle) ; %>
</asp:Content>
<asp:Content ContentPlaceHolderID="overHeaderOne" ID="header1" runat="server">
<h1 class="blogtitle"><%= Html.ActionLink(Model.Title,"UserPost",new{user=Model.UserName,title=Model.Title}) %> -
<h1 class="blogtitle">
<%= Html.ActionLink(Model.Title,"UserPost",new{user=Model.UserName,title=Model.Title}) %> -
<a href="/Blog/<%=Model.UserName%>">
<% if ((bool)ViewData["HasAvatar"]) { %>
<img class="avatar" src="/Blogs/Avatar?user=<%=Model.UserName%>" alt="<%=Model.UserName%>"/> <%=ViewData["BlogTitle"]%></a>
<% } else { %>
<a href="/Blog/<%=Model.UserName%>">
<%=Html.Encode(ViewData["BlogTitle"])%>
</a>
<img class="avatar" src="<%=ViewData["Avatar"]%>" alt=""/>
<% } %>
<%=Html.Encode(ViewData["BlogTitle"])%>
</a> -
<a href="<%=Request.Url.Scheme + "://" + Request.Url.Authority%>"><%= YavscHelpers.SiteName %></a>
</h1>
</asp:Content>

@ -1,12 +1,23 @@
<%@ Page Title="Billets utilisateurs" Language="C#" Inherits="System.Web.Mvc.ViewPage<BlogEntryCollection>" MasterPageFile="~/Models/App.master"%>
<%@ Register Assembly="Yavsc.WebControls" TagPrefix="yavsc" Namespace="Yavsc.WebControls" %>
<asp:Content ContentPlaceHolderID="init" ID="init1" runat="server">
<% Title = ((string) ((Profile)ViewData["BlogUserProfile"]).BlogTitle) ; %>
<% Title = (string) ViewData ["BlogTitle"]; %>
</asp:Content>
<asp:Content ContentPlaceHolderID="overHeaderOne" ID="header1" runat="server">
<h1 class="blogtitle">
<a href="/Blog/<%=ViewData["BlogUser"]%>">
<% if ((bool)ViewData["Avatar"]==null) { %>
<img class="avatar" src="<%=ViewData["Avatar"]%>" alt=""/>
<% } %>
<%=Html.Encode(ViewData["BlogTitle"])%></a>
-
<a href="<%=Request.Url.Scheme + "://" + Request.Url.Authority%>"><%= YavscHelpers.SiteName %></a>
</h1>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<%
foreach (BlogEntry e in this.Model) { %>
<% foreach (BlogEntry e in this.Model) { %>
<div <% if (!e.Visible) { %> style="background-color:#022;" <% } %>>
<h2 class="blogtitle" ><%= Html.ActionLink(e.Title,"UserPost", new { user=e.UserName, title = e.Title }) %></h2>

@ -39,9 +39,10 @@ namespace Yavsc.Model.RolesAndMembers
[DisplayName ("Blog visible")]
public bool BlogVisible { get; set; }
private string blogTitle;
[DisplayName ("Titre du blog")]
[StringLength (255)]
public string BlogTitle { get; set; }
public string BlogTitle { get { return blogTitle==null? Name+"'s blog":blogTitle; } set { blogTitle = value; } }
[DisplayName ("Téléphone fixe")]
[StringLength (15)]

Loading…