refactoring the blog post

This commit is contained in:
Paul Schneider 2026-02-22 19:59:33 +00:00
commit ee1e49fde5
20 changed files with 40 additions and 40 deletions

View file

@ -22,7 +22,7 @@
<img class="blogphoto" alt="" src="@Model.Photo" title="Photo associée au post">
<h2 title="Titre du post" class="blogtitle" id="titleview" >@Model.Title</h2>
<div title="Contenu du post" id="contentview">@Model.Content</div>
<div title="Contenu du post" id="contentview">@Model.Article</div>
<hr>
<form asp-controller="Blogspot" asp-action="Create">
@ -49,11 +49,11 @@
</div>
<div class="form-group mdcoding">
<label asp-for="Content" class="col-md-2 control-label" ></label>
<label asp-for="Article" class="col-md-2 control-label" ></label>
<div class="col-md-10">
<textarea asp-for="Content" class="form-control" id="Content" data-from="contentview">
<textarea asp-for="Article" class="form-control" id="Article" data-from="contentview">
</textarea>
<span asp-validation-for="Content" class="text-danger" >
<span asp-validation-for="Article" class="text-danger" >
</span>
</div>
</div>

View file

@ -18,10 +18,10 @@
@Model.Author
</dd>
<dt>
@Html.DisplayNameFor(model => model.Content)
@Html.DisplayNameFor(model => model.Article)
</dt>
<dd>
@Html.DisplayFor(model => model.Content)
@Html.DisplayFor(model => model.Article)
</dd>
<dt>
@Html.DisplayNameFor(model => model.DateModified)

View file

@ -19,7 +19,7 @@
method: 'POST',
contentType: "application/json",
data: JSON.stringify({
Content: $('#Comment').val(),
Article: $('#Comment').val(),
ReceiverId: @Model.Id
}),
error: function(xhr,data) {
@ -28,7 +28,7 @@
if (xhr.responseJSON)
{
$('#commentValidation').html(
xhr.responseJSON.Content);
xhr.responseJSON.Article);
} else {
$('#commentValidation').html(
"Une erreur est survenue : "+xhr.status+"<br/>"+
@ -69,7 +69,7 @@ $('#commentValidation').html(
<h1 ismarkdown>@Model.Title</h1>
@Html.DisplayFor(m=>m.Author)
<asciidoc>@Html.DisplayFor(m=>m.Content)</asciidoc>
<asciidoc>@Html.DisplayFor(m=>m.Article)</asciidoc>
</div>
@ -91,7 +91,7 @@ $('#commentValidation').html(
/>
</span>
</div>
<span asp-validation-for="Content" class="text-danger" ></span>
<span asp-validation-for="Article" class="text-danger" ></span>
</div>
}
else {

View file

@ -80,12 +80,12 @@
</div>
</div>
<div class="form-group mdcoding">
<label asp-for="Content" class="col-md-2 control-label" ></label>
<label asp-for="Article" class="col-md-2 control-label" ></label>
<div class="col-md-10">
<textarea asp-for="Content" class="form-control"
id="Content" data-from="contentview">
<textarea asp-for="Article" class="form-control"
id="Article" data-from="contentview">
</textarea>
<span asp-validation-for="Content" class="text-danger" >
<span asp-validation-for="Article" class="text-danger" >
</span>
</div>
</div>
@ -116,7 +116,7 @@
<hr />
<div id="prev">
<asciidoc>@Model.Content</asciidoc>
<asciidoc>@Model.Article</asciidoc>
</div>
<div >

View file

@ -57,7 +57,7 @@
</a>
<div>
<a asp-action="Details" asp-route-id="@post.Id">
<asciidoc summary="@maxTextLen">@post.Content</asciidoc></a>
<asciidoc summary="@maxTextLen">@post.Article</asciidoc></a>
<span style="font-size:x-small;">@Html.DisplayFor(m => post.Author)</span>
<span style="font-size:xx-small;">
posté le @post.DateCreated.ToString("dddd d MMM yyyy à H:mm")

View file

@ -15,7 +15,7 @@
<img src="@item.Photo" class="blogphoto"></a>
</td>
<td>
<asciidoc>@((item.Content?.Length > 256) ? item.Content.Substring(0, 256) + " ..." : item.Content)</asciidoc>
<asciidoc>@((item.Article?.Length > 256) ? item.Article.Substring(0, 256) + " ..." : item.Article)</asciidoc>
<span style="font-size:x-small;">(@item.Author.UserName </span>,
<span style="font-size:xx-small;">
posté le @item.DateCreated.ToString("dddd d MMM yyyy à H:mm")

View file

@ -14,7 +14,7 @@
Author
</th>
<th>
@Html.DisplayNameFor(model => model.Content)
@Html.DisplayNameFor(model => model.Article)
</th>
<th>
@Html.DisplayNameFor(model => model.DateModified)
@ -37,7 +37,7 @@
@item.Author?.UserName
</td>
<td>
<div md-content="@item.Content"/>
<div md-content="@item.Article"/>
</td>
<td>
<table>

View file

@ -12,10 +12,10 @@
<hr />
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="Content" class="col-md-2 control-label"></label>
<label asp-for="Article" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Content" class="form-control" />
<span asp-validation-for="Content" class="text-danger" ></span>
<input asp-for="Article" class="form-control" />
<span asp-validation-for="Article" class="text-danger" ></span>
</div>
</div>
<div class="form-group">

View file

@ -12,10 +12,10 @@
<hr />
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.Content)
@Html.DisplayNameFor(model => model.Article)
</dt>
<dd>
@Html.DisplayFor(model => model.Content)
@Html.DisplayFor(model => model.Article)
</dd>
<dt>
@Html.DisplayNameFor(model => model.DateCreated)

View file

@ -11,10 +11,10 @@
<hr />
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.Content)
@Html.DisplayNameFor(model => model.Article)
</dt>
<dd>
@Html.DisplayFor(model => model.Content)
@Html.DisplayFor(model => model.Article)
</dd>
<dt>
@Html.DisplayNameFor(model => model.DateCreated)

View file

@ -13,10 +13,10 @@
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<input type="hidden" asp-for="Id" />
<div class="form-group">
<label asp-for="Content" class="col-md-2 control-label"></label>
<label asp-for="Article" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Content" class="form-control" />
<span asp-validation-for="Content" class="text-danger" ></span>
<input asp-for="Article" class="form-control" />
<span asp-validation-for="Article" class="text-danger" ></span>
</div>
</div>
<div class="form-group">

View file

@ -12,7 +12,7 @@
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.Content)
@Html.DisplayNameFor(model => model.Article)
</th>
<th>
@Html.DisplayNameFor(model => model.DateCreated)
@ -35,7 +35,7 @@
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Content)
@Html.DisplayFor(modelItem => item.Article)
</td>
<td>
@Html.DisplayFor(modelItem => item.DateCreated)

View file

@ -2,7 +2,7 @@
<div data-type="blogcomment" data-id="@Model.Id" data-receiver-id="@Model.ReceiverId" data-allow-edit="@(User.GetUserId()==Model.AuthorId?"true":"false")"
data-allow-moderate="@ViewData["moderatoFlag"]" data-date="@Model.DateCreated.ToString("yyyy-MM-dd hh:mm:ss")" data-username="@Model.Author.UserName" >
<asciidoc>@Model.Content</asciidoc>
<asciidoc>@Model.Article</asciidoc>
@if (Model.Children!=null) {
<div class="subcomments">

View file

@ -16,7 +16,7 @@
for (var i = 0; i < response.length; i++) {
var filer = response[i];
$('<p><a href="/files/@User.GetUserName()/' + filer.FileName + '">' + filer.FileName + '</a></p>').appendTo('#ql-editor-2');
updateMD('Content', $('#contentview').html());
updateMD('Article', $('#contentview').html());
}
},
url: '/api/fs'