* AccountController.cs: Fixes the canonical login

* App.master: Cleans the code

* NoLogin.master: Fixes the canonical login (broken with last master
  changes)

* style.css: yet another footer style

* UserPost.aspx: puts links in a "aside" block
vnext
Paul Schneider 9 years ago
parent ccc3b2ffff
commit 9da7064791
6 changed files with 49 additions and 21 deletions

@ -1,3 +1,16 @@
2015-06-28 Paul Schneider <paul@pschneider.fr>
* AccountController.cs: Fixes the canonical login
* App.master: Cleans the code
* NoLogin.master: Fixes the canonical login (broken with last
master changes)
* style.css: yet another footer style
* UserPost.aspx: puts links in a "aside" block
2015-06-26 Paul Schneider <paul@pschneider.fr> 2015-06-26 Paul Schneider <paul@pschneider.fr>
* Web.csproj: * Web.csproj:

@ -51,6 +51,7 @@ namespace Yavsc.Controllers
/// <returns>The login.</returns> /// <returns>The login.</returns>
/// <param name="model">Model.</param> /// <param name="model">Model.</param>
/// <param name="returnUrl">Return URL.</param> /// <param name="returnUrl">Return URL.</param>
[HttpPost]
public ActionResult Login (LoginModel model, string returnUrl) public ActionResult Login (LoginModel model, string returnUrl)
{ {
if (ModelState.IsValid) { if (ModelState.IsValid) {
@ -64,13 +65,22 @@ namespace Yavsc.Controllers
ModelState.AddModelError ("UserName", "The user name or password provided is incorrect."); ModelState.AddModelError ("UserName", "The user name or password provided is incorrect.");
} }
} }
ViewData ["returnUrl"] = returnUrl; ViewData ["returnUrl"] = returnUrl;
// If we got this far, something failed, redisplay form
return View (model); return View (model);
} }
/// <summary>
/// Login the specified returnUrl.
/// </summary>
/// <param name="returnUrl">Return URL.</param>
[HttpGet]
public ActionResult Login (string returnUrl)
{
ViewData ["returnUrl"] = returnUrl;
return View ();
}
/// <summary> /// <summary>
/// Register the specified model and returnUrl. /// Register the specified model and returnUrl.
/// </summary> /// </summary>

@ -1,7 +1,8 @@
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %> <%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<asp:ContentPlaceHolder id="init" runat="server"></asp:ContentPlaceHolder><% <asp:ContentPlaceHolder id="init" runat="server">
</asp:ContentPlaceHolder><%
ViewState["orgtitle"] = T.GetString(Page.Title); ViewState["orgtitle"] = T.GetString(Page.Title);
Page.Title = ViewState["orgtitle"] + " - " + YavscHelpers.SiteName; Page.Title = ViewState["orgtitle"] + " - " + YavscHelpers.SiteName;
%><head runat="server"> %><head runat="server">
@ -57,7 +58,6 @@ ViewState["orgtitle"] = T.GetString(Page.Title);
<% } %> <% } %>
</div> </div>
</aside> </aside>
<div style="float:right; height:5em; z-index:-1;"></div>
<footer> <footer>
<script src="https://apis.google.com/js/platform.js" async defer> <script src="https://apis.google.com/js/platform.js" async defer>
{lang: 'fr'} {lang: 'fr'}
@ -83,3 +83,4 @@ $( ".bshd" ).on("click",function(e) {
</script> </script>
</body> </body>
</html> </html>

@ -11,7 +11,7 @@ ViewState["orgtitle"] = T.GetString(Page.Title);
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="/Theme/style.css" /> <link rel="stylesheet" href="/Theme/style.css" />
<link rel="icon" type="image/png" href="/favicon.png?v=2" /> <link rel="icon" type="image/png" href="/favicon.png?v=2" />
<script type="text/javascript" src="<%=Url.Content("~/Scripts/jquery-2.1.3.js")%>"></script> <script type="text/javascript" src="<%=Url.Content("~/Scripts/jquery-2.1.4.js")%>"></script>
<asp:ContentPlaceHolder id="head" runat="server"> <asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder> </asp:ContentPlaceHolder>
<link href='http://fonts.googleapis.com/css?family=Dancing+Script:400,700' rel='stylesheet' type='text/css'/> <link href='http://fonts.googleapis.com/css?family=Dancing+Script:400,700' rel='stylesheet' type='text/css'/>
@ -41,10 +41,11 @@ ViewState["orgtitle"] = T.GetString(Page.Title);
<script src="https://apis.google.com/js/platform.js" async defer> <script src="https://apis.google.com/js/platform.js" async defer>
{lang: 'fr'} {lang: 'fr'}
</script> </script>
<%= Html.ActionLink("Contact","Contact","Home",null, new { @class="footerlink" }) %> <br/> <%= Html.ActionLink("Contact","Contact","Home",null, new { @class="thanks" }) %>
<% foreach ( string link in Yavsc.ThanksHelper.Links()) { %> <% foreach ( Link link in Html.Thanks()) { %>
<%= link %> <a class="thanks" href="<%=link.Url%>"><% if (link.Image !=null) {
<% } %> %><img src="<%= link.Image %>" alt="<%= link.Text %>"/></a><%
} else { %><a class="thanks" href="<%=link.Url%>"><%= link.Text %></a><% }} %>
<div class="g-plusone" data-annotation="inline" data-width="230"></div> <div class="g-plusone" data-annotation="inline" data-width="230"></div>
</footer> </footer>
<script type="text/javascript"> <script type="text/javascript">

@ -48,10 +48,12 @@ footer {
} }
.thanks { .thanks {
max-width: 12%; max-width: 10%;
width: 100%;
text-align: center; text-align: center;
vertical-align: text-bottom;
font-size:smaller; font-size:smaller;
display:block;
bottom:0;
} }

@ -49,8 +49,9 @@
<% if (Membership.GetUser()!=null) <% if (Membership.GetUser()!=null)
if (Membership.GetUser().UserName==Model.UserName) if (Membership.GetUser().UserName==Model.UserName)
{ %> { %>
<aside>
<%= Html.ActionLink("Editer","Edit", new { user = Model.UserName, title = Model.Title }, new { @class="actionlink" }) %> <%= 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" } ) %> <%= Html.ActionLink("Supprimer","RemovePost", new { user = Model.UserName, title = Model.Title }, new { @class="actionlink" } ) %>
<% } %> <% } %>
</aside>
</asp:Content> </asp:Content>

Loading…