From 5da977daeffc8fa05a8fa231900c10aba415b360 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Wed, 30 Sep 2015 12:53:38 +0200 Subject: [PATCH] A new presentation, using parallax effects * style.css: Makes a better style * Banner.png: Made obsolete * Profile.cs: Groups profile properties * ChangeLog: * ChangeLog: Must not exist in the source tree * Web.config: * instdbws.sql: Groups profile properties * App.master: A better Html structure * AccountController.cs: Fixes the Profile edition * MarkdownHelper.cs: Adds an extraction of an introduction from a Markdown text * Edit.aspx: * Index.aspx: * UserPost.aspx: a better html structure * UserPosts.aspx: * a better html structure * post previews * Web.csproj: Adds and removes images --- web/App_Themes/style.css | 165 +++++++++++++------------- web/ChangeLog | 66 +++++++++++ web/Controllers/AccountController.cs | 2 +- web/Helpers/MarkdownHelper.cs | 24 ++++ web/Models/App.master | 55 ++++++--- web/Views/Blogs/Edit.aspx | 38 ++++-- web/Views/Blogs/Index.aspx | 18 +-- web/Views/Blogs/UserPost.aspx | 30 ++--- web/Views/Blogs/UserPosts.aspx | 15 ++- web/Web.config | 51 ++++---- web/Web.csproj | 12 +- web/images/Banner.png | Bin 93007 -> 0 bytes web/instdbws.sql | 67 ++++++----- yavscModel/ChangeLog | 10 ++ yavscModel/RolesAndMembers/Profile.cs | 27 +++-- 15 files changed, 375 insertions(+), 205 deletions(-) delete mode 100644 web/images/Banner.png diff --git a/web/App_Themes/style.css b/web/App_Themes/style.css index e394f7ad..2b885508 100644 --- a/web/App_Themes/style.css +++ b/web/App_Themes/style.css @@ -1,54 +1,100 @@ + body { - background-image: url('/images/Banner.png'); - background-repeat: no-repeat; background-color: black; color: #D0FFD0; font-family: 'Arial', cursive; padding: 0em; - margin-bottom:3em; } -textarea { - width:25em; - height:5em; -} +.iconsmall { max-height: 1.3em; max-width: 1.3em; } input, textarea, checkbox { color: #FFFFA0; background: black; } -main { +header { + border-radius:10px; margin: .5em; padding: .5em; - background-color: rgba(64,64,64,0.6); - border-radius:10px; - clear: both; + display: block; + background: url("/images/helix-nebula-1400x1400.s.jpg") 50% 0 repeat fixed; + min-height: 25em; } +nav { + border-radius:10px; + margin: .5em; + padding: .5em; + display: block; + background: url("/images/live-concert-388160_1280.s.jpg") 50% 0 repeat fixed ; + min-height: 25em; +} + +main { + border-radius:10px; + margin: .5em; + padding: .5em; + display: block; + background: url("/images/musician-923526_1280.s.jpg") 50% 0 repeat fixed ; + min-height: 25em; + } + +footer { + border-radius:10px; + margin: .5em; + padding: .5em; + display: block; + background: url("/images/drummer-652345_1280.s.jpg") 50% 0 repeat fixed ; + min-height: 25em; + clear: both; + display: flex; + font-size: smaller; +} + fieldset { background-color: rgba(32,16,16,0.8); border-radius:5px; border: solid 1px #000060; } -video,img { +video, img { max-width:100%; max-height:75%; - position:relative; + padding: .5em; } -footer { - position:fixed; - bottom:0; - left:0; - right:0; - background-color:rgba(16,0,0,0.8); - display: flex; - z-index:-1; - font-size: smaller; +aside { + display: inline-block; + float: right; + max-width: 40em; } +.postpreview { + display: inline-block; + max-width: 40em; + padding: .5em; + margin: .5em; + background-color: rgba(32,32,64,0.8); + border-radius:10px; +} +.postpreview video, .postpreview img { + max-width:100%; + max-height:5em; + } +.post { + display:block; + margin:1em; + padding:1em; + background-color: rgba(32,32,64,0.8); + color: #aaa; + border-radius:10px; + } +.hiddenpost { background-color: rgba(16,16,0,0.3); } +.fullwidth { width: 100%; } + +textarea.fullwidth { min-height:10em; } + .thanks { max-width: 10%; text-align: center; @@ -58,7 +104,7 @@ footer { } -.panel,.bshpanel,aside { +.panel,.bshpanel, aside { background-color: rgba(32,16,16,0.8); border-radius:5px; margin:.5em; @@ -66,23 +112,10 @@ footer { } -#appmenu { - line-height: 1em; - margin: .5em; - padding: .5em; - border-radius:10px; - color: #ff8; - background-color: rgba(32,16,16,.6); - float: right; - } - -#appmenu img { max-height:2em; max-width:2em; } - -.menuitem { -} .hint { display: inline; font-style: italic; + font-size: smaller; } .hint::before { content: "("; @@ -91,16 +124,10 @@ content: "("; content: ")"; } -header { - border-radius:10px; - background-color:rgba(16,16,0,0.8); - display: block; - float:left; - margin: .5em; - padding: .5em; - } -h1 img { vertical-align: text-top; } + +h1 img { vertical-align: text-top; + } a { text-decoration: none; @@ -136,32 +163,6 @@ label { background-color: rgba(64,0,0,0.3); } -.editblog { - width: 95%; - height: 95%; -} - -.metablog { - font-style: italic; - font-size: small; - text-align: right; - display: inline; -} - -.blogtitle { - display:inline; -} -.blogpost { - display:block; - margin:1em; - padding:1em; - background-color: #090609; - color: #aaa; - border-radius:5px; -} -.contenu { -padding-left: 20px; -} .hidden { display:none; } @@ -223,6 +224,13 @@ a.actionlink img { top:4px; } } +.menuitem { + background-color: rgba(0,0,40,.8); + border-radius:5px; + margin:.5em; + padding:.5em; +} + .onhover { display:none; position: absolute; @@ -243,7 +251,7 @@ a.actionlink img { top:4px; } @media print { body {background-color:white;color:black;} - header,footer,.postcomment,.actionlink,.metablog,#appmenu + header,footer,.postcomment,.actionlink,nav { display:none;} } @@ -257,13 +265,12 @@ a.actionlink img { top:4px; } } @media all and (max-width: 640px) { -#appmenu {display:inline;} + + .menuitem { - display: inline; -} -.menuitem:not(:last-child):after { - content:' |'; + display: inline-block; } + .bshpanel { cursor:zoom-in; } footer { clear:both; @@ -280,5 +287,3 @@ a.actionlink img { top:4px; } .c2-alt { display:initial; } } - - diff --git a/web/ChangeLog b/web/ChangeLog index 1abf46a5..8d67cc1b 100644 --- a/web/ChangeLog +++ b/web/ChangeLog @@ -1,3 +1,69 @@ +2015-09-30 Paul Schneider + + * style.css: Makes a better style + + * Banner.png: Made obsolete + + * ChangeLog: Must not exist in the source tree + + * Web.config: + * instdbws.sql: Groups profile properties + + * App.master: A better Html structure + + * AccountController.cs: Fixes the Profile edition + + * MarkdownHelper.cs: Adds an extraction of an introduction + from a Markdown text + + * Edit.aspx: + * Index.aspx: + * UserPost.aspx: a better html structure + + * UserPosts.aspx: * a better html structure + * post previews + + * Web.csproj: Adds and removes images + +2015-09-30 Paul Schneider + + * drummer-652345_1280.jpg: + * musician-923526_1280.jpg: + * an-pierle-876094_1280.jpg: + * drummer-652345_1280.s.jpg: + * musician-923526_1280.s.jpg: + * helix-nebula-1400x1400.jpg: + * live-concert-388160_1280.jpg: + * helix-nebula-1400x1400.s.jpg: + * live-concert-388160_1280.s.jpg: some image + + * style.css: makes a new style + + * AccountController.cs: fixes the profile edition + + * MarkdownHelper.cs: implements an helper to build a preview + from some Markdown text + + * App.master: * use the non-min jquery-ui.js + * use a simpler code for parallax + * nicer code + * small icon in the link to blog posts + * do not show G+1 in Debug mode + + * Web.config: + * Edit.aspx: + * Index.aspx: + * UserPost.aspx: a better html structure + + * UserPosts.aspx: * a better html structure + * displays a post preview + + * Web.csproj: image additions and deletion + + * instdbws.sql: groups some profile attributes + + * Banner.png: obsolete + 2015-09-28 Paul Schneider * App.master: Use local copies for jquery & jquery-ui diff --git a/web/Controllers/AccountController.cs b/web/Controllers/AccountController.cs index dbd95f0a..3de7da21 100644 --- a/web/Controllers/AccountController.cs +++ b/web/Controllers/AccountController.cs @@ -291,7 +291,7 @@ namespace Yavsc.Controllers string logdu = Membership.GetUser ().UserName; ViewData ["UserName"] = id; - bool editsMyName = (id != model.Name); + bool editsMyName = (string.Compare(id,model.Name)==0); if (!editsMyName) if (!Roles.IsUserInRole ("Admin")) if (!Roles.IsUserInRole ("FrontOffice")) diff --git a/web/Helpers/MarkdownHelper.cs b/web/Helpers/MarkdownHelper.cs index 14623704..100a3dbe 100644 --- a/web/Helpers/MarkdownHelper.cs +++ b/web/Helpers/MarkdownHelper.cs @@ -43,6 +43,30 @@ namespace Yavsc.Helpers // Wrap the html in an MvcHtmlString otherwise it'll be HtmlEncoded and displayed to the user as HTML :( return new MvcHtmlString(html); } + + public static IHtmlString MarkdownToHtmlIntro(this HtmlHelper helper, out bool truncated, string text, string urlBaseLocation="") + { + int maxLen = 250; + // Transform the supplied text (Markdown) into HTML. + var markdownTransformer = new Markdown(); + markdownTransformer.ExtraMode = true; + markdownTransformer.UrlBaseLocation = urlBaseLocation; + if (text.Length < maxLen) { + truncated = false; + return new MvcHtmlString(markdownTransformer.Transform(text)); + } + string intro = text.Remove (maxLen); + truncated = true; + int inl = intro.LastIndexOf ("\n"); + if (inl > 20) + intro = intro.Remove (inl); + intro += " ..."; + + string html = markdownTransformer.Transform(intro); + // Wrap the html in an MvcHtmlString otherwise it'll be HtmlEncoded and displayed to the user as HTML :( + return new MvcHtmlString(html); + } + /// /// Transforms a string of Markdown into HTML. /// diff --git a/web/Models/App.master b/web/Models/App.master index 58adc08b..9aa43b44 100644 --- a/web/Models/App.master +++ b/web/Models/App.master @@ -9,36 +9,53 @@ - +" /> " /> " /> - + - + -
+
+ +

<%=ViewState["orgtitle"]%> - -"><%= YavscHelpers.SiteName %> +"><%= YavscHelpers.SiteName %>

+ +
<%= (ViewData["Error"]!=null)? Html.Encode(ViewData["Error"]) : "" %>
<%= Html.Encode(ViewData["Message"]) %>
+
-
+
- -
+ +
+
+
-