build
Some checks failed
Dotnet build and test / log-the-inputs (pull_request) Has been cancelled
Dotnet build and test / build (pull_request) Has been cancelled

This commit is contained in:
Paul Schneider 2026-08-03 02:16:57 +01:00
commit 7d1cca9df0
No known key found for this signature in database
GPG key ID: 1E66C65EE2B46F1B
4 changed files with 17 additions and 13 deletions

View file

@ -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

View file

@ -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;

View file

@ -1,3 +1,4 @@
@model IEnumerable<IBlogPost> @model IEnumerable<IBlogPost>
@{ @{
ViewBag.Title = "Blogs, l'index"; ViewBag.Title = "Blogs, l'index";
@ -43,20 +44,20 @@
<a asp-action="Create">Create a new article</a> <a asp-action="Create">Create a new article</a>
</p> </p>
} }
<div class="blog-index"> <div class="blog-index">
@{ @{
int maxTextLen = 75; int maxTextLen = 75;
foreach (var post in Model) { foreach (var post in Model) {
<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;">
@ -67,20 +68,20 @@
</span> </span>
</div> </div>
<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>
</div> </div>

View file

@ -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;