Blog Post Id
This commit is contained in:
parent
c450bd7ff8
commit
67da921bce
22 changed files with 4869 additions and 96 deletions
|
|
@ -3,7 +3,7 @@
|
|||
ViewBag.Title=Model.Title;
|
||||
}
|
||||
@section scripts {
|
||||
|
||||
|
||||
<script src="~/js/comment.js" asp-append-version="true"></script>
|
||||
<script>
|
||||
$.psc.blogcomment.prototype.options.lang = '@System.Globalization.CultureInfo.CurrentUICulture.Name';
|
||||
|
|
@ -18,8 +18,8 @@
|
|||
type: 'POST',
|
||||
method: 'POST',
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify({
|
||||
Article: $('#Comment').val(),
|
||||
data: JSON.stringify({
|
||||
Article: $('#Comment').val(),
|
||||
ReceiverId: @Model.Id
|
||||
}),
|
||||
error: function(xhr,data) {
|
||||
|
|
@ -36,7 +36,7 @@ $('#commentValidation').html(
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
success: function (data) {
|
||||
var comment = $('#Comment').val();
|
||||
|
|
@ -65,12 +65,12 @@ $('#commentValidation').html(
|
|||
<div class="float-left">
|
||||
<img class="photo" src="@Model.Photo" >
|
||||
</div>
|
||||
|
||||
|
||||
<h1 ismarkdown>@Model.Title</h1>
|
||||
|
||||
|
||||
@Html.DisplayFor(m=>m.Author)
|
||||
<asciidoc>@Html.DisplayFor(m=>m.Article)</asciidoc>
|
||||
|
||||
<markdown>@Html.DisplayFor(m=>m.Article)</markdown>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="comments">
|
||||
|
|
@ -89,7 +89,7 @@ $('#commentValidation').html(
|
|||
<input type="button" value="Comment" class="btn btn-secondary"
|
||||
data-receiverId="@Model.Id" id="cmtBtn"
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<span asp-validation-for="Article" class="text-danger" ></span>
|
||||
</div>
|
||||
|
|
@ -97,7 +97,7 @@ $('#commentValidation').html(
|
|||
else {
|
||||
<p><i>Vous devez être identifié pour commenter.</i> </p>
|
||||
}
|
||||
|
||||
|
||||
@if ((await AuthorizationService.AuthorizeAsync(User, Model, new EditPermission())).Succeeded) {
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-link">Edit</a>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,11 +58,11 @@
|
|||
</a>
|
||||
<div>
|
||||
<a asp-action="Details" asp-route-id="@post.Id">
|
||||
<asciidoc summary="@maxTextLen">@post.Article</asciidoc></a>
|
||||
<markdown summary="@maxTextLen">@post.Article</markdown></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")
|
||||
@if ((post.DateModified - post.DateCreated).Minutes > 0){
|
||||
@if ((post.DateModified - post.DateCreated).Minutes > 0){
|
||||
@:- Modifié le @post.DateModified.ToString("dddd d MMM yyyy à H:mm")
|
||||
}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -8,23 +8,23 @@
|
|||
</p>
|
||||
|
||||
<table class="table">
|
||||
|
||||
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td><a asp-action="Details" asp-route-id="@item.Id" class="bloglink">
|
||||
<img src="@item.Photo" class="blogphoto"></a>
|
||||
</td>
|
||||
<td>
|
||||
<asciidoc>@((item.Article?.Length > 256) ? item.Article.Substring(0, 256) + " ..." : item.Article)</asciidoc>
|
||||
<markdown>@((item.Article?.Length > 256) ? item.Article.Substring(0, 256) + " ..." : item.Article)</markdown>
|
||||
<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")
|
||||
@if ((item.DateModified - item.DateCreated).Minutes > 0){
|
||||
@if ((item.DateModified - item.DateCreated).Minutes > 0){
|
||||
@:- Modifié le @item.DateModified.ToString("dddd d MMM yyyy à H:mm")
|
||||
})
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<td>
|
||||
<ul class="actiongroup">
|
||||
@if ((await AuthorizationService.AuthorizeAsync(User, item, new ReadPermission())).Succeeded) {
|
||||
<li>
|
||||
|
|
|
|||
Loading…
Reference in a new issue