Blog presentation

This commit is contained in:
Paul Schneider
2024-12-03 01:44:58 +00:00
parent a4932d08f1
commit f91f000405
7 changed files with 58 additions and 52 deletions

View File

@ -1,18 +1,19 @@
@model IEnumerable<IGrouping<string,BlogPost>>
@if (User.IsSignedIn()) {
<label>
<input type="checkbox" id="_cbv" checked/>Invisibles, posts privés</label>
<script>
$("#_cbv").change(function() {
<script type="text/javascript">
$('#_cbv').change(function()
{
if (this.checked) {
$("tr.hiddenpost").removeClass("hidden");
$('tr.hiddenpost').removeClass("hidden");
} else {
$("tr.hiddenpost").addClass("hidden");
$('tr.hiddenpost').addClass("hidden");
}
});
</script>
</script>
}
<table class="table">
@ -34,7 +35,7 @@
<td>
<asciidoc summary="256">@item.Content</asciidoc>
@if (trunked) { <a asp-action="Details" asp-route-id="@item.Id" class="bloglink">...</a> }
<span style="font-size:x-small;">(@Html.DisplayFor(m => item.Author)</span>,
<span style="font-size:x-small;">@Html.DisplayFor(m => item.Author)</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){ 

View File

@ -1,14 +1,14 @@
@model ApplicationUser
@{
var avuri = "/Avatars/"+Model.UserName+".s.png";
var userPosted = Model.Posts!=null && Model.Posts.Count()>1;
var userPosted = Model.Posts!=null && Model.Posts.Count()>=1;
}
<div class="userinfo">
@if (userPosted) { <a asp-controller="Blogspot" asp-action="UserPosts"
@if (userPosted) { <a asp-controller="Blogspot" asp-action="Index"
asp-route-id="@Model.UserName" class="btn btn-primary">
<img src="@avuri" asp-append-version="true" class="smalltofhol" alt="" title="@Model.UserName"/>
<img src="@avuri" asp-append-version="true" class="smalltofhol" alt="@Model.UserName" title="@Model.UserName"/>
</a>
}else {
Html.LabelFor(m=>m.UserName);
} else {
Html.DisplayFor(m=>m.UserName);
}
</div>