yavsc/Yavsc/Views/Blogspot/Index.cshtml

71 lines
2.4 KiB
Text
Raw Normal View History

2017-03-11 01:06:42 +01:00
@model IEnumerable<IGrouping<string,Blog>>
2016-05-17 18:22:18 +02:00
@{
2017-03-11 01:06:42 +01:00
ViewData["Title"] = "Blogs, l'index";
2016-05-17 18:22:18 +02:00
}
2017-03-11 01:06:42 +01:00
<h2>@ViewData["Title"]</h2>
2016-05-17 18:22:18 +02:00
<p class="text-success">@ViewData["StatusMessage"]</p>
2017-02-12 23:53:53 +01:00
@if (User.IsSignedIn()) {
<label>
<input type="checkbox" id="cbv" checked/>Invisibles, posts privés</label>
2017-03-11 01:06:42 +01:00
<script>
$("#cbv").change(function() {
if (this.checked) {
$("tr.hiddenpost").removeClass("hidden");
} else {
$("tr.hiddenpost").addClass("hidden");
}
});
</script>
2016-05-17 18:22:18 +02:00
<p>
2016-07-27 11:09:49 +02:00
<a asp-action="Create">@SR["Create a new article"]</a>
2016-05-17 18:22:18 +02:00
</p>
2017-03-11 01:06:42 +01:00
}
2016-05-17 18:22:18 +02:00
<table class="table">
<tr>
2016-08-03 16:38:25 +02:00
<th colspan="3">
2017-03-11 01:06:42 +01:00
@SR["Title"]
2016-05-17 18:22:18 +02:00
</th>
</tr>
2017-03-11 01:06:42 +01:00
@foreach (var group in Model) {
var title = group.Key;
@foreach (var item in group) {
2017-03-10 16:42:57 +01:00
var trclass = (item.Visible)?"visiblepost":"hiddenpost";
<tr class="@trclass">
2017-03-10 16:42:57 +01:00
<td><a asp-action="Details" asp-route-id="@item.Id" class="bloglink">
2017-03-11 01:06:42 +01:00
<img src="@item.Photo" class="smalltofhol"></a>
<a asp-action="Title" asp-route-id="@item.Title">
<markdown>@item.Title</markdown></a>
2016-05-17 18:22:18 +02:00
</td>
<td>
2017-02-17 22:25:50 +01:00
<markdown>@((item.Content?.Length > 120) ? item.Content.Substring(0, 120) + " ..." : item.Content)</markdown>
2017-02-12 23:53:53 +01:00
<span style="font-size:x-small;">(@item.Author.UserName </span>,
2016-08-03 16:38:25 +02:00
<span style="font-size:xx-small;">
2017-01-17 14:56:53 +01:00
posté le @item.DateCreated.ToString("dddd d MMM yyyy à H:mm")
@if ((item.DateModified - item.DateCreated).Minutes > 0){ 
2017-01-17 14:56:53 +01:00
@:- Modifié le @item.DateModified.ToString("dddd d MMM yyyy à H:mm")
2017-02-12 23:53:53 +01:00
})
2016-07-29 13:16:08 +02:00
</span>
</td>
<td>
2016-05-17 18:22:18 +02:00
<ul class="actiongroup">
@if (await AuthorizationService.AuthorizeAsync(User, item, new ViewRequirement())) {
<li>
2017-03-10 16:42:57 +01:00
<a asp-action="Details" asp-route-id="@item.Id" class="btn btn-lg">Details</a>
2016-05-17 18:22:18 +02:00
</li>
}
2016-05-17 18:22:18 +02:00
@if (await AuthorizationService.AuthorizeAsync(User, item, new EditRequirement())) {
2017-03-10 16:42:57 +01:00
<li><a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-default">@SR["Edit"]</a>
2016-05-17 18:22:18 +02:00
</li>
2017-03-10 16:42:57 +01:00
<li><a asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger">@SR["Delete"]</a>
2016-05-17 18:22:18 +02:00
</li>
}
</ul>
</td>
</tr>
}
2017-03-11 01:06:42 +01:00
}
2016-05-17 18:22:18 +02:00
</table>