Factoring, Refactoring

* App.master:
* yavscModel.csproj:
* UserPost.aspx:
* UserPosts.aspx:
* StatusChange.cs:
* IContentProvider.cs:
* NpgsqlContentProvider.cs: 

* BlogsController.cs: unwanted message "Blogs"

* style.css: More visibility for messages and error
vnext
Paul Schneider 10 years ago
parent 1307b62ecb
commit 71f1cfcf20
9 changed files with 49 additions and 29 deletions

@ -47,11 +47,7 @@ namespace WorkFlowProvider
throw new NotImplementedException ();
}
public bool[] FinalStatuses {
get {
return new bool[] { false, true, true };
}
}
public string Order (IWFOrder c)
{
@ -70,7 +66,12 @@ namespace WorkFlowProvider
public string[] StatusLabels {
get {
return new string[] { "Created", "Success", "Error" };
return new string[] { "Created", "Validated", "Success", "Error" };
}
}
public bool[] FinalStatuses {
get {
return new bool[] { false, false, true, true };
}
}

@ -43,7 +43,6 @@ namespace Yavsc.Controllers
public ActionResult Index (string user = null, string title = null, int pageIndex=0, int pageSize=10)
{
if (string.IsNullOrEmpty (user)) {
ViewData ["Message"] = "Blogs";
return BlogList (pageIndex, pageSize);
} else {
MembershipUser u = Membership.GetUser (user, false);

@ -49,12 +49,12 @@
<% if (ViewData["Error"]!=null) { %>
<div class="Error">
<div class="error">
<%= Html.Encode(ViewData["Error"]) %>
</div>
<% } %>
<% if (ViewData["Message"]!=null) { %>
<div class="Message">
<div class="message">
<%= Html.Encode(ViewData["Message"]) %>
</div>
<% } %>

@ -4,20 +4,12 @@
</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}) %> -
<a href="/Blog/<%=Model.UserName%>"><img class="avatar" src="/Blogs/Avatar?user=<%=Model.UserName%>" alt=""/> <%=ViewData["BlogTitle"]%></a>
<a href="/Blog/<%=Model.UserName%>">
<img class="avatar" src="/Blogs/Avatar?user=<%=Model.UserName%>" alt="<%=Model.UserName%>"/> <%=ViewData["BlogTitle"]%></a>
<asp:Literal runat="server" Text=" - " />
<a href="/"> <%= YavscHelpers.SiteName %> </a> </h1>
<div class="metablog">(Id:<a href="/Blogs/UserPost/<%=Model.Id%>"><i><%=Model.Id%></i></a>, <%= Model.Posted.ToString("yyyy/MM/dd") %>
- <%= Model.Modified.ToString("yyyy/MM/dd") %> <%= Model.Visible? "":", Invisible!" %>)
<% if (Membership.GetUser()!=null)
if (Membership.GetUser().UserName==Model.UserName)
{ %>
<%= Html.ActionLink("Editer","Edit", new { user=Model.UserName, title = Model.Title }, new { @class="actionlink" }) %>
<%= Html.ActionLink("Supprimer","RemovePost", new { user=Model.UserName, title = Model.Title }, new { @class="actionlink" } ) %>
<% } %>
</div>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<div>
<div class="blogpost">

@ -1,13 +1,14 @@
<%@ Page 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" %>
<asp:Content ContentPlaceHolderID="titleContent" ID="titleContent" runat="server"><%=Html.Encode(ViewData["BlogTitle"])%></asp:Content>
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
<h1><a href="/Blog/<%=ViewData["BlogUser"]%>">
<img class="avatar" src="/Blogs/Avatar?user=<%=ViewData["BlogUser"]%>" alt=""/>
<%=ViewData["BlogTitle"]%></a></h1>
<div class="message"><%= Html.Encode(ViewData["Message"])%></div>
<asp:Content ContentPlaceHolderID="init" ID="init1" runat="server">
<% Title = (string) ViewData["BlogTitle"] ; %>
</asp:Content>
<asp:Content ContentPlaceHolderID="overHeaderOne" ID="header1" runat="server">
<h1 class="blogtitle"><a href="/Blog/<%=ViewData["BlogUser"]%>">
<img class="avatar" src="/Blogs/Avatar?user=<%=ViewData["BlogUser"]%>" alt="ViewData["BlogUser"]"/>
<%=ViewData["BlogTitle"]%></a> - <a href="/"> <%= YavscHelpers.SiteName %> </a> </h1>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<%
foreach (BlogEntry e in this.Model) { %>

@ -56,6 +56,22 @@ label {
font-size: medium;
}
.message {
color: #7FFF00;
font-size: large;
border: solid green;
background-color: rgba(32,0,32,0.3);
}
.error {
color: #f88;
font-size: large;
border: solid green;
background-color: rgba(64,0,0,0.3);
}
.validation-summary-errors{
color: #f88;
background-color: rgba(64,0,0,0.3);
}
.thanks {
display: inline;

@ -4,7 +4,6 @@ using System.Web.Mvc;
namespace yavscModel.WorkFlow
{
public interface StatusChange { int Status {get;} DateTime date {get;} }
public interface IContentProvider : IProvider, IDisposable
{

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Web.Mvc;
namespace yavscModel.WorkFlow
{
public class StatusChange {
public int Status { get; set;}
public DateTime date { get; set;}
}
}

@ -63,6 +63,7 @@
<Compile Include="Blogs\BlogEntryCollection.cs" />
<Compile Include="Blogs\Comment.cs" />
<Compile Include="Blogs\FindBlogEntryFlags.cs" />
<Compile Include="WorkFlow\StatusChange.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

Loading…