diff --git a/ChangeLog b/ChangeLog index 161629d2..aadc4df3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-11-18 Paul Schneider + + * Makefile: adds my deployment targets + 2015-11-17 Paul Schneider * Makefile: adds nuget targets diff --git a/Makefile b/Makefile index 3b37e8c7..12a2f483 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,8 @@ CONFIG=Debug LDYDESTDIR=dist/web/$(CONFIG) COPYUNCHANGED="false" -HOST_rsync_yavsc=lua.pschneider.fr -DESTDIR_rsync_yavsc=/srv/www/yavsc - -HOST_rsync_lua=lua.pschneider.fr -DESTDIR_rsync_lua=/srv/www/lua +HOST_rsync_dev=lua.pschneider.fr +DESTDIR_rsync_dev=/srv/www/yavscdev HOST_rsync_pre=lua.pschneider.fr DESTDIR_rsync_pre=/srv/www/yavscpre @@ -16,6 +13,18 @@ DESTDIR_rsync_pre=/srv/www/yavscpre HOST_rsync_prod=lua.pschneider.fr DESTDIR_rsync_prod=/srv/www/yavsc +HOST_rsync_lua=lua.pschneider.fr +DESTDIR_rsync_lua=/srv/www/lua + +HOST_rsync_totemdev=lua.pschneider.fr +DESTDIR_rsync_totemdev=/srv/www/totemdev + +HOST_rsync_totempre=lua.pschneider.fr +DESTDIR_rsync_totempre=/srv/www/totempre + +HOST_rsync_totemprod=lua.pschneider.fr +DESTDIR_rsync_totemprod=/srv/www/totemprod + DOCASSBS=NpgsqlBlogProvider.dll WorkFlowProvider.dll Yavsc.WebControls.dll ITContentProvider.dll NpgsqlMRPProviders.dll Yavsc.dll SalesCatalog.dll YavscModel.dll RSYNCCMD=rsync -ravu --chown=www-data:www-data diff --git a/web/Global.asax.cs b/web/App_Code/Global.asax.cs similarity index 93% rename from web/Global.asax.cs rename to web/App_Code/Global.asax.cs index c5681ea6..74a4ddee 100644 --- a/web/Global.asax.cs +++ b/web/App_Code/Global.asax.cs @@ -28,11 +28,6 @@ namespace Yavsc /// Routes. public static void RegisterRoutes (RouteCollection routes) { - // Should be FrontOffice in a POS, - string defaultController = - WebConfigurationManager.AppSettings ["DefaultController"]; - if (defaultController == null) - defaultController = "Home"; routes.IgnoreRoute ("{resource}.axd/{*pathInfo}"); // not used routes.IgnoreRoute ("Scripts/{*pathInfo}"); // web user side scripts routes.IgnoreRoute ("App_Theme/{*pathInfo}"); // sites themes @@ -56,7 +51,7 @@ namespace Yavsc "blog/{user}", new { controller = "Blogs", action = "UserPosts", - user="Paul Schneider" } + user= UrlParameter.Optional } ); routes.MapRoute ( diff --git a/web/App_Themes/dark/style.css b/web/App_Themes/dark/style.css index e1a44004..1f383d27 100644 --- a/web/App_Themes/dark/style.css +++ b/web/App_Themes/dark/style.css @@ -97,7 +97,6 @@ main video, main img { aside { display: inline-block; - float: right; } .postpreview { diff --git a/web/ChangeLog b/web/ChangeLog index 21750ca7..0550266f 100644 --- a/web/ChangeLog +++ b/web/ChangeLog @@ -1,3 +1,29 @@ +2015-11-18 Paul Schneider + + * style.css: this floating breaks my dark style + + * Global.asax: the application object is now compiled at + runtime, + its code is in App_Code + + * YavscHelpers.cs: Implements a method helping to refer on + themed stylesheets, + presenting the "alternate" stylesheet usage. + + * App.master: Uses the new Helper function to refer on the + main style sheet `style.css` + + * Web.config: * no more default controller, instead, modify + the app code + * the client side javascript validation is custommized, and we + do not need the M$ js for now + + + * Web.csproj: Global.asax.cs becomes a content, compiled at + runtime, found in ~/App_Code + + * Global.asax.cs: Now compiles at runtime. + 2015-11-18 Paul Schneider * style.css: diff --git a/web/Global.asax b/web/Global.asax index 569f561d..349e59f7 100644 --- a/web/Global.asax +++ b/web/Global.asax @@ -1 +1 @@ -<%@ Application Inherits="Yavsc.MvcApplication" %> +<%@ Application Codebehind="Global.asax.cs" Inherits="Yavsc.MvcApplication" Language="C#" %> \ No newline at end of file diff --git a/web/Helpers/YavscHelpers.cs b/web/Helpers/YavscHelpers.cs index ea00a02b..6bdeeb70 100644 --- a/web/Helpers/YavscHelpers.cs +++ b/web/Helpers/YavscHelpers.cs @@ -16,6 +16,7 @@ using System.Web.Script.Serialization; using System.Web.Mvc; using System.Text.RegularExpressions; using Yavsc.Model.Messaging; +using System.Linq; namespace Yavsc.Helpers { @@ -338,7 +339,63 @@ namespace Yavsc.Helpers } return new MvcHtmlString(strwr.ToString()); } + /// + /// The available themes. + /// + public static string[] AvailableThemes = { + "clear", "dark", "blue", "green" + }; + /// + /// Themes the CSS links. + /// + /// The CSS links. + /// Html. + /// Theme. + /// Base name. + public static IHtmlString ThemeCSSLinks ( + this System.Web.Mvc.HtmlHelper html, string theme, string baseName) { + + if (!AvailableThemes.Contains (theme)) + throw new ArgumentException ("The given theme is not configured: " + + theme); + if (string.IsNullOrWhiteSpace(baseName)) + throw new ArgumentException ("Specify a base name"); + + StringWriter strwr = new StringWriter (); + HtmlTextWriter writer = new HtmlTextWriter(strwr); + // refer to the global style + writer.AddAttribute ("rel", "stylesheet"); + writer.AddAttribute ("title", theme); + writer.AddAttribute ("href", + string.Format( + "/App_Themes/{1}.css", + theme,baseName)); + writer.RenderBeginTag ("link"); + + // refer to the themed style + writer.AddAttribute ("rel", "stylesheet"); + writer.AddAttribute ("title", theme); + writer.AddAttribute ("href", + string.Format( + "/App_Themes/{0}/{1}.css", + theme,baseName)); + writer.RenderBeginTag ("link"); + + // refer to alternate styles + foreach (string atheme in AvailableThemes) { + if (atheme != theme) { + writer.AddAttribute ("rel", "alternate stylesheet"); + writer.AddAttribute ("title", atheme); + writer.AddAttribute ("href", + string.Format ( + "/App_Themes/{0}/{1}.css", + atheme, baseName)); + writer.RenderBeginTag ("link"); + } + } + return new MvcHtmlString(strwr.ToString()); + } } } diff --git a/web/Models/App.master b/web/Models/App.master index 912738d1..5581077f 100644 --- a/web/Models/App.master +++ b/web/Models/App.master @@ -11,8 +11,7 @@ Page.StyleSheetTheme = (string) Profile.UITheme; %> -" /> -" /> +<%= Html.ThemeCSSLinks(Page.StyleSheetTheme,"style")%> " /> " /> " /> diff --git a/web/Web.config b/web/Web.config index 40957341..c0f04b66 100644 --- a/web/Web.config +++ b/web/Web.config @@ -266,11 +266,10 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx - - - + diff --git a/web/Web.csproj b/web/Web.csproj index 813d20d1..8c0bcd2c 100644 --- a/web/Web.csproj +++ b/web/Web.csproj @@ -144,12 +144,10 @@ + - - Global.asax - @@ -490,6 +488,7 @@ +