blog mef
This commit is contained in:
parent
0af12186e7
commit
c6acf07c09
26 changed files with 183 additions and 72 deletions
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<h2>Create</h2>
|
||||
|
||||
<form asp-action="Create" role="form">
|
||||
<form asp-action="Create" role="form" method="POST">
|
||||
<div class="form-horizontal">
|
||||
<h4>Blog</h4>
|
||||
<hr />
|
||||
|
|
|
|||
|
|
@ -1,41 +1,41 @@
|
|||
@model IEnumerable<Blog>
|
||||
@model IEnumerable<IGrouping<string,Blog>>
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
ViewData["Title"] = "Blogs, l'index";
|
||||
}
|
||||
|
||||
<h2>Index</h2>
|
||||
<h2>@ViewData["Title"]</h2>
|
||||
<p class="text-success">@ViewData["StatusMessage"]</p>
|
||||
@if (User.IsSignedIn()) {
|
||||
|
||||
<label>
|
||||
<input type="checkbox" id="cbv" checked/>Invisibles, posts privés</label>
|
||||
<script>
|
||||
$("#cbv").change(function() {
|
||||
if (this.checked) {
|
||||
$("tr.hiddenpost").removeClass("hidden");
|
||||
} else {
|
||||
$("tr.hiddenpost").addClass("hidden");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
}
|
||||
<script>
|
||||
$("#cbv").change(function() {
|
||||
if (this.checked) {
|
||||
$("tr.hiddenpost").removeClass("hidden");
|
||||
} else {
|
||||
$("tr.hiddenpost").addClass("hidden");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<p>
|
||||
<a asp-action="Create">@SR["Create a new article"]</a>
|
||||
</p>
|
||||
|
||||
}
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th colspan="3">
|
||||
@SR[Html.DisplayNameFor(model => model.Title)]
|
||||
@SR["Title"]
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
@foreach (var item in Model) {
|
||||
@foreach (var group in Model) {
|
||||
var title = group.Key;
|
||||
@foreach (var item in group) {
|
||||
var trclass = (item.Visible)?"visiblepost":"hiddenpost";
|
||||
|
||||
<tr class="@trclass">
|
||||
<td><a asp-action="Details" asp-route-id="@item.Id" class="bloglink">
|
||||
<img src="@item.Photo" class="smalltofhol">
|
||||
<img src="@item.Photo" class="smalltofhol"></a>
|
||||
<a asp-action="Title" asp-route-id="@item.Title">
|
||||
<markdown>@item.Title</markdown></a>
|
||||
</td>
|
||||
<td>
|
||||
|
|
@ -65,6 +65,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
</table>
|
||||
|
||||
|
||||
|
|
|
|||
61
Yavsc/Views/Blogspot/Title.cshtml
Normal file
61
Yavsc/Views/Blogspot/Title.cshtml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
@model IEnumerable<Blog>
|
||||
|
||||
<h2 markdown="@ViewData["Title"]"></h2>
|
||||
<p class="text-success">@ViewData["StatusMessage"]</p>
|
||||
@if (User.IsSignedIn()) {
|
||||
|
||||
<label>
|
||||
<input type="checkbox" id="cbv" checked/>Invisibles, posts privés</label>
|
||||
<script>
|
||||
$("#cbv").change(function() {
|
||||
if (this.checked) {
|
||||
$("tr.hiddenpost").removeClass("hidden");
|
||||
} else {
|
||||
$("tr.hiddenpost").addClass("hidden");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
}
|
||||
<p>
|
||||
<a asp-action="Create" asp-route-title="@ViewData["Title"]">@SR["Poster au même titre"]</a>
|
||||
</p>
|
||||
|
||||
<table class="table">
|
||||
|
||||
@foreach (var item in Model) {
|
||||
var trclass = (item.Visible)?"visiblepost":"hiddenpost";
|
||||
|
||||
<tr class="@trclass">
|
||||
<td><a asp-action="Details" asp-route-id="@item.Id" class="bloglink">
|
||||
<img src="@item.Photo" class="smalltofhol"></a>
|
||||
</td>
|
||||
<td>
|
||||
<markdown>@((item.Content?.Length > 120) ? item.Content.Substring(0, 122) + " ..." : item.Content)</markdown>
|
||||
<span style="font-size:x-small;">(@item.Author.UserName </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){
|
||||
@:- Modifié le @item.DateModified.ToString("dddd d MMM yyyy à H:mm")
|
||||
})
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<ul class="actiongroup">
|
||||
@if (await AuthorizationService.AuthorizeAsync(User, item, new ViewRequirement())) {
|
||||
<li>
|
||||
<a asp-action="Details" asp-route-id="@item.Id" class="btn btn-lg">Details</a>
|
||||
</li>
|
||||
}
|
||||
@if (await AuthorizationService.AuthorizeAsync(User, item, new EditRequirement())) {
|
||||
<li><a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-default">@SR["Edit"]</a>
|
||||
</li>
|
||||
<li><a asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger">@SR["Delete"]</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue