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
This commit is contained in:
Paul Schneider
2015-09-30 12:53:38 +02:00
parent c10a78841b
commit 5da977daef
15 changed files with 375 additions and 205 deletions

View File

@ -1,54 +1,100 @@
body { body {
background-image: url('/images/Banner.png');
background-repeat: no-repeat;
background-color: black; background-color: black;
color: #D0FFD0; color: #D0FFD0;
font-family: 'Arial', cursive; font-family: 'Arial', cursive;
padding: 0em; padding: 0em;
margin-bottom:3em;
} }
textarea { .iconsmall { max-height: 1.3em; max-width: 1.3em; }
width:25em;
height:5em;
}
input, textarea, checkbox { input, textarea, checkbox {
color: #FFFFA0; color: #FFFFA0;
background: black; background: black;
} }
main { header {
border-radius:10px;
margin: .5em; margin: .5em;
padding: .5em; padding: .5em;
background-color: rgba(64,64,64,0.6); display: block;
border-radius:10px; background: url("/images/helix-nebula-1400x1400.s.jpg") 50% 0 repeat fixed;
clear: both; 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 { fieldset {
background-color: rgba(32,16,16,0.8); background-color: rgba(32,16,16,0.8);
border-radius:5px; border: solid 1px #000060; border-radius:5px; border: solid 1px #000060;
} }
video,img { video, img {
max-width:100%; max-width:100%;
max-height:75%; max-height:75%;
position:relative; padding: .5em;
} }
footer { aside {
position:fixed; display: inline-block;
bottom:0; float: right;
left:0; max-width: 40em;
right:0;
background-color:rgba(16,0,0,0.8);
display: flex;
z-index:-1;
font-size: smaller;
} }
.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 { .thanks {
max-width: 10%; max-width: 10%;
text-align: center; text-align: center;
@ -58,7 +104,7 @@ footer {
} }
.panel,.bshpanel,aside { .panel,.bshpanel, aside {
background-color: rgba(32,16,16,0.8); background-color: rgba(32,16,16,0.8);
border-radius:5px; border-radius:5px;
margin:.5em; 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 { .hint {
display: inline; display: inline;
font-style: italic; font-style: italic;
font-size: smaller;
} }
.hint::before { .hint::before {
content: "("; content: "(";
@ -91,16 +124,10 @@ content: "(";
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 { a {
text-decoration: none; text-decoration: none;
@ -136,32 +163,6 @@ label {
background-color: rgba(64,0,0,0.3); 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; } .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 { .onhover {
display:none; display:none;
position: absolute; position: absolute;
@ -243,7 +251,7 @@ a.actionlink img { top:4px; }
@media print { @media print {
body {background-color:white;color:black;} body {background-color:white;color:black;}
header,footer,.postcomment,.actionlink,.metablog,#appmenu header,footer,.postcomment,.actionlink,nav
{ display:none;} { display:none;}
} }
@ -257,13 +265,12 @@ a.actionlink img { top:4px; }
} }
@media all and (max-width: 640px) { @media all and (max-width: 640px) {
#appmenu {display:inline;}
.menuitem { .menuitem {
display: inline; display: inline-block;
}
.menuitem:not(:last-child):after {
content:' |';
} }
.bshpanel { cursor:zoom-in; } .bshpanel { cursor:zoom-in; }
footer { footer {
clear:both; clear:both;
@ -280,5 +287,3 @@ a.actionlink img { top:4px; }
.c2-alt { display:initial; } .c2-alt { display:initial; }
} }

View File

@ -1,3 +1,69 @@
2015-09-30 Paul Schneider <paul@pschneider.fr>
* 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 <paul@pschneider.fr>
* 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 <paul@pschneider.fr> 2015-09-28 Paul Schneider <paul@pschneider.fr>
* App.master: Use local copies for jquery & jquery-ui * App.master: Use local copies for jquery & jquery-ui

View File

@ -291,7 +291,7 @@ namespace Yavsc.Controllers
string logdu = Membership.GetUser ().UserName; string logdu = Membership.GetUser ().UserName;
ViewData ["UserName"] = id; ViewData ["UserName"] = id;
bool editsMyName = (id != model.Name); bool editsMyName = (string.Compare(id,model.Name)==0);
if (!editsMyName) if (!editsMyName)
if (!Roles.IsUserInRole ("Admin")) if (!Roles.IsUserInRole ("Admin"))
if (!Roles.IsUserInRole ("FrontOffice")) if (!Roles.IsUserInRole ("FrontOffice"))

View File

@ -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 :( // Wrap the html in an MvcHtmlString otherwise it'll be HtmlEncoded and displayed to the user as HTML :(
return new MvcHtmlString(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);
}
/// <summary> /// <summary>
/// Transforms a string of Markdown into HTML. /// Transforms a string of Markdown into HTML.
/// </summary> /// </summary>

View File

@ -9,36 +9,53 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <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/font-awesome.css")%>" />
<link rel="stylesheet" href="<%=Url.Content("~/App_Themes/jquery-ui.css")%>" /> <link rel="stylesheet" href="<%=Url.Content("~/App_Themes/jquery-ui.css")%>" />
<link rel="icon" type="image/png" href="/favicon.png?v=3" /> <link rel="icon" type="image/png" href="/favicon.png?v=3" />
<script 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.min.js")%>"></script> <script src="<%=Url.Content("~/Scripts/jquery-ui-1.11.4.js")%>"></script>
<script type="text/javascript"> <script type="text/javascript">
var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>'; var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>';
$(document).ready(function(){
var $window = $(window);
$('[data-type="background"]').each(function(){
var $bgobj = $(this); // assigning the object
$(window).scroll(function() {
var yPos = -($window.scrollTop() / $bgobj.data('speed'));
// Put together our final background position
var coords = '50% '+ yPos + 'px';
// Move the background
$bgobj.css({ backgroundPosition: coords });
});
});
});
</script> </script>
<script src="/Scripts/yavsc.js"> <script src="/Scripts/yavsc.js"></script>
</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'/>
</head> </head>
<body> <body>
<header> <header data-type="background" data-speed="10">
<asp:ContentPlaceHolder ID="overHeaderOne" runat="server"> <asp:ContentPlaceHolder ID="overHeaderOne" runat="server">
<h1><a href="<%= Html.Encode(Request.Url.AbsoluteUri.ToString()) %>"> <%=ViewState["orgtitle"]%> </a> <h1><a href="<%= Html.Encode(Request.Url.AbsoluteUri.ToString()) %>"> <%=ViewState["orgtitle"]%> </a>
<span> - <span> -
<a href="<%=Request.Url.Scheme + "://" + Request.Url.Authority%>"><%= YavscHelpers.SiteName %></a> <a href="<%= Url.Content("~/") %>"><%= YavscHelpers.SiteName %></a>
</span></h1> </span></h1>
</asp:ContentPlaceHolder> </asp:ContentPlaceHolder>
<asp:ContentPlaceHolder ID="header" runat="server"></asp:ContentPlaceHolder> <asp:ContentPlaceHolder ID="header" runat="server"></asp:ContentPlaceHolder>
<div id="error"><%= (ViewData["Error"]!=null)? Html.Encode(ViewData["Error"]) : "" %></div> <div id="error"><%= (ViewData["Error"]!=null)? Html.Encode(ViewData["Error"]) : "" %></div>
<div id="message"><%= Html.Encode(ViewData["Message"]) %></div> <div id="message"><%= Html.Encode(ViewData["Message"]) %></div>
</header> </header>
<div id="appmenu" > <nav data-type="background" data-speed="10">
<% if (Membership.GetUser()==null) { %> <% if (Membership.GetUser()==null) { %>
<div class="menuitem"> <div class="menuitem">
<%= Html.ActionLink("Authentification", "Login", "Account", new { returnUrl=Request.Url.PathAndQuery },null) %> <%= Html.ActionLink("Authentification", "Login", "Account", new { returnUrl=Request.Url.PathAndQuery },null) %>
@ -46,7 +63,7 @@ var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>';
</div> </div>
<% } else { %><div class="menuitem"> <% } else { %><div class="menuitem">
<a href="/Blog/<%= HttpContext.Current.User.Identity.Name%>"> <a href="/Blog/<%= HttpContext.Current.User.Identity.Name%>">
<img src="<%=Html.AvatarUrl(HttpContext.Current.User.Identity.Name)%>" width="25%" alt="vos billets" /></a> <img src="<%=Html.AvatarUrl(HttpContext.Current.User.Identity.Name)%>" alt="vos billets" class="iconsmall" /></a>
<div class="hint">Vos billets</div> <div class="hint">Vos billets</div>
</div> </div>
@ -62,28 +79,32 @@ var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>';
<%= Html.ActionLink( "Deconnexion", "Logout", "Account", new { returnUrl=Request.Url.PathAndQuery }, null) %> <%= Html.ActionLink( "Deconnexion", "Logout", "Account", new { returnUrl=Request.Url.PathAndQuery }, null) %>
<% } %> <% } %>
</div> </div>
</div> </nav>
<main> <main data-type="background" data-speed="10">
<div>
<asp:ContentPlaceHolder ID="MainContent" runat="server"> <asp:ContentPlaceHolder ID="MainContent" runat="server">
</asp:ContentPlaceHolder> </asp:ContentPlaceHolder>
</div>
</main> </main>
<asp:ContentPlaceHolder ID="MASContent" runat="server"> <asp:ContentPlaceHolder ID="MASContent" runat="server">
</asp:ContentPlaceHolder> </asp:ContentPlaceHolder>
<footer> <footer data-type="background" data-speed="10">
<script src="https://apis.google.com/js/platform.js" defer> <div >
{lang: 'fr'} <%= Html.ActionLink("Formulaire de contact","Contact","Home",null, new { @class="thanks" }) %>
</script>
<%= Html.ActionLink("Contact","Contact","Home",null, new { @class="thanks" }) %>
<% foreach ( Link link in Html.Thanks()) { %> <% foreach ( Link link in Html.Thanks()) { %>
<a class="thanks" href="<%=link.Url%>"><% if (link.Image !=null) { <a class="thanks" href="<%=link.Url%>"><% if (link.Image !=null) {
%><img src="<%= link.Image %>" alt="<%= link.Text %>"/></a> %><img src="<%= link.Image %>" alt="<%= link.Text %>"/></a>
<% } else { %> <% } else { %>
<a class="thanks" href="<%=link.Url%>"><%= link.Text %></a> <a class="thanks" href="<%=link.Url%>"><%= link.Text %></a>
<% }} %> <% }} %>
</div>
<% #if !DEBUG %>
<script src="https://apis.google.com/js/platform.js" defer>
{lang: 'fr'}
</script>
<div class="g-plusone" data-annotation="inline" data-width="230"></div> <div class="g-plusone" data-annotation="inline" data-width="230"></div>
<% #endif %>
</footer> </footer>
</body> </body>
</html> </html>

View File

@ -11,17 +11,18 @@
</asp:Content> </asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server"> <asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<h1><div id="vtitle" for="Title" class="post title editable"><%=Html.Markdown(Model.Title)%></div></h1> <div>
<div id="vcontent" for="Content" class="post content editable">
<%=Html.Markdown(Model.Content,"/bfiles/"+Model.Id+"/")%>
</div>
<% using(Html.BeginForm("ValidateEdit","Blogs")) { %> <% using(Html.BeginForm("ValidateEdit","Blogs")) { %>
<fieldset>
<legend>Billet</legend>
<%= Html.LabelFor(model => model.Title) %> <%= Html.ValidationMessage("Title") %> : <br> <%= Html.LabelFor(model => model.Title) %> <%= Html.ValidationMessage("Title") %> : <br>
<input name="Title" id="Title"> <input name="Title" id="Title" class="fullwidth">
<br> <br>
<%= Html.LabelFor(model => model.Content) %> <%= Html.LabelFor(model => model.Content) %>
<%= Html.ValidationMessage("Content") %>: <br> <%= Html.ValidationMessage("Content") %>: <br>
<textarea id="Content" name="Content"><%=Html.Markdown(Model.Content)%></textarea><br> <style> #Content { }
</style>
<textarea id="Content" name="Content" class="fullwidth" ><%=Html.Markdown(Model.Content)%></textarea><br>
<%= Html.CheckBox( "Visible" ) %> <%= Html.CheckBox( "Visible" ) %>
<%= Html.LabelFor(model => model.Visible) %> <%= Html.LabelFor(model => model.Visible) %>
@ -37,7 +38,16 @@
<%=Html.Hidden("Author")%> <%=Html.Hidden("Author")%>
<%=Html.Hidden("Id")%> <%=Html.Hidden("Id")%>
<input type="submit"> <input type="submit">
</fieldset>
<% } %> <% } %>
</div>
<div class="post">
<h1><div id="vtitle" for="Title" class="post title editable"><%=Html.Markdown(Model.Title)%></div></h1>
<div id="vcontent" for="Content" class="post content editable">
<%=Html.Markdown(Model.Content,"/bfiles/"+Model.Id+"/")%>
</div>
</div>
<script> <script>
jQuery('#vtitle').hallo({ jQuery('#vtitle').hallo({
@ -166,16 +176,18 @@ function submitFile()
{ submitFilesTo('PostFile'); } { submitFilesTo('PostFile'); }
</script> </script>
<form id="uploads" method="post" enctype="multipart/form-data"> <form id="uploads" method="post" enctype="multipart/form-data">
<fieldset>
<legend>Fichiers attachés</legend>
<input type="file" name="attached" id="postedfile" multiple> <input type="file" name="attached" id="postedfile" multiple>
<input type="button" value="attacher les ficher" onclick="submitFile()"> <input type="button" value="attacher les ficher" onclick="submitFile()">
<input type="button" value="importer les documents" onclick="submitImport()"> <input type="button" value="importer les documents" onclick="submitImport()">
</fieldset>
</form> </form>
</asp:Content>
<asp:Content ContentPlaceHolderID="MASContent" ID="MASContentContent" runat="server"> <aside>
<div class="metablog"> Id:<%= Html.ActionLink( Model.Id.ToString() , "UserPost", new { user= Model.Author, title=Model.Title, id = Model.Id }, new { @class = "usertitleref actionlink" }) %>
(Id:<a href="/Blogs/UserPost/<%= Model.Id %>"> , Posted: <%= Model.Posted.ToString("yyyy/MM/dd") %> - Modified: <%= Model.Modified.ToString("yyyy/MM/dd") %>
<i><%= Model.Id %></i></a>, <%= Model.Posted.ToString("yyyy/MM/dd") %> - <%= Model.Modified.ToString("yyyy/MM/dd") %> <%= Model.Visible? "":", Invisible!" %>) <%= Html.ActionLink("Supprimer","RemovePost", new { user=Model.Author, title = Model.Title }, new { @class="actionlink" } ) %> Visible: <%= Model.Visible? "oui":"non" %> <%= Html.ActionLink("Supprimer","RemovePost", new { user=Model.Author, title = Model.Title }, new { @class="actionlink" } ) %>
</div> </aside>
</asp:Content>
</asp:Content>

View File

@ -4,23 +4,23 @@
<div> <div>
<% foreach (var g in Model.GroupByUser()) { %> <% foreach (var g in Model.GroupByUser()) { %>
<h1><a href="<%= Url.Content("~/Blog/"+g.Key) %>" class="actionlink userref"> <h2><a href="<%= Url.Content("~/Blog/"+g.Key) %>" class="actionlink userref">
<%=g.Key%></a></h1> <%=g.Key%></a></h2>
<% foreach (var p in g) { %> <% foreach (var p in g) { %>
<div class="blogpost"> <div class="postpreview">
<%= Html.ActionLink(p.Title, "UserPost", <%= Html.ActionLink(p.Title, "UserPost",
new { user = g.Key, title = p.Title }, new { @class = "usertitleref actionlink" , style="display:block;"} ) %> new { user = g.Key, title = p.Title }, new { @class = "usertitleref actionlink" } ) %>
le <%=p.Posted.ToString("D") %>
<aside>
(Posté le <%=p.Posted.ToString("D") %>)
<% if (Membership.GetUser()!=null) <% if (Membership.GetUser()!=null)
if ((Membership.GetUser().UserName==g.Key) if ((Membership.GetUser().UserName==g.Key)
|| (Roles.IsUserInRole ("Admin"))) || (Roles.IsUserInRole ("Admin")))
{ %><aside> { %>
<%= Html.ActionLink("Editer","Edit", new { id = p.Id }, new { @class="actionlink" }) %> <%= Html.ActionLink("Editer","Edit", new { id = p.Id }, new { @class="actionlink" }) %>
<%= Html.ActionLink("Supprimer","RemovePost", new { id = p.Id }, new { @class="actionlink" } ) %> <%= Html.ActionLink("Supprimer","RemovePost", new { id = p.Id }, new { @class="actionlink" } ) %>
</aside><% } %> <% } %> </aside>
</div> <% } %> </div> <% } %>
<% } %> <% } %>
</div> </div>

View File

@ -17,25 +17,27 @@
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server"> <asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<% foreach (var be in Model) { %> <% foreach (var be in Model) { %>
<div class="blogpost"> <div class="post">
<%= Html.Markdown(be.Content,"/bfiles/"+be.Id+"/") %> <%= Html.Markdown(be.Content,"/bfiles/"+be.Id+"/") %>
</div>
<% string username = Membership.GetUser().UserName; %>
<% foreach (var c in (Comment[]) BlogManager.GetComments(be.Id)) { %>
<div class="comment" style="min-height:32px;"> <img style="clear:left;float:left;max-width:32px;max-height:32px;margin:.3em;" src="<%= Url.Content("~/Account/Avatar/"+c.From) %>" alt="<%=c.From%>"/>
<%= Html.Markdown(c.CommentText) %>
<% if ( username == Model.Author || c.From == username ) { %>
<%= Html.ActionLink("Supprimer","RemoveComment", new { cmtid = c.Id } , new { @class="actionlink" })%>
<% } %>
</div><% } %>
<% if (Membership.GetUser()!=null) { <% if (Membership.GetUser()!=null) {
if (Membership.GetUser().UserName==be.Author) if (Membership.GetUser().UserName==be.Author)
{ %> <div class="metapost"> { %> <div class="metapost">
<%= Html.ActionLink("Editer","Edit", new { id = be.Id }, new { @class="actionlink" }) %> <%= Html.ActionLink("Editer","Edit", new { id = be.Id }, new { @class="actionlink" }) %>
<%= Html.ActionLink("Supprimer","RemovePost", new { id = be.Id }, new { @class="actionlink" } ) %> <%= Html.ActionLink("Supprimer","RemovePost", new { id = be.Id }, new { @class="actionlink" } ) %>
</div> <% } %> </div> <% } %>
<%
string username = Membership.GetUser().UserName; %> <aside>
<% foreach (var c in (Comment[]) BlogManager.GetComments(be.Id)) { %>
<div class="comment" style="min-height:32px;"> <img style="clear:left;float:left;max-width:32px;max-height:32px;margin:.3em;" src="/Blogs/Avatar/<%=c.From%>" alt="<%=c.From%>"/>
<%= Html.Markdown(c.CommentText) %>
<% if ( username == Model.Author || c.From == username ) { %>
<%= Html.ActionLink("Supprimer","RemoveComment", new { cmtid = c.Id } , new { @class="actionlink" })%>
<% } %>
</div><% } %>
<div class="postcomment">
<% using (Html.BeginForm("Comment","Blogs")) { %> <% using (Html.BeginForm("Comment","Blogs")) { %>
<%=Html.Hidden("Author")%> <%=Html.Hidden("Author")%>
<%=Html.Hidden("Title")%> <%=Html.Hidden("Title")%>
@ -43,6 +45,6 @@
<%=Html.Hidden("PostId",be.Id)%> <%=Html.Hidden("PostId",be.Id)%>
<input type="submit" value="Poster un commentaire"/> <input type="submit" value="Poster un commentaire"/>
<% } %> <% } %>
</div> </aside>
<% } %><% } %> <% } %></div><% } %>
</asp:Content> </asp:Content>

View File

@ -18,10 +18,14 @@
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server"> <asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<% foreach (BlogEntry e in this.Model) { %> <% foreach (BlogEntry e in this.Model) { %>
<div <% if (!e.Visible) { %> style="background-color:#022;" <% } %>> <div class="postpreview<% if (!e.Visible) { %> hiddenpost<% } %>" >
<h2><%= Html.ActionLink(e.Title,"UserPost", new { user=e.Author, title=e.Title, id = e.Id }, new { @class = "usertitleref actionlink" }) %></h2>
<h2 class="blogtitle" ><%= Html.ActionLink(e.Title,"UserPost", new { user=e.Author, title=e.Title, id = e.Id }, new { @class = "usertitleref actionlink" , style="display:block;"}) %></h2> <% bool truncated = false; %>
<div class="metablog">(<%= e.Posted.ToString("yyyy/MM/dd") %> <%= Html.MarkdownToHtmlIntro(out truncated, e.Content,"/bfiles/"+e.Id+"/") %>
<% if (truncated) { %>
<i><%= Html.ActionLink( "lire la suite" ,"UserPost", new { user=e.Author, title=e.Title, id = e.Id }, new { @class = "usertitleref actionlink" }) %></i>
<% } %>
<aside>(<%= e.Posted.ToString("yyyy/MM/dd") %>
- <%= e.Modified.ToString("yyyy/MM/dd") %> <%= e.Visible? "":", Invisible!" %>) - <%= e.Modified.ToString("yyyy/MM/dd") %> <%= e.Visible? "":", Invisible!" %>)
<% if (Membership.GetUser()!=null) <% if (Membership.GetUser()!=null)
if (Membership.GetUser().UserName==e.Author) if (Membership.GetUser().UserName==e.Author)
@ -29,8 +33,7 @@
<%= Html.ActionLink("Editer","Edit", new { id = e.Id }, new { @class="actionlink" }) %> <%= Html.ActionLink("Editer","Edit", new { id = e.Id }, new { @class="actionlink" }) %>
<%= Html.ActionLink("Supprimer","RemovePost", new { id = e.Id }, new { @class="actionlink" } ) %> <%= Html.ActionLink("Supprimer","RemovePost", new { id = e.Id }, new { @class="actionlink" } ) %>
<% } %> <% } %>
</div> </aside>
</div> </div>
<% } %> <% } %>

View File

@ -117,30 +117,39 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<add name="NpgsqlProfileProvider" type="Npgsql.Web.NpgsqlProfileProvider, NpgsqlMRPProviders" connectionStringName="yavsc" applicationName="/" description="ProfileProvider for yavsc" /> <add name="NpgsqlProfileProvider" type="Npgsql.Web.NpgsqlProfileProvider, NpgsqlMRPProviders" connectionStringName="yavsc" applicationName="/" description="ProfileProvider for yavsc" />
</providers> </providers>
<properties> <properties>
<add name="avatar" />
<add name="BlogVisible" type="System.Boolean" />
<add name="Address" />
<add name="BlogTitle" />
<add name="CityAndState" />
<add name="ZipCode" />
<add name="WebSite" />
<add name="Country" />
<add name="Name" /> <add name="Name" />
<add name="Phone" /> <add name="Phone" />
<add name="Mobile" /> <add name="Mobile" />
<add name="BankCode" /> <add name="avatar" />
<add name="BlogVisible" type="System.Boolean" />
<add name="BlogTitle" />
<add name="WebSite" />
<group name="address">
<add name="address" />
<add name="cityandstate" />
<add name="zipcode" />
<add name="country" />
</group>
<group name="bank">
<add name="Code" />
<add name="IBAN" /> <add name="IBAN" />
<add name="BIC" /> <add name="BIC" />
<add name="WicketCode" /> <add name="WicketCode" />
<add name="AccountNumber" /> <add name="AccountNumber" />
<add name="BankedKey" /> <add name="Key" />
<add name="gtoken" /> </group>
<add name="grefreshtoken" />
<add name="gtokentype" /> <group name="google">
<add name="gtokenexpir" /> <add name="token" />
<add name="gcalapi" /> <add name="refreshtoken" />
<add name="gcalid" /> <add name="tokentype" />
<add name="gregid" /> <add name="tokenexpir" />
<add name="calapi" />
<add name="calid" />
<add name="regid" />
</group>
</properties> </properties>
</profile> </profile>
<blog defaultProvider="NpgsqlBlogProvider"> <blog defaultProvider="NpgsqlBlogProvider">

View File

@ -221,7 +221,6 @@
<Content Include="Views\Account\ChangePasswordSuccess.aspx" /> <Content Include="Views\Account\ChangePasswordSuccess.aspx" />
<Content Include="Views\Account\Index.aspx" /> <Content Include="Views\Account\Index.aspx" />
<Content Include="Views\Account\Login.aspx" /> <Content Include="Views\Account\Login.aspx" />
<Content Include="images\Banner.png" />
<Content Include="images\noavatar.png" /> <Content Include="images\noavatar.png" />
<Content Include="images\apache_pbw.png" /> <Content Include="images\apache_pbw.png" />
<Content Include="images\debian-logo.png" /> <Content Include="images\debian-logo.png" />
@ -377,6 +376,17 @@
<Content Include="Scripts\rangy-core.js" /> <Content Include="Scripts\rangy-core.js" />
<Content Include="Scripts\rangy-selectionsaverestore.js" /> <Content Include="Scripts\rangy-selectionsaverestore.js" />
<Content Include="Scripts\jquery.htmlClean.min.js" /> <Content Include="Scripts\jquery.htmlClean.min.js" />
<Content Include="Views\Blogs\ChooseMedia.aspx" />
<Content Include="Scripts\parallax.js" />
<Content Include="images\helix-nebula-1400x1400.jpg" />
<Content Include="images\an-pierle-876094_1280.jpg" />
<Content Include="images\drummer-652345_1280.jpg" />
<Content Include="images\live-concert-388160_1280.jpg" />
<Content Include="images\musician-923526_1280.jpg" />
<Content Include="images\drummer-652345_1280.s.jpg" />
<Content Include="images\helix-nebula-1400x1400.s.jpg" />
<Content Include="images\live-concert-388160_1280.s.jpg" />
<Content Include="images\musician-923526_1280.s.jpg" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

View File

@ -98,31 +98,30 @@ WITH (
CREATE TABLE profiledata CREATE TABLE profiledata
( (
uniqueid integer, uniqueid integer,
zipcode character varying(10), "address.zipcode" character varying(10),
cityandstate character varying(255), "address.cityandstate" character varying(255),
blogtitle character varying(255), -- Blog Title blogtitle character varying(255), -- Blog Title
address character varying(2048), -- Postal address "address.address" character varying(2048), -- Postal address
country character varying(100), "address.country" character varying(100),
website character varying(256), website character varying(256),
blogvisible boolean, blogvisible boolean,
hasavatar boolean, -- True when user has specified an image for avatar
name character varying(1024), name character varying(1024),
phone character varying(15), phone character varying(15),
mobile character varying(15), mobile character varying(15),
accountnumber character varying(15), -- Numero de compte "bank.accountnumber" character varying(15), -- Numero de compte
bankedkey integer, -- clé RIB "bank.key" integer, -- clé RIB
bankcode character varying(5), -- Code banque "bank.code" character varying(5), -- Code banque
wicketcode character varying(5), "bank.wicketcode" character varying(5),
iban character varying(33), "bank.iban" character varying(33),
bic character varying(15), "bank.bic" character varying(15),
gtoken character varying(512), "google.token" character varying(512), -- Google authentification token
grefreshtoken character varying(512), -- Google refresh token "google.refreshtoken" character varying(512), -- Google refresh token
gtokentype character varying(256), -- Google access token type "google.tokentype" character varying(256), -- Google access token type
gcalid character varying(255), "google.calid" character varying(255), -- Google calendar identifier
gtokenexpir timestamp with time zone, -- Google access token expiration date "google.tokenexpir" timestamp with time zone, -- Google access token expiration date
avatar character varying(512), -- url for an avatar avatar character varying(512), -- url for an avatar
gcalapi boolean NOT NULL DEFAULT false, -- true when user authorized to use its Google calendar "google.calapi" boolean NOT NULL DEFAULT false,
gregid character varying(1024), -- Google Cloud Message registration identifier "google.regid" character varying(1024), -- Google Cloud Message registration identifier
CONSTRAINT fkprofiles2 FOREIGN KEY (uniqueid) CONSTRAINT fkprofiles2 FOREIGN KEY (uniqueid)
REFERENCES profiles (uniqueid) MATCH SIMPLE REFERENCES profiles (uniqueid) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE ON UPDATE CASCADE ON DELETE CASCADE
@ -130,22 +129,24 @@ CREATE TABLE profiledata
WITH ( WITH (
OIDS=FALSE OIDS=FALSE
); );
ALTER TABLE profiledata
OWNER TO yavscdev;
COMMENT ON COLUMN profiledata."address.address" IS 'Postal address';
COMMENT ON COLUMN profiledata.blogtitle IS 'Blog Title'; COMMENT ON COLUMN profiledata.blogtitle IS 'Blog Title';
COMMENT ON COLUMN profiledata.address IS 'Postal address';
COMMENT ON COLUMN profiledata.hasavatar IS 'True when user has specified an image for avatar';
COMMENT ON COLUMN profiledata.accountnumber IS 'Numero de compte';
COMMENT ON COLUMN profiledata.bankedkey IS 'clé RIB';
COMMENT ON COLUMN profiledata.bankcode IS 'Code banque';
COMMENT ON COLUMN profiledata.gtoken IS 'Google authentification token';
COMMENT ON COLUMN profiledata.gcalid IS 'Google calendar identifier';
COMMENT ON COLUMN profiledata.gtokentype IS 'Google access token type';
COMMENT ON COLUMN profiledata.grefreshtoken IS 'Google refresh token';
COMMENT ON COLUMN profiledata.gtokenexpir IS 'Google access token expiration date';
COMMENT ON COLUMN profiledata.avatar IS 'url for an avatar'; COMMENT ON COLUMN profiledata.avatar IS 'url for an avatar';
COMMENT ON COLUMN profiledata.gregid IS 'Google Cloud Message registration identifier'; COMMENT ON COLUMN profiledata.hasavatar IS 'True when user has specified an image for avatar';
COMMENT ON COLUMN profiledata."bank.accountnumber" IS 'Numero de compte';
COMMENT ON COLUMN profiledata."bank.key" IS 'clé RIB';
COMMENT ON COLUMN profiledata."bank.code" IS 'Code banque';
COMMENT ON COLUMN profiledata."google.token" IS 'Google authentification token';
COMMENT ON COLUMN profiledata."google.refreshtoken" IS 'Google refresh token';
COMMENT ON COLUMN profiledata."google.tokentype" IS 'Google access token type';
COMMENT ON COLUMN profiledata."google.calid" IS 'Google calendar identifier';
COMMENT ON COLUMN profiledata."google.tokenexpir" IS 'Google access token expiration date';
COMMENT ON COLUMN profiledata."google.regid" IS 'Google Cloud Message registration identifier';
-- Index: fki_fkprofiles2
-- Index: fki_fkprofiles2
-- DROP INDEX fki_fkprofiles2; -- DROP INDEX fki_fkprofiles2;
@ -154,6 +155,8 @@ CREATE INDEX fki_fkprofiles2
USING btree USING btree
(uniqueid); (uniqueid);
-- Table: profiles -- Table: profiles

View File

@ -1,3 +1,13 @@
2015-09-30 Paul Schneider <paul@pschneider.fr>
* Profile.cs: Groups profile properties
* ChangeLog: Must not exist in the source tree
2015-09-30 Paul Schneider <paul@pschneider.fr>
* Profile.cs: Grouping profile properties
2015-09-23 Paul Schneider <paul@pschneider.fr> 2015-09-23 Paul Schneider <paul@pschneider.fr>
* BlogEntry.cs: * BlogEntry.cs:

View File

@ -246,16 +246,18 @@ namespace Yavsc.Model.RolesAndMembers
s = profile.GetPropertyValue ("avatar"); s = profile.GetPropertyValue ("avatar");
avatar = (s is DBNull) ? null : (string)s; avatar = (s is DBNull) ? null : (string)s;
s = profile.GetPropertyValue ("Address"); var address = profile.GetProfileGroup ("address");
s = address.GetPropertyValue ("address");
Address = (s is DBNull) ? null : (string)s; Address = (s is DBNull) ? null : (string)s;
s = profile.GetPropertyValue ("CityAndState"); s = address.GetPropertyValue ("cityandstate");
CityAndState = (s is DBNull) ? null : (string)s; CityAndState = (s is DBNull) ? null : (string)s;
s = profile.GetPropertyValue ("Country"); s = address.GetPropertyValue ("country");
Country = (s is DBNull) ? null : (string)s; Country = (s is DBNull) ? null : (string)s;
s = profile.GetPropertyValue ("ZipCode"); s = address.GetPropertyValue ("zipcode");
ZipCode = (s is DBNull) ? null : (string)s; ZipCode = (s is DBNull) ? null : (string)s;
s = profile.GetPropertyValue ("WebSite"); s = profile.GetPropertyValue ("WebSite");
@ -272,25 +274,28 @@ namespace Yavsc.Model.RolesAndMembers
userName = profile.UserName; userName = profile.UserName;
s = profile.GetPropertyValue ("BankCode"); var bank = profile.GetProfileGroup ("bank");
s = bank.GetPropertyValue ("Code");
BankCode = (s is DBNull) ? null : (string)s; BankCode = (s is DBNull) ? null : (string)s;
s = profile.GetPropertyValue ("IBAN"); s = bank.GetPropertyValue ("IBAN");
IBAN = (s is DBNull) ? null : (string)s; IBAN = (s is DBNull) ? null : (string)s;
s = profile.GetPropertyValue ("BIC"); s = bank.GetPropertyValue ("BIC");
BIC = (s is DBNull) ? null : (string)s; BIC = (s is DBNull) ? null : (string)s;
s = profile.GetPropertyValue ("WicketCode"); s = bank.GetPropertyValue ("WicketCode");
WicketCode = (s is DBNull) ? null : (string)s; WicketCode = (s is DBNull) ? null : (string)s;
s = profile.GetPropertyValue ("AccountNumber"); s = bank.GetPropertyValue ("AccountNumber");
this.AccountNumber = (s is DBNull) ? null : (string)s; this.AccountNumber = (s is DBNull) ? null : (string)s;
s = profile.GetPropertyValue ("BankedKey"); s = bank.GetPropertyValue ("Key");
BankedKey = (s == null) ? 0 : (s is DBNull)? 0 : (int)s; BankedKey = (s == null) ? 0 : (s is DBNull)? 0 : (int)s;
s = profile.GetPropertyValue ("gcalid"); var google = profile.GetProfileGroup ("google");
s = google.GetPropertyValue ("calid");
GoogleCalendar = (s is DBNull)? null : (string) s; GoogleCalendar = (s is DBNull)? null : (string) s;
} }
} }