yavsc/src/Yavsc.Org/Views/Blogspot/Index.cshtml

91 lines
2.7 KiB
Text
Raw Normal View History

2025-07-10 08:38:38 +01:00
@model IEnumerable<IBlogPost>
2019-01-01 16:28:47 +00:00
@{
2026-06-04 12:13:37 +01:00
ViewBag.Title = "Blogs, l'index";
2019-01-01 16:28:47 +00:00
}
@section header {
<style>
.collapsed {
height: 1em;
}
.sametitlegrip {
text-decoration: underline;
cursor: pointer;
}
.sametitle {
overflow: hidden;
transition: height 1s;
}
td {
transition: height 1s;
}
div.row {
border-bottom: dashed black 1px;
}
</style>
}
@section scripts {
<script>
$(document).ready(function () {
$(".sametitle").addClass("collapsed")
.on("mouseover",function(){
$(this).removeClass("collapsed")
}).on("mouseout",function(){
$(this).addClass("collapsed")
});
}
)
</script>
}
2026-06-04 12:13:37 +01:00
<h2>@ViewBag.Title</h2>
<p class="text-success">@ViewBag.StatusMessage</p>
2019-01-01 16:28:47 +00:00
@if (User.IsSignedIn()) {
<p>
2023-03-20 09:13:16 +00:00
<a asp-action="Create">Create a new article</a>
2019-01-01 16:28:47 +00:00
</p>
}
2025-02-23 20:23:23 +00:00
2025-09-14 02:42:08 +01:00
<div class="blog-index">
2025-07-10 08:38:38 +01:00
@{
int maxTextLen = 75;
foreach (var post in Model) {
2025-09-14 02:42:08 +01:00
<div class="post card">
2025-02-23 20:59:07 +00:00
2025-09-14 02:42:08 +01:00
<a asp-action="Details" asp-route-id="@post.Id" class="bloglink" >
<div class="float-left"><img class="photo card-photo" src="@post.Photo" ></div>
<h3 class="index-post-title">@post.Title</h3>
2025-07-10 08:38:38 +01:00
</a>
<div>
<a asp-action="Details" asp-route-id="@post.Id">
2026-02-22 19:59:33 +00:00
<asciidoc summary="@maxTextLen">@post.Article</asciidoc></a>
2025-07-10 08:38:38 +01:00
<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){ 
@:- Modifié le @post.DateModified.ToString("dddd d MMM yyyy à H:mm")
})
</span>
</div>
<div class="actiongroup">
@if ((await AuthorizationService.AuthorizeAsync(User, post, new ReadPermission())).Succeeded)
{
<a asp-action="Details" asp-route-id="@post.Id" class="btn btn-light">Details</a>
}
else
{
<a asp-action="Details" asp-route-id="@post.Id" class="btn btn-light">Details</a>
}
@if ((await AuthorizationService.AuthorizeAsync(User, post, new EditPermission())).Succeeded)
{
2025-07-12 19:00:30 +01:00
<a asp-action="Edit" asp-route-id="@post.Id" class="btn btn-primary">Edit</a>
2025-07-10 08:38:38 +01:00
<a asp-action="Delete" asp-route-id="@post.Id" class="btn btn-danger">Delete</a>
}
</div>
</div>
2025-02-23 20:23:23 +00:00
}
}
2025-07-10 08:38:38 +01:00
</div>
2025-02-23 20:23:23 +00:00
@if(Model.Count()==0){<p>Néant</p>}