Conflicts:
	ChangeLog
	ITContentProvider/ChangeLog
	Makefile
	NpgsqlBlogProvider/ChangeLog
	NpgsqlContentProvider/ChangeLog
	NpgsqlMRPProviders/ChangeLog
	TestAPI/ChangeLog
	web/App_Themes/style.css
	web/ChangeLog
	web/Helpers/YavscHelpers.cs
	web/Models/App.master
	web/Views/Blogs/UserPosts.aspx
This commit is contained in:
Paul Schneider 2015-10-04 16:36:29 +02:00
commit 303e4fa57b
21 changed files with 143 additions and 1330 deletions

View file

@ -96,7 +96,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 {
@ -107,11 +107,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,16,0.7); }
.hiddenpost { background-color: rgba(16,16,16,0.5); }
.fullwidth { width: 100%; }
textarea.fullwidth { min-height:10em; }
@ -125,7 +125,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;
@ -147,11 +147,13 @@ content: ")";
a {
text-decoration: none;
color: #B0B080;
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;
}
@ -167,19 +169,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);
}
@ -201,7 +203,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;

File diff suppressed because it is too large Load diff

View file

@ -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) );
}

View file

@ -341,4 +341,4 @@ namespace Yavsc.Controllers
return View (model);
}
}
}
}

View file

@ -29,6 +29,7 @@ using System.Web.Mvc;
using System.Net;
using MarkdownDeep;
using Yavsc.Helpers;
using Yavsc.Model.Blogs;
namespace Yavsc.Formatters
{

View file

@ -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);
}
}
}

View file

@ -171,10 +171,9 @@ namespace Yavsc.Helpers
/// <param name="username">Username.</param>
public static string AvatarUrl (this HtmlHelper helper, string username) {
ProfileBase pr = ProfileBase.Create (username);
var avpath = 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);
}
}
}

View file

@ -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>

View file

@ -33,24 +33,23 @@
<%= 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"];
rp1.PageIndex = (int) ViewData["PageIndex"];
%>
<aside>
<yavsc:ResultPages id="rp1" Action = "?pageIndex={0}" runat="server">
<yavsc:ResultPages id="rp1" Action = "?pageIndex={0}" runat="server">
<None><i>Pas de contenu</i></None>
</yavsc:ResultPages>
</aside>
<asp:HiddenField id="user" runat="server"></asp:HiddenField>
</form>
</yavsc:ResultPages>
</form>
</aside>
</asp:Content>
</asp:Content>

View file

@ -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" />