yavsc/Yavsc/Views/Blogspot/Index.cshtml

62 lines
1.6 KiB
Plaintext

8 years ago
@model IEnumerable<Yavsc.Models.Blog>
@{
ViewData["Title"] = "Index";
}
<h2>Index</h2>
<p class="text-success">@ViewData["StatusMessage"]</p>
<p>
8 years ago
<a asp-action="Create">@SR["Create a new article"]</a>
</p>
<table class="table">
<tr>
<th>
8 years ago
@SR[Html.DisplayNameFor(model => model.title)]
</th>
<th>
8 years ago
@SR["Author"]
</th>
8 years ago
<th>
@SR["Date"]
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
8 years ago
@Html.DisplayFor(modelItem => item.photo)
<markdown>@item.title</markdown>
</td>
<td>
8 years ago
@item.Author.UserName
</td>
<td>
8 years ago
<span style="font-size:x-small;">
posté le @item.posted.ToString("dddd d MMM yyyy à H:mm")
@if ((item.modified - item.posted).Minutes > 10)
{ 
@:- Modifié le @item.modified.ToString("dddd d MMM yyyy à H:mm")
}
</span>
</td>
<td>
<ul class="actiongroup">
<li><a asp-action="Details" asp-route-id="@item.Id">Details</a>
</li>
@if (await AuthorizationService.AuthorizeAsync(User, item, new EditRequirement())) {
8 years ago
<li><a asp-action="Edit" asp-route-id="@item.Id">@SR["Edit"]</a>
</li>
8 years ago
<li><a asp-action="Delete" asp-route-id="@item.Id">@SR["Delete"]</a>
</li>
}
</ul>
</td>
</tr>
}
</table>