bug fixes
* Makefile: my deploy config * NpgsqlMembershipProvider.cs: Fixes a Bug introduced by Npgsql driver upgrade * ResultPages.cs: . * style.css: other colors * BlogsController.cs: code cleaning * GoogleController.cs: refactoring * ErrorHtmlFormatter.cs: MarkdownDeep calls now come from yavscModel * YavscHelpers.cs: xmldoc * Index.aspx: code formatting * UserPosts.aspx: nothing to note * Web.csproj: MarkdownHelper has gone to the yavscModel project * MarkdownHelper.cs: * BlogEntryCollection.cs: refactoring + extract an intro from Markdown for PostInfo* * YavscModel.csproj: MarkdownHelper integration
This commit is contained in:
parent
bdae927f67
commit
ce1689df7b
19 changed files with 193 additions and 129 deletions
|
|
@ -4,7 +4,7 @@ body {
|
|||
background-color: black;
|
||||
color: #D0FFD0;
|
||||
font-family: 'Arial', cursive;
|
||||
padding: 0em;
|
||||
padding: 2em;
|
||||
}
|
||||
|
||||
.iconsmall { max-height: 1.3em; max-width: 1.3em; }
|
||||
|
|
@ -20,7 +20,7 @@ header {
|
|||
margin: 1em;
|
||||
padding: 3em;
|
||||
min-height: 10em;
|
||||
background: url("/images/star-939235_1280.jpg") 0 0 no-repeat fixed;
|
||||
background: url("/images/star-939235_1280.jpg") 0 0 no-repeat fixed;
|
||||
}
|
||||
|
||||
nav {
|
||||
|
|
@ -88,7 +88,7 @@ aside {
|
|||
max-width: 40em;
|
||||
padding: .5em;
|
||||
margin: .5em;
|
||||
background-color: rgba(32,32,64,0.8);
|
||||
background-color: rgba(32,32,32,0.8);
|
||||
border-radius:10px;
|
||||
}
|
||||
.postpreview video, .postpreview img {
|
||||
|
|
@ -99,11 +99,11 @@ aside {
|
|||
display:block;
|
||||
margin:1em;
|
||||
padding:1em;
|
||||
background-color: rgba(32,32,64,0.8);
|
||||
background-color: rgba(32,32,32,0.8);
|
||||
color: #aaa;
|
||||
border-radius:10px;
|
||||
}
|
||||
.hiddenpost { background-color: rgba(16,16,0,0.3); }
|
||||
.hiddenpost { background-color: rgba(16,16,16,0.5); }
|
||||
.fullwidth { width: 100%; }
|
||||
|
||||
textarea.fullwidth { min-height:10em; }
|
||||
|
|
@ -117,7 +117,7 @@ textarea.fullwidth { min-height:10em; }
|
|||
}
|
||||
|
||||
.panel,.bshpanel, aside {
|
||||
background-color: rgba(32,16,16,0.8);
|
||||
background-color: rgba(32,32,16,0.8);
|
||||
border-radius:5px;
|
||||
margin:.5em;
|
||||
padding: .5em;
|
||||
|
|
@ -139,13 +139,13 @@ content: ")";
|
|||
a {
|
||||
text-decoration: none;
|
||||
color: #B0B080;
|
||||
background-color:rgba(20,0,20,0.5);
|
||||
background-color:rgba(20,20,20,0.5);
|
||||
text-decoration: none;
|
||||
}
|
||||
.usertitleref {
|
||||
color: #B0B080;
|
||||
border-radius: 5px;
|
||||
background-color:rgba(0,0,32,0.8);
|
||||
background-color:rgba(0,0,32,0.6);
|
||||
font-family: 'Arial', cursive;
|
||||
padding: 1em;
|
||||
}
|
||||
|
|
@ -161,19 +161,19 @@ label {
|
|||
|
||||
.message, #message {
|
||||
font-size: large;
|
||||
background-color: rgba(0,64,0,0.1);
|
||||
background-color: rgba(64,64,0,0.5);
|
||||
}
|
||||
.dirty {
|
||||
background-color: rgba(128,128,0,0.3);
|
||||
background-color: rgba(128,128,0,0.5);
|
||||
}
|
||||
.error, #error {
|
||||
color: #f88;
|
||||
font-size: large;
|
||||
background-color: rgba(128,0,0,0.3);
|
||||
background-color: rgba(256,0,0,0.5);
|
||||
}
|
||||
.validation-summary-errors{
|
||||
color: #f88;
|
||||
background-color: rgba(64,0,0,0.3);
|
||||
background-color: rgba(256,0,0,0.5);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ ul.preview li:nth-child(n) {
|
|||
.actionlink {
|
||||
color: #B0B080;
|
||||
border-radius: 5px;
|
||||
background-color:rgba(0,0,32,0.8);
|
||||
background-color:rgba(0,0,32,0.5);
|
||||
cursor: pointer;
|
||||
font-family: 'Arial', cursive;
|
||||
padding: .2em;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,23 @@
|
|||
2015-10-04 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* style.css: other colors
|
||||
|
||||
* BlogsController.cs: code cleaning
|
||||
|
||||
* GoogleController.cs: refactoring
|
||||
|
||||
* ErrorHtmlFormatter.cs: MarkdownDeep calls now come from
|
||||
yavscModel
|
||||
|
||||
* YavscHelpers.cs: xmldoc
|
||||
|
||||
* Index.aspx: code formatting
|
||||
|
||||
* UserPosts.aspx: nothing to note
|
||||
|
||||
* Web.csproj: MarkdownHelper has gone to the yavscModel
|
||||
project
|
||||
|
||||
2015-10-02 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* style.css: yauniformisation small & large screens.
|
||||
|
|
|
|||
|
|
@ -82,11 +82,10 @@ namespace Yavsc.Controllers
|
|||
/// <param name="pageSize">Page size.</param>
|
||||
public ActionResult BlogList (int pageIndex = 0, int pageSize = 10)
|
||||
{
|
||||
ViewData ["SiteName"] = sitename;
|
||||
int totalRecords;
|
||||
var bs = BlogManager.LastPosts (pageIndex, pageSize, out totalRecords);
|
||||
ViewData ["RecordCount"] = totalRecords;
|
||||
ViewData ["pageSize"] = pageSize;
|
||||
ViewData ["ResultCount"] = totalRecords;
|
||||
ViewData ["PageSize"] = pageSize;
|
||||
ViewData ["PageIndex"] = pageIndex;
|
||||
return View ("Index", new BlogEntryCollection(bs) );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ namespace Yavsc.Controllers
|
|||
HttpContext.Profile.SetPropertyValue ("Name", me.displayName);
|
||||
// TODO use image
|
||||
if (me.image != null) {
|
||||
HttpContext.Profile.SetPropertyValue ("avatar", me.image.url);
|
||||
HttpContext.Profile.SetPropertyValue ("Avatar", me.image.url);
|
||||
}
|
||||
if (me.placesLived != null) {
|
||||
People.Place pplace = me.placesLived.Where (x => x.primary).First ();
|
||||
|
|
@ -341,4 +341,4 @@ namespace Yavsc.Controllers
|
|||
return View (model);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ using System.Web.Mvc;
|
|||
using System.Net;
|
||||
using MarkdownDeep;
|
||||
using Yavsc.Helpers;
|
||||
using Yavsc.Model.Blogs;
|
||||
|
||||
namespace Yavsc.Formatters
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,82 +0,0 @@
|
|||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using MarkdownDeep;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper class for transforming Markdown.
|
||||
/// </summary>
|
||||
public static partial class MarkdownHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Transforms a string of Markdown into HTML.
|
||||
/// </summary>
|
||||
/// <param name="text">The Markdown that should be transformed.</param>
|
||||
/// <returns>The HTML representation of the supplied Markdown.</returns>
|
||||
public static IHtmlString Markdown(string text)
|
||||
{
|
||||
// Transform the supplied text (Markdown) into HTML.
|
||||
var markdownTransformer = new Markdown();
|
||||
markdownTransformer.ExtraMode = true;
|
||||
string html = markdownTransformer.Transform(text);
|
||||
|
||||
// Wrap the html in an MvcHtmlString otherwise it'll be HtmlEncoded and displayed to the user as HTML :(
|
||||
return new MvcHtmlString(html);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Transforms a string of Markdown into HTML.
|
||||
/// </summary>
|
||||
/// <param name="helper">HtmlHelper - Not used, but required to make this an extension method.</param>
|
||||
/// <param name="text">The Markdown that should be transformed.</param>
|
||||
/// <param name="urlBaseLocation">The url Base Location.</param>
|
||||
/// <returns>The HTML representation of the supplied Markdown.</returns>
|
||||
public static IHtmlString Markdown(this HtmlHelper helper, string text, string urlBaseLocation="")
|
||||
{
|
||||
// Transform the supplied text (Markdown) into HTML.
|
||||
var markdownTransformer = new Markdown();
|
||||
markdownTransformer.ExtraMode = true;
|
||||
markdownTransformer.UrlBaseLocation = urlBaseLocation;
|
||||
string html = markdownTransformer.Transform(text);
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transforms a string of Markdown into HTML.
|
||||
/// </summary>
|
||||
/// <param name="helper">HtmlHelper - Not used, but required to make this an extension method.</param>
|
||||
/// <param name="text">The Markdown that should be transformed.</param>
|
||||
/// <returns>The HTML representation of the supplied Markdown.</returns>
|
||||
public static IHtmlString Markdown(this HtmlHelper helper, string text)
|
||||
{
|
||||
// Just call the other one, to avoid having two copies (we don't use the HtmlHelper).
|
||||
return Markdown(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -163,13 +163,17 @@ namespace Yavsc.Helpers
|
|||
foreach (MembershipUser u in users)
|
||||
YavscHelpers.SendActivationMessage (u);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Avatars the URL.
|
||||
/// </summary>
|
||||
/// <returns>The URL.</returns>
|
||||
/// <param name="helper">Helper.</param>
|
||||
/// <param name="username">Username.</param>
|
||||
public static string AvatarUrl (this HtmlHelper helper, string username) {
|
||||
ProfileBase pr = ProfileBase.Create (username);
|
||||
string avpath = (string ) pr.GetPropertyValue("Avatar") ;
|
||||
if (avpath != null)
|
||||
return helper.Encode (avpath);
|
||||
return "/avatars/" + helper.Encode(username)+".png";
|
||||
var a = pr.GetPropertyValue("Avatar") ;
|
||||
if (a == null || a is DBNull) return "/avatars/" + helper.Encode(username)+".png";
|
||||
return helper.Encode ((string)a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<div class="postpreview">
|
||||
<%= Html.ActionLink(p.Title, "UserPost",
|
||||
new { user = g.Key, title = p.Title }, new { @class = "usertitleref" } ) %>
|
||||
|
||||
<p><%= Html.Markdown(p.Intro,"/bfiles/"+p.Id+"/") %></p>
|
||||
<aside>
|
||||
(Posté le <%=p.Posted.ToString("D") %>)
|
||||
|
||||
|
|
@ -24,14 +24,15 @@
|
|||
</div> <% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<form runat="server" id="form1" method="GET">
|
||||
<% rp1.ResultCount = Model.Count; rp1.ResultsPerPage = 50; %>
|
||||
<% rp1.CurrentPage = (int) ViewData["PageIndex"]; %>
|
||||
<% rp1.None = Html.Translate("no content"); %>
|
||||
<yavsc:ResultPages id="rp1" Action = "?pageIndex={0}" runat="server" >
|
||||
<form runat="server" id="form1" method="GET">
|
||||
<% rp1.ResultCount = (int) ViewData["ResultCount"];
|
||||
rp1.PageSize = (int) ViewData ["PageSize"];
|
||||
rp1.PageIndex = (int) ViewData["PageIndex"];
|
||||
rp1.None = Html.Translate("no content");
|
||||
%>
|
||||
<yavsc:ResultPages id="rp1" runat="server" >
|
||||
<None>Aucun résultat</None>
|
||||
</yavsc:ResultPages>
|
||||
|
||||
</form>
|
||||
</form>
|
||||
</asp:Content>
|
||||
|
||||
|
|
|
|||
|
|
@ -33,22 +33,19 @@
|
|||
<%= Html.ActionLink("Editer","Edit", new { id = e.Id }, new { @class="actionlink" }) %>
|
||||
<%= Html.ActionLink("Supprimer","RemovePost", new { id = e.Id }, new { @class="actionlink" } ) %>
|
||||
<% } %>
|
||||
</aside>
|
||||
|
||||
|
||||
</aside>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<form runat="server" id="form1" method="GET">
|
||||
<aside>
|
||||
<form runat="server" id="form1" method="GET">
|
||||
<%
|
||||
rp1.ResultCount = (int) ViewData["RecordCount"];
|
||||
rp1.CurrentPage = (int) ViewData["PageIndex"];
|
||||
user.Value = (string) ViewData["BlogUser"];
|
||||
|
||||
%>
|
||||
<aside>
|
||||
<yavsc:ResultPages id="rp1" Action = "?pageIndex={0}" runat="server"></yavsc:ResultPages>
|
||||
</aside>
|
||||
<asp:HiddenField id="user" runat="server"></asp:HiddenField>
|
||||
</form>
|
||||
rp1.PageIndex = (int) ViewData["PageIndex"];
|
||||
%><yavsc:ResultPages id="rp1" Action = "?pageIndex={0}" runat="server"></yavsc:ResultPages>
|
||||
</form>
|
||||
</aside>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
|
|
@ -188,7 +188,6 @@
|
|||
<Compile Include="IValueProvider.cs" />
|
||||
<Compile Include="Formatters\EstimToPdfFormatter.MSAN.cs" />
|
||||
<Compile Include="Helpers\TemplateException.cs" />
|
||||
<Compile Include="Helpers\MarkdownHelper.cs" />
|
||||
<Compile Include="Formatters\FormatterException.cs" />
|
||||
<Compile Include="NUnitTestClass.cs" />
|
||||
<Compile Include="TestExec.cs" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue