* BlogsController.cs: sets ViewData["Avatar"]
* UserPost.aspx: magnify the header * UserPosts.aspx: beautyfull header * Profile.cs: A default Blog title to "<Username>'s blog"
This commit is contained in:
parent
1b7b3595e2
commit
495f859243
4 changed files with 27 additions and 13 deletions
|
|
@ -95,6 +95,9 @@ namespace Yavsc.Controllers
|
||||||
ViewData ["PageIndex"] = pageIndex;
|
ViewData ["PageIndex"] = pageIndex;
|
||||||
return View ("Index", bs);
|
return View ("Index", bs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Users the posts.
|
/// Users the posts.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -117,6 +120,7 @@ namespace Yavsc.Controllers
|
||||||
Profile bupr = AccountController.GetProfile (user);
|
Profile bupr = AccountController.GetProfile (user);
|
||||||
ViewData ["BlogUserProfile"] = bupr;
|
ViewData ["BlogUserProfile"] = bupr;
|
||||||
ViewData ["BlogTitle"] = bupr.BlogTitle;
|
ViewData ["BlogTitle"] = bupr.BlogTitle;
|
||||||
|
ViewData ["Avatar"] = bupr.avatar;
|
||||||
ViewData ["PageIndex"] = pageIndex;
|
ViewData ["PageIndex"] = pageIndex;
|
||||||
ViewData ["PageSize"] = pageSize;
|
ViewData ["PageSize"] = pageSize;
|
||||||
ViewData ["RecordCount"] = tr;
|
ViewData ["RecordCount"] = tr;
|
||||||
|
|
@ -138,7 +142,6 @@ namespace Yavsc.Controllers
|
||||||
private ActionResult UserPost (long id)
|
private ActionResult UserPost (long id)
|
||||||
{
|
{
|
||||||
ViewData ["PostId"] = id;
|
ViewData ["PostId"] = id;
|
||||||
|
|
||||||
BlogEntry e = BlogManager.GetPost (id);
|
BlogEntry e = BlogManager.GetPost (id);
|
||||||
return UserPost (e);
|
return UserPost (e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,15 @@
|
||||||
<% Title = Model.Title+" - "+((string) ((Profile)ViewData["BlogUserProfile"]).BlogTitle) ; %>
|
<% Title = Model.Title+" - "+((string) ((Profile)ViewData["BlogUserProfile"]).BlogTitle) ; %>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ContentPlaceHolderID="overHeaderOne" ID="header1" runat="server">
|
<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%>">
|
<a href="/Blog/<%=Model.UserName%>">
|
||||||
<% if ((bool)ViewData["HasAvatar"]) { %>
|
<% if ((bool)ViewData["HasAvatar"]) { %>
|
||||||
<img class="avatar" src="/Blogs/Avatar?user=<%=Model.UserName%>" alt="<%=Model.UserName%>"/> <%=ViewData["BlogTitle"]%></a>
|
<img class="avatar" src="<%=ViewData["Avatar"]%>" alt=""/>
|
||||||
<% } else { %>
|
|
||||||
<a href="/Blog/<%=Model.UserName%>">
|
|
||||||
<%=Html.Encode(ViewData["BlogTitle"])%>
|
|
||||||
</a>
|
|
||||||
<% } %>
|
<% } %>
|
||||||
|
<%=Html.Encode(ViewData["BlogTitle"])%>
|
||||||
|
</a> -
|
||||||
|
<a href="<%=Request.Url.Scheme + "://" + Request.Url.Authority%>"><%= YavscHelpers.SiteName %></a>
|
||||||
</h1>
|
</h1>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,23 @@
|
||||||
<%@ Page Title="Billets utilisateurs" Language="C#" Inherits="System.Web.Mvc.ViewPage<BlogEntryCollection>" MasterPageFile="~/Models/App.master"%>
|
<%@ 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" %>
|
<%@ Register Assembly="Yavsc.WebControls" TagPrefix="yavsc" Namespace="Yavsc.WebControls" %>
|
||||||
<asp:Content ContentPlaceHolderID="init" ID="init1" runat="server">
|
<asp:Content ContentPlaceHolderID="init" ID="init1" runat="server">
|
||||||
<% Title = ((string) ((Profile)ViewData["BlogUserProfile"]).BlogTitle) ; %>
|
<% Title = (string) ViewData ["BlogTitle"]; %>
|
||||||
</asp:Content>
|
</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">
|
<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;" <% } %>>
|
<div <% if (!e.Visible) { %> style="background-color:#022;" <% } %>>
|
||||||
|
|
||||||
<h2 class="blogtitle" ><%= Html.ActionLink(e.Title,"UserPost", new { user=e.UserName, title = e.Title }) %></h2>
|
<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")]
|
[DisplayName ("Blog visible")]
|
||||||
public bool BlogVisible { get; set; }
|
public bool BlogVisible { get; set; }
|
||||||
|
|
||||||
|
private string blogTitle;
|
||||||
[DisplayName ("Titre du blog")]
|
[DisplayName ("Titre du blog")]
|
||||||
[StringLength (255)]
|
[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")]
|
[DisplayName ("Téléphone fixe")]
|
||||||
[StringLength (15)]
|
[StringLength (15)]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue