diff --git a/src/Yavsc.Org/ViewComponents/CommentViewComponent.cs b/src/Yavsc.Org/ViewComponents/CommentViewComponent.cs index 6f85a953f..32b7a14b2 100644 --- a/src/Yavsc.Org/ViewComponents/CommentViewComponent.cs +++ b/src/Yavsc.Org/ViewComponents/CommentViewComponent.cs @@ -18,7 +18,10 @@ namespace Yavsc.ViewComponents } public async Task InvokeAsync(long id) { - var comment = await context.Comment.Include(c=>c.Children).FirstOrDefaultAsync(c => c.Id==id); + var comment = await context.Comment + .Include(c => c.Children) + .Include(c => c.Author) + .FirstOrDefaultAsync(c => c.Id==id); if (comment == null) throw new InvalidOperationException(); ViewBag.apictlr = "/api/v1/blogcomments"; diff --git a/src/Yavsc.Org/Views/Blogspot/Details.cshtml b/src/Yavsc.Org/Views/Blogspot/Details.cshtml index a78964c5e..3cf4ff9ee 100644 --- a/src/Yavsc.Org/Views/Blogspot/Details.cshtml +++ b/src/Yavsc.Org/Views/Blogspot/Details.cshtml @@ -1,102 +1,231 @@ @model BlogPost @{ - ViewBag.Title=Model.Title; + ViewBag.Title = Model.Title; } -@section scripts { - - - +@section header { } +@section scripts { + +} + +
+
+ @if (!string.IsNullOrEmpty(Model.Photo)) + { + @Model.Title + } +
+

@Model.Title

+ +
+
+ @Model.Article
- -

@Model.Title

- - @Html.DisplayFor(m=>m.Author) - @Html.DisplayFor(m=>m.Article) -
- @if (Model.Comments!=null) { - foreach (var comment in Model.Comments.Where(c=>c.ParentId==null)) { + @if (Model.Comments != null) + { + foreach (var comment in Model.Comments.Where(c => c.ParentId == null)) + { @await Component.InvokeAsync("Comment", new { id = comment.Id }) } }
-@if (User.GetUserId()!=null) { -
-
- - - - - + + @if (User.GetUserId() != null) + { +
+
+ + + + + +
- -
} - else { -

Vous devez être identifié pour commenter.

+ else + { +

Vous devez être identifié pour commenter.

} Back to List - +
\ No newline at end of file diff --git a/src/Yavsc.Org/Views/Shared/Components/Comment/Default.cshtml b/src/Yavsc.Org/Views/Shared/Components/Comment/Default.cshtml index 4d9344eba..e83ea14c6 100644 --- a/src/Yavsc.Org/Views/Shared/Components/Comment/Default.cshtml +++ b/src/Yavsc.Org/Views/Shared/Components/Comment/Default.cshtml @@ -1,16 +1,30 @@ @model Comment -
+
+
@Model.Article - - @if (Model.Children!=null) { -
- @foreach (var comment in Model.Children) - { - @await this.Component.InvokeAsync("Comment", new { id = comment.Id}); - }
-} -
- + + — @(Model.Author?.UserName ?? "Anonyme"), + posté le @Model.DateCreated.ToString("dddd d MMM yyyy à H:mm") + + @if (User.GetUserId() != null) + { + + } +
+ @if (Model.Children != null) + { + foreach (var comment in Model.Children) + { + @await this.Component.InvokeAsync("Comment", new { id = comment.Id }) + } + } +
+
\ No newline at end of file