commit
42ad1b623d
4 changed files with 17 additions and 13 deletions
|
|
@ -7,6 +7,7 @@ using Yavsc.Models.Blog;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using Yavsc.Server.Exceptions;
|
using Yavsc.Server.Exceptions;
|
||||||
using Yavsc.Server.Helpers;
|
using Yavsc.Server.Helpers;
|
||||||
|
using Yavsc.Blogspot;
|
||||||
|
|
||||||
// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
|
// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using System.Security.Claims;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Yavsc;
|
using Yavsc;
|
||||||
|
using Yavsc.Blogspot;
|
||||||
using Yavsc.Models;
|
using Yavsc.Models;
|
||||||
using Yavsc.Models.Blog;
|
using Yavsc.Models.Blog;
|
||||||
using Yavsc.Server.Exceptions;
|
using Yavsc.Server.Exceptions;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
@model IEnumerable<IBlogPost>
|
@model IEnumerable<IBlogPost>
|
||||||
@{
|
@{
|
||||||
ViewBag.Title = "Blogs, l'index";
|
ViewBag.Title = "Blogs, l'index";
|
||||||
|
|
@ -51,12 +52,12 @@
|
||||||
<div class="post card">
|
<div class="post card">
|
||||||
|
|
||||||
|
|
||||||
<a asp-action="Details" asp-route-id="@post.Id" class="bloglink" >
|
<a asp-action="Details" asp-route-id="@((IBlogPost)post).Id" class="bloglink" >
|
||||||
<div class="float-left"><img class="photo card-photo" src="@post.Photo" ></div>
|
<div class="float-left"><img class="photo card-photo" src="@post.Photo" ></div>
|
||||||
<h3 class="index-post-title">@post.Title</h3>
|
<h3 class="index-post-title">@post.Title</h3>
|
||||||
</a>
|
</a>
|
||||||
<div>
|
<div>
|
||||||
<a asp-action="Details" asp-route-id="@post.Id">
|
<a asp-action="Details" asp-route-id="@((IBlogPost)post).Id">
|
||||||
<asciidoc summary="@maxTextLen">@post.Article</asciidoc></a>
|
<asciidoc summary="@maxTextLen">@post.Article</asciidoc></a>
|
||||||
<span style="font-size:x-small;">@Html.DisplayFor(m => post.Author)</span>
|
<span style="font-size:x-small;">@Html.DisplayFor(m => post.Author)</span>
|
||||||
<span style="font-size:xx-small;">
|
<span style="font-size:xx-small;">
|
||||||
|
|
@ -69,17 +70,17 @@
|
||||||
<div class="actiongroup">
|
<div class="actiongroup">
|
||||||
@if ((await AuthorizationService.AuthorizeAsync(User, post, new ReadPermission())).Succeeded)
|
@if ((await AuthorizationService.AuthorizeAsync(User, post, new ReadPermission())).Succeeded)
|
||||||
{
|
{
|
||||||
<a asp-action="Details" asp-route-id="@post.Id" class="btn btn-light">Details</a>
|
<a asp-action="Details" asp-route-id="@((IBlogPost)post).Id" class="btn btn-light">Details</a>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<a asp-action="Details" asp-route-id="@post.Id" class="btn btn-light">Details</a>
|
<a asp-action="Details" asp-route-id="@((IBlogPost)post).Id" class="btn btn-light">Details</a>
|
||||||
}
|
}
|
||||||
@if ((await AuthorizationService.AuthorizeAsync(User, post, new EditPermission())).Succeeded)
|
@if ((await AuthorizationService.AuthorizeAsync(User, post, new EditPermission())).Succeeded)
|
||||||
{
|
{
|
||||||
<a asp-action="Edit" asp-route-id="@post.Id" class="btn btn-primary">Edit</a>
|
<a asp-action="Edit" asp-route-id="@((IBlogPost)post).Id" class="btn btn-primary">Edit</a>
|
||||||
|
|
||||||
<a asp-action="Delete" asp-route-id="@post.Id" class="btn btn-danger">Delete</a>
|
<a asp-action="Delete" asp-route-id="@((IBlogPost)post).Id" class="btn btn-danger">Delete</a>
|
||||||
|
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
@using Microsoft.AspNetCore.Mvc.Localization
|
@using Microsoft.AspNetCore.Mvc.Localization
|
||||||
@using Yavsc
|
@using Yavsc
|
||||||
|
@using Yavsc.Blogspot
|
||||||
@using Yavsc.Models
|
@using Yavsc.Models
|
||||||
@using Yavsc.Models.Musical;
|
@using Yavsc.Models.Musical;
|
||||||
@using Yavsc.Models.Drawing;
|
@using Yavsc.Models.Drawing;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue