refactoring

This commit is contained in:
Paul Schneider
2015-10-17 19:07:54 +02:00
parent 1805cb3e17
commit bb5e34a61d
29 changed files with 789 additions and 452 deletions

View File

@ -39,7 +39,6 @@ body.loading .modal {
}
.iconsmall { max-height: 1.3em; max-width: 1.3em; }
.photo { width: 100%; }
.blogbanner { float: left; top:0; }
.subtitle { font-size:small; font-style: italic; }
@ -96,7 +95,7 @@ legend {
footer p { display:inline-block; }
footer img { max-height: 3em; vertical-align: middle; }
a img, h1 img, .menuitem img { max-height: 1em; vertical-align: middle; }
a img, h1 img, .menuitem img { vertical-align: middle; }
#gspacer {
background-color: rgba(20,20,20,.8);
@ -275,12 +274,6 @@ input, select, textarea {
border-radius:25px;
white-space: pre-wrap;
}
.avatar {
max-width: 64px;
max-height: 64px;
}
#avatar {
float: left;
margin:1em;
@ -323,6 +316,10 @@ header {
padding-bottom:1em;
}
#avatar {
margin:.5em;
}
header h1, header a , .actionlink, .menuitem, a { padding:.5em;}
nav {

View File

@ -1,3 +1,17 @@
2015-10-17 Paul Schneider <paul@pschneider.fr>
* Web.csproj:
* Global.asax.cs:
* yavsc.js:
* App.master:
* style.css:
* NoLogin.master:
* YavscHelpers.cs:
* TagPanel.ascx:
* UserPosts.aspx:
* AccountController.cs:
* FrontOfficeController.cs:
2015-10-17 Paul Schneider <paul@pschneider.fr>
* Web.csproj:

View File

@ -332,7 +332,7 @@ namespace Yavsc.Controllers
UserManager.ChangeName (id, model.Name);
FormsAuthentication.SetAuthCookie (model.Name, model.RememberMe);
}
ViewData ["Message"] = "Profile enregistré"+((editsMyName)?", nom public inclu.":"");
YavscHelpers.Notify(ViewData, "Profile enregistré"+((editsMyName)?", nom public inclu.":""));
}
return View (model);
}

View File

@ -14,6 +14,7 @@ using Yavsc.Model.FrontOffice;
using Yavsc.Model.FileSystem;
using Yavsc.Model.Calendar;
using System.Configuration;
using Yavsc.Helpers;
namespace Yavsc.Controllers
{
@ -206,7 +207,7 @@ namespace Yavsc.Controllers
ViewData ["ProdRef"] = pref;
Catalog cat = CatalogManager.GetCatalog ();
if (cat == null) {
ViewData ["Message"] = "Catalog introuvable";
YavscHelpers.Notify(ViewData, "Catalog introuvable");
ViewData ["RefType"] = "Catalog";
return View ("ReferenceNotFound");
}
@ -249,10 +250,10 @@ namespace Yavsc.Controllers
// Add specified product command to the basket,
// saves it in db
new Command(collection,HttpContext.Request.Files);
ViewData ["Message"] = LocalizedText.Item_added_to_basket;
YavscHelpers.Notify(ViewData, LocalizedText.Item_added_to_basket);
return View (collection);
} catch (Exception e) {
ViewData ["Message"] = "Exception:" + e.Message;
YavscHelpers.Notify(ViewData,"Exception:" + e.Message);
return View (collection);
}
}

View File

@ -48,13 +48,13 @@ namespace Yavsc
routes.IgnoreRoute ("robots.txt"); // for search engine robots
routes.MapRoute (
"Titles",
"t/{title}",
"title/{title}",
new { controller = "Blogs", action = "Index",
title=UrlParameter.Optional }
);
routes.MapRoute (
"Blogs",
"b/{user}",
"blog/{user}",
new { controller = "Blogs",
action = "UserPosts",
user="Paul Schneider" }
@ -75,11 +75,6 @@ namespace Yavsc
new { controller = "Blogs", action = "Index",
postid=UrlParameter.Optional }
);
/* routes.MapRoute (
"Artistes",
"a/{artiste}",
new { controller = "Artistes", action = "Index", artiste = UrlParameter.Optional }
); */
routes.MapRoute (
"Default",
"{controller}/{action}/{id}",

View File

@ -55,7 +55,9 @@ namespace Yavsc.Helpers
/// <param name="user">User.</param>
public static void SendActivationMessage(this System.Web.Http.Routing.UrlHelper helper, MembershipUser user)
{
SendActivationMessage (helper.Route("~/Account/Validate/",new { id=user.UserName, key=user.ProviderUserKey.ToString() } )
SendActivationMessage (helper.Route("Default", new { controller="Account",
action = "Validate",
key=user.ProviderUserKey.ToString() } )
, WebConfigurationManager.AppSettings ["RegistrationMessage"],
user);
}

View File

@ -1,4 +1,4 @@
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" CodeBehind="App.master.cs" %>
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<asp:ContentPlaceHolder id="init" runat="server">
@ -35,20 +35,15 @@ var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>';
</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder ID="header" runat="server"></asp:ContentPlaceHolder>
<div id="notifications"></div>
<%if (ViewData ["Notifications"]!=null) { %>
<script>
$(document).ready(function(){
<%if (ViewData ["Notifications"]!=null) { %>
<% foreach (string notice in (IEnumerable<string>) ViewData ["Notifications"] ) { %>
Yavsc.notice('<%=notice%>');
<% foreach (string note in (IEnumerable<string>) ViewData ["Notifications"] ) { %>
Yavsc.notice('<%=note%>');
<% } %>
<% } %>
$body = $("body");
$(document).on({
ajaxStart: function() { $body.addClass("loading"); },
ajaxStop: function() { $body.removeClass("loading"); }
});
});
</script>
<% } %>
</header>
<nav data-type="background" data-speed="2">
<% if (Membership.GetUser()==null) { %>
@ -71,7 +66,7 @@ $(document).on({
</a>
<a href="<%= Url.RouteUrl("Default", new { controller = "Account", action = "Logout", returnUrl=Request.Url.PathAndQuery}) %>" accesskey = "C" class="menuitem">
<i class="fa fa-sign-out">Deconnexion</i></a>
<i class="fa fa-sign-out"><%=Html.Translate("Logout")%></i></a>
<% } %>
</nav>
<main data-type="background" data-speed="10" data-emheight="10" data-posx="0" data-posy="22" >

View File

@ -2,64 +2,80 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<asp:ContentPlaceHolder id="init" runat="server">
</asp:ContentPlaceHolder><%
ViewState["orgtitle"] = T.GetString(Page.Title);
</asp:ContentPlaceHolder>
<% ViewState["orgtitle"] = Html.Translate(Page.Title);
Page.Title = ViewState["orgtitle"] + " - " + YavscHelpers.SiteName;
%><head runat="server">
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="/App_Themes/style.css" />
<link rel="stylesheet" href="<%=Url.Content("~/App_Themes/style.css")%>" />
<link rel="stylesheet" href="<%=Url.Content("~/App_Themes/font-awesome.css")%>" />
<link rel="stylesheet" href="<%=Url.Content("~/App_Themes/jquery-ui.css")%>" />
<link rel="icon" type="image/png" href="/favicon.png?v=3" />
<script type="text/javascript" src="<%=Url.Content("~/Scripts/jquery-2.1.4.min.js")%>"></script>
<script src="<%=Url.Content("~/Scripts/jquery-2.1.4.min.js")%>"></script>
<script src="<%=Url.Content("~/Scripts/jquery-ui-1.11.4.js")%>"></script>
<script src="<%=Url.Content("~/Scripts/parralax.js")%>"></script>
<script type="text/javascript">
var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>';
</script>
<script src="<%=Url.Content("~/Scripts/yavsc.js")%>">
</script>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<link href='http://fonts.googleapis.com/css?family=Dancing+Script:400,700' rel='stylesheet' type='text/css'/>
</head>
<body>
<header>
<header data-type="background" data-speed="8" >
<asp:ContentPlaceHolder ID="overHeaderOne" runat="server">
<h1><a href="<%= Url.Content("~/") %>"> <%=ViewState["orgtitle"]%> </a> -
<a href="<%=Request.Url.Scheme + "://" + Request.Url.Authority%>"><%= YavscHelpers.SiteName %></a>
</h1>
</asp:ContentPlaceHolder><asp:ContentPlaceHolder ID="header" runat="server"></asp:ContentPlaceHolder><%
if (ViewData["Error"]!=null) {
%><div class="error"><%= Html.Encode(ViewData["Error"]) %>
</div><% }
if (ViewData["Message"]!=null) {
%><div class="message"><%= Html.Encode(ViewData["Message"]) %></div><% }
%>
<h1><a href="<%= Url.Content("~/") %>">
<%=ViewState["orgtitle"]%></a>
- <a href="<%= Url.Content("~/") %>"><%= YavscHelpers.SiteName %></a>
</h1>
</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder ID="header" runat="server"></asp:ContentPlaceHolder>
<div id="notifications"></div>
<%if (ViewData ["Notifications"]!=null) { %>
<script>
$(document).ready(function(){
<% foreach (string note in (IEnumerable<string>) ViewData ["Notifications"] ) { %>
Yavsc.notice('<%=note%>');
<% } %>
});
</script>
<% } %>
</header>
<main>
<nav data-type="background" data-speed="2">
<a href="<%= Url.RouteUrl("Default", new { controller = "Account", action = "Logout", returnUrl=Request.Url.PathAndQuery}) %>" accesskey = "C" class="menuitem">
<i class="fa fa-sign-out">Deconnexion</i></a>
</nav>
<main data-type="background" data-speed="10" data-emheight="10" data-posx="0" data-posy="22" >
<asp:ContentPlaceHolder ID="MainContent" runat="server">
</asp:ContentPlaceHolder>
</main>
<asp:ContentPlaceHolder ID="MASContent" runat="server">
</asp:ContentPlaceHolder>
<footer>
<script src="https://apis.google.com/js/platform.js" async defer>
<footer data-type="background" data-speed="2" >
<div id="copyr">
© 2012 Totem Production. Tous droits réservés.
</div>
<div >
<p class="control">
<%= Html.ActionLink("Formulaire de contact","Contact","Home") %>
</p>
<p>
<a href="https://fr-fr.facebook.com/Brahms.Totem.officiel" ><img src="/images/facebook.png" alt="facebook"/></a>
<a href="http://twitter.com/TotemOfficiel"><img src="/images/twiter.png" alt="twiter"/></a>
</p>
<script src="https://apis.google.com/js/platform.js" defer>
{lang: 'fr'}
</script>
<%= Html.ActionLink("Contact","Contact","Home",null, new { @class="thanks" }) %>
<% foreach ( Link link in Html.Thanks()) { %>
<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>
</footer>
<script type="text/javascript">
var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>';
</script> <script>
$( ".bshd" ).on("click",function(e) {
if (e.target == "[object HTMLElement]") {
var panel = $(this).children(".bshpanel");
if (panel.hasClass("hidden")) panel.css("cursor","zoom-out");
else panel.css("cursor","zoom-in");
panel.toggleClass("hidden");
$(this).children(".bsh").toggleClass("hidden");
} });
</script>
<div id="gspacer" class="control"><div class="g-plusone" data-annotation="inline" data-width="170"></div>
</div>
</div>
</footer><div class="modal"></div>
</body>
</html>

View File

@ -63,6 +63,13 @@ return self;
})();
$(document).ready(function(){
$body = $("body");
$(document).on({
ajaxStart: function() { $body.addClass("loading"); },
ajaxStop: function() { $body.removeClass("loading"); }
});
var $window = $(window);
$(window).scroll(function() {
var $ns = $('#notifications');

View File

@ -0,0 +1,10 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TagInfo>" %>
<div class="panel">
<i class="fa fa-tag"><%=Model.Name%></i>
<ul>
<% foreach (BasePostInfo be in Model.Titles) { %>
<li><%= be.Title %>
<span><%= be.Intro %></span>
</li>
<% } %></ul>
</div>

View File

@ -14,7 +14,7 @@
<h1 class="blogtitle">
<a href="<%=Url.RouteUrl( "Blogs", new { user = Model.Author } )%>">
<%=Html.Encode(ViewData["BlogTitle"])%></a>
- <a href="<%= Url.RouteUrl( "Default") %>"><%= YavscHelpers.SiteName %></a>
- <a href="<%= Url.RouteUrl( "Default", new { controller = "Home" } ) %>"><%= YavscHelpers.SiteName %></a>
</h1>
</asp:Content>

View File

@ -434,6 +434,7 @@
<Content Include="Scripts\knockout-jqAutocomplete.js" />
<Content Include="Scripts\knockout-jqAutocomplete.min.js" />
<Content Include="Views\Blogs\PageLinks.ascx" />
<Content Include="Views\Blogs\TagPanel.ascx" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />