From f3a63c9e46430b3cc42be9480b51b13c3d27742a Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 10 Nov 2024 23:12:02 +0000 Subject: [PATCH] bug fixes --- src/Yavsc.Server/Models/Blog/BlogPost.cs | 20 +-- src/Yavsc.Server/Models/Blog/BlogTrad.cs | 26 ---- .../ViewModels/BlogPostInputViewModel.cs | 26 ++++ .../Relationship/CirclesViewModel.cs | 3 +- .../Blogspot/FileSystemApiController.cs | 2 +- .../Accounting/AccountController.cs | 14 +- .../Communicating/AnnouncesController.cs | 2 +- .../Communicating/BlogspotController.cs | 30 ++-- src/Yavsc/Extensions/HostingExtensions.cs | 6 + src/Yavsc/Extensions/PermissionHandler.cs | 46 ++++++ src/Yavsc/Helpers/AsciiDocHelpers.cs | 13 +- src/Yavsc/Models/ApplicationDbContext.cs | 4 - .../CirclesControlViewComponent.cs | 4 + src/Yavsc/ViewModels/Auth/EditRequirement.cs | 19 ++- src/Yavsc/Views/Blogspot/Create.cshtml | 85 +++++++++++ src/Yavsc/Views/Blogspot/Details.cshtml | 2 +- src/Yavsc/Views/Blogspot/Edit.cshtml | 135 +----------------- src/Yavsc/Views/Blogspot/Title.cshtml | 2 +- .../Components/BlogIndex/Default.cshtml | 2 +- .../Components/CirclesControl/Default.cshtml | 4 +- src/Yavsc/Views/Shared/Error.cshtml | 2 +- src/Yavsc/Views/Shared/_Layout.cshtml | 3 +- src/Yavsc/Views/Shared/_LoginPartial.cshtml | 4 +- src/Yavsc/Views/Shared/_Nav.cshtml | 2 +- .../site.scssc | Bin 5479 -> 9265 bytes src/Yavsc/wwwroot/css/site.css | 16 +-- src/Yavsc/wwwroot/css/site.scss | 19 +-- test/yavscTests/Startup.cs | 4 +- 28 files changed, 261 insertions(+), 234 deletions(-) delete mode 100644 src/Yavsc.Server/Models/Blog/BlogTrad.cs create mode 100644 src/Yavsc.Server/ViewModels/BlogPostInputViewModel.cs create mode 100644 src/Yavsc/Extensions/PermissionHandler.cs create mode 100644 src/Yavsc/Views/Blogspot/Create.cshtml diff --git a/src/Yavsc.Server/Models/Blog/BlogPost.cs b/src/Yavsc.Server/Models/Blog/BlogPost.cs index 423dc1e3..f5d55d21 100644 --- a/src/Yavsc.Server/Models/Blog/BlogPost.cs +++ b/src/Yavsc.Server/Models/Blog/BlogPost.cs @@ -10,29 +10,19 @@ using Yavsc.Attributes.Validation; using Yavsc.Interfaces; using Yavsc.Models.Access; using Yavsc.Models.Relationship; +using Yavsc.ViewModels.Blog; namespace Yavsc.Models.Blog { - public class BlogPost : IBlogPost, ICircleAuthorized, ITaggable, IIdentified + public class BlogPost : BlogPostInputViewModel, IBlogPost, ICircleAuthorized, ITaggable, IIdentified { [Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Display(Name="Identifiant du post")] public long Id { get; set; } - [Display(Name="Contenu")][YaStringLength(56224)] - public string Content { get; set; } - - [Display(Name="Photo")][YaStringLength(1024)] - public string Photo { get; set; } - - [YaStringLength(8)] - public string Lang { get; set; } - [Display(Name="Indice de qualité")] public int Rate { get; set; } - [Display(Name="Titre")][YaStringLength(1024)] - public string Title { get; set; } [Display(Name="Identifiant de l'auteur")] [ForeignKey("Author")] @@ -41,8 +31,6 @@ namespace Yavsc.Models.Blog [Display(Name="Auteur")] public virtual ApplicationUser Author { set; get; } - [Display(Name="Visible")] - public bool Visible { get; set; } [Display(Name="Date de création")] public DateTime DateCreated @@ -68,10 +56,6 @@ namespace Yavsc.Models.Blog get; set; } - [InverseProperty("Target")] - [Display(Name="Liste de contrôle d'accès")] - public virtual List ACL { get; set; } - public bool AuthorizeCircle(long circleId) { return ACL?.Any( i=>i.CircleId == circleId) ?? true; diff --git a/src/Yavsc.Server/Models/Blog/BlogTrad.cs b/src/Yavsc.Server/Models/Blog/BlogTrad.cs deleted file mode 100644 index 1a9e2777..00000000 --- a/src/Yavsc.Server/Models/Blog/BlogTrad.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Newtonsoft.Json; -using Yavsc.Models; - -namespace Yavsc.Server.Models.Blog -{ - public class BlogTrad - { - [Required] - public long PostId { get; set; } - - [Required] - public string Lang { get; set; } - - public string Title { get; set; } - - public string Body { get; set; } - - public string TraducerId { get; set; } - - [ForeignKey("TraducerId"),JsonIgnore] - public ApplicationUser Traducer { set; get; } - - } -} \ No newline at end of file diff --git a/src/Yavsc.Server/ViewModels/BlogPostInputViewModel.cs b/src/Yavsc.Server/ViewModels/BlogPostInputViewModel.cs new file mode 100644 index 00000000..20a25573 --- /dev/null +++ b/src/Yavsc.Server/ViewModels/BlogPostInputViewModel.cs @@ -0,0 +1,26 @@ + +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Yavsc.Models.Access; + +namespace Yavsc.ViewModels.Blog +{ + public class BlogPostInputViewModel +{ + [StringLength(1024)] + public string? Photo { get; set; } + + [StringLength(1024)] + public required string Title { get; set; } + + [StringLength(56224)] + public required string Content { get; set; } + + public bool Visible { get; set; } + + [InverseProperty("Target")] + [Display(Name="Liste de contrôle d'accès")] + public virtual List? ACL { get; set; } + + } +} diff --git a/src/Yavsc.Server/ViewModels/Relationship/CirclesViewModel.cs b/src/Yavsc.Server/ViewModels/Relationship/CirclesViewModel.cs index 1ce82844..173f317a 100644 --- a/src/Yavsc.Server/ViewModels/Relationship/CirclesViewModel.cs +++ b/src/Yavsc.Server/ViewModels/Relationship/CirclesViewModel.cs @@ -7,7 +7,8 @@ namespace Yavsc.ViewModels.Relationship public CirclesViewModel(ICircleAuthorized resource) { Target = resource; - TargetTypeName = resource.GetType().Name; + if (resource!=null) + TargetTypeName = resource.GetType().Name; } public ICircleAuthorized Target { get; set; } public string TargetTypeName { get; set; } diff --git a/src/Yavsc/ApiControllers/Blogspot/FileSystemApiController.cs b/src/Yavsc/ApiControllers/Blogspot/FileSystemApiController.cs index 8ab6b094..5a7f2251 100644 --- a/src/Yavsc/ApiControllers/Blogspot/FileSystemApiController.cs +++ b/src/Yavsc/ApiControllers/Blogspot/FileSystemApiController.cs @@ -65,7 +65,7 @@ namespace Yavsc.ApiControllers } _logger.LogInformation($"Receiving files, saved in '{destDir}' (specified as '{subdir}')."); - var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); + var uid = User.GetUserId(); var user = dbContext.Users.Single( u => u.Id == uid ); diff --git a/src/Yavsc/Controllers/Accounting/AccountController.cs b/src/Yavsc/Controllers/Accounting/AccountController.cs index 899c4780..7c2ae269 100644 --- a/src/Yavsc/Controllers/Accounting/AccountController.cs +++ b/src/Yavsc/Controllers/Accounting/AccountController.cs @@ -235,9 +235,16 @@ namespace Yavsc.Controllers /// /// Show logout page /// - [HttpGet] + [HttpGet][Authorize] public async Task Logout(string logoutId) { + if (string.IsNullOrWhiteSpace(logoutId)) + { + if (User.Identity.IsAuthenticated) + { + logoutId = User.GetUserId(); + } + } // build a model so the logout page knows what to display var vm = await BuildLogoutViewModelAsync(logoutId); @@ -265,9 +272,11 @@ namespace Yavsc.Controllers { // delete local authentication cookie await HttpContext.SignOutAsync(); + await _signInManager.SignOutAsync(); // raise the logout event await _events.RaiseAsync(new UserLogoutSuccessEvent(User.GetSubjectId(), User.GetDisplayName())); + } // check if we need to trigger sign-out at an upstream identity provider @@ -282,6 +291,9 @@ namespace Yavsc.Controllers return SignOut(new AuthenticationProperties { RedirectUri = url }, vm.ExternalAuthenticationScheme); } + + + return View("LoggedOut", vm); } diff --git a/src/Yavsc/Controllers/Communicating/AnnouncesController.cs b/src/Yavsc/Controllers/Communicating/AnnouncesController.cs index ac3ae0b7..7f67e346 100644 --- a/src/Yavsc/Controllers/Communicating/AnnouncesController.cs +++ b/src/Yavsc/Controllers/Communicating/AnnouncesController.cs @@ -60,7 +60,7 @@ namespace Yavsc.Controllers { ViewBag.IsAdmin = User.IsInRole(Constants.AdminGroupName); ViewBag.IsPerformer = User.IsInRole(Constants.PerformerGroupName); - ViewBag.AllowEdit = announce==null || announce.Id<=0 || !_authorizationService.AuthorizeAsync(User,announce,new EditRequirement()).IsFaulted; + ViewBag.AllowEdit = announce==null || announce.Id<=0 || !_authorizationService.AuthorizeAsync(User,announce,new EditPermission()).IsFaulted; List dl = new List(); var rnames = System.Enum.GetNames(typeof(Reason)); var rvalues = System.Enum.GetValues(typeof(Reason)); diff --git a/src/Yavsc/Controllers/Communicating/BlogspotController.cs b/src/Yavsc/Controllers/Communicating/BlogspotController.cs index 87eaa5a4..b6f34d6e 100644 --- a/src/Yavsc/Controllers/Communicating/BlogspotController.cs +++ b/src/Yavsc/Controllers/Communicating/BlogspotController.cs @@ -14,6 +14,8 @@ using Yavsc.Helpers; using Microsoft.AspNetCore.Localization; using Microsoft.Extensions.Options; using Microsoft.EntityFrameworkCore; +using System.Diagnostics; +using Yavsc.ViewModels.Blog; // For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 @@ -111,30 +113,35 @@ namespace Yavsc.Controllers [Authorize()] public IActionResult Create(string title) { - var result = new BlogPost{Title=title}; + var result = new BlogPostInputViewModel{Title=title,Content=""}; ViewData["PostTarget"]="Create"; SetLangItems(); - return View("Edit",result); + return View(result); } // POST: Blog/Create [HttpPost, Authorize, ValidateAntiForgeryToken] - public IActionResult Create(Models.Blog.BlogPost blog) + public IActionResult Create(BlogPostInputViewModel blogInput) { - blog.Rate = 0; - blog.AuthorId = User.GetUserId(); - blog.Id=0; if (ModelState.IsValid) { - - _context.Blogspot.Add(blog); + BlogPost post = new BlogPost + { + Title = blogInput.Title, + Content = blogInput.Content, + Photo = blogInput.Photo, + Rate = 0, + AuthorId = User.GetUserId() + }; + _context.Blogspot.Add(post); _context.SaveChanges(User.GetUserId()); return RedirectToAction("Index"); } ModelState.AddModelError("Unknown","Invalid Blog posted ..."); ViewData["PostTarget"]="Create"; - return View("Edit",blog); + return View("Edit",blogInput); } + [Authorize()] // GET: Blog/Edit/5 public async Task Edit(long? id) @@ -147,12 +154,11 @@ namespace Yavsc.Controllers ViewData["PostTarget"]="Edit"; BlogPost blog = _context.Blogspot.Include(x => x.Author).Include(x => x.ACL).Single(m => m.Id == id); - if (blog == null) { return NotFound(); } - if (!_authorizationService.AuthorizeAsync(User, blog, new EditRequirement()).IsFaulted) + if (!_authorizationService.AuthorizeAsync(User, blog, new EditPermission()).IsFaulted) { ViewBag.ACL = _context.Circle.Where( c=>c.OwnerId == blog.AuthorId) @@ -180,7 +186,7 @@ namespace Yavsc.Controllers { if (ModelState.IsValid) { - var auth = _authorizationService.AuthorizeAsync(User, blog, new EditRequirement()); + var auth = _authorizationService.AuthorizeAsync(User, blog, new EditPermission()); if (!auth.IsFaulted) { // saves the change diff --git a/src/Yavsc/Extensions/HostingExtensions.cs b/src/Yavsc/Extensions/HostingExtensions.cs index 9125f675..438310cd 100644 --- a/src/Yavsc/Extensions/HostingExtensions.cs +++ b/src/Yavsc/Extensions/HostingExtensions.cs @@ -29,6 +29,7 @@ using Yavsc.Models.Market; using Yavsc.Models.Workflow; using Yavsc.Services; using Yavsc.Settings; +using Yavsc.ViewModels.Auth; namespace Yavsc.Extensions; @@ -308,7 +309,12 @@ internal static class HostingExtensions // options.AddPolicy("EmployeeId", policy => policy.RequireClaim("EmployeeId", "123", "456")); // options.AddPolicy("BuildingEntry", policy => policy.Requirements.Add(new OfficeEntryRequirement())); options.AddPolicy("Authenticated", policy => policy.RequireAuthenticatedUser()); + options.AddPolicy("IsTheAuthor", policy => + policy.Requirements.Add(new EditPermission())); }); + + services.AddSingleton(); + _ = services.AddControllersWithViews() .AddNewtonsoftJson(); LoadGoogleConfig(builder.Configuration); diff --git a/src/Yavsc/Extensions/PermissionHandler.cs b/src/Yavsc/Extensions/PermissionHandler.cs new file mode 100644 index 00000000..bb42da50 --- /dev/null +++ b/src/Yavsc/Extensions/PermissionHandler.cs @@ -0,0 +1,46 @@ +using System.Security.Claims; +using Microsoft.AspNetCore.Authorization; +using Yavsc.ViewModels.Auth; + +namespace Yavsc.Extensions; + +public class PermissionHandler : IAuthorizationHandler +{ + public Task HandleAsync(AuthorizationHandlerContext context) + { + var pendingRequirements = context.PendingRequirements.ToList(); + + foreach (var requirement in pendingRequirements) + { + if (requirement is ReadPermission) + { + if (IsOwner(context.User, context.Resource) + || IsSponsor(context.User, context.Resource)) + { + context.Succeed(requirement); + } + } + else if (requirement is EditPermission || requirement is DeletePermission) + { + if (IsOwner(context.User, context.Resource)) + { + context.Succeed(requirement); + } + } + } + + return Task.CompletedTask; + } + + private static bool IsOwner(ClaimsPrincipal user, object? resource) + { + // Code omitted for brevity + return true; + } + + private static bool IsSponsor(ClaimsPrincipal user, object? resource) + { + // Code omitted for brevity + return true; + } +} diff --git a/src/Yavsc/Helpers/AsciiDocHelpers.cs b/src/Yavsc/Helpers/AsciiDocHelpers.cs index 76b890d8..133942f1 100644 --- a/src/Yavsc/Helpers/AsciiDocHelpers.cs +++ b/src/Yavsc/Helpers/AsciiDocHelpers.cs @@ -117,7 +117,18 @@ namespace Yavsc.Helpers InternalAnchor a = (InternalAnchor) elt; sb.AppendFormat("{1} ", a.Id, a.XRefLabel); break; - + case "AsciiDocNet.Subscript": + sb.AppendHtml(""); + Subscript sub = (Subscript)elt; + sub.ToHtml(sb); + sb.AppendHtml(""); + break; + case "AsciiDocNet.Superscript": + sb.AppendHtml(""); + Superscript sup = (Superscript)elt; + sup.ToHtml(sb); + sb.AppendHtml(""); + break; default: string unsupportedType = elt.GetType().FullName; throw new InvalidProgramException(unsupportedType); diff --git a/src/Yavsc/Models/ApplicationDbContext.cs b/src/Yavsc/Models/ApplicationDbContext.cs index 3a6c732e..3d8a3009 100644 --- a/src/Yavsc/Models/ApplicationDbContext.cs +++ b/src/Yavsc/Models/ApplicationDbContext.cs @@ -35,7 +35,6 @@ namespace Yavsc.Models using Calendar; using Blog; using Yavsc.Abstract.Identity; - using Yavsc.Server.Models.Blog; using Microsoft.EntityFrameworkCore; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Yavsc.Server.Models.Calendar; @@ -79,7 +78,6 @@ namespace Yavsc.Models builder.Entity().HasKey(o => new { o.Code, o.CodeScrutin }); builder.Entity().Property(n => n.icon).HasDefaultValue("exclam"); builder.Entity().HasKey(p => new { room = p.ChannelName, user = p.UserId }); - builder.Entity().HasKey(tr => new { post = tr.PostId, lang = tr.Lang }); builder.Entity().HasAlternateKey(i => new { Instrument= i.InstrumentId, owner = i.OwnerId }); foreach (var et in builder.Model.GetEntityTypes()) @@ -291,8 +289,6 @@ namespace Yavsc.Models public DbSet Project { get; set; } - public DbSet BlogTrad { get; set; } - [Obsolete("use signaled flows")] public DbSet LiveFlow { get; set; } diff --git a/src/Yavsc/ViewComponents/CirclesControlViewComponent.cs b/src/Yavsc/ViewComponents/CirclesControlViewComponent.cs index 117b60d7..4eb18add 100644 --- a/src/Yavsc/ViewComponents/CirclesControlViewComponent.cs +++ b/src/Yavsc/ViewComponents/CirclesControlViewComponent.cs @@ -20,6 +20,8 @@ namespace Yavsc.ViewComponents public IViewComponentResult Invoke (ICircleAuthorized target) { + if (target!=null) + { var oid = target.GetOwnerId(); ViewBag.ACL = dbContext.Circle.Where( c=>c.OwnerId == oid) @@ -41,6 +43,8 @@ namespace Yavsc.ViewComponents Checked = target.AuthorizeCircle(c.Id), Value = c.Id.ToString() }); + } + return View(new CirclesViewModel(target)); } } diff --git a/src/Yavsc/ViewModels/Auth/EditRequirement.cs b/src/Yavsc/ViewModels/Auth/EditRequirement.cs index f6693943..5c3a4365 100644 --- a/src/Yavsc/ViewModels/Auth/EditRequirement.cs +++ b/src/Yavsc/ViewModels/Auth/EditRequirement.cs @@ -2,10 +2,25 @@ using Microsoft.AspNetCore.Authorization; namespace Yavsc.ViewModels.Auth { - public class EditRequirement : IAuthorizationRequirement + public class EditPermission : IAuthorizationRequirement { - public EditRequirement() + public EditPermission() { } } + + public class ReadPermission: IAuthorizationRequirement + { + public ReadPermission() + { + } + } + + public class DeletePermission: IAuthorizationRequirement + { + public DeletePermission() + { + } + } + } diff --git a/src/Yavsc/Views/Blogspot/Create.cshtml b/src/Yavsc/Views/Blogspot/Create.cshtml new file mode 100644 index 00000000..8b3c265d --- /dev/null +++ b/src/Yavsc/Views/Blogspot/Create.cshtml @@ -0,0 +1,85 @@ +@model Yavsc.ViewModels.Blog.BlogPostInputViewModel + +@{ + ViewData["Title"] = "Blog post edition"; +} + +@section header { + + + + + + @{ await Html.RenderPartialAsync("_FSScriptsPartial"); } + +} + +

Blog post

+ + +
+ + +

@Model.Title

+ +
@Model.Content
+ +
+
+
+ +
+ +
+ +
+ + + +
+
+ +
+ +
+ + + +
+
+
+ +
+ + + +
+
+
+ +
+ +
+
+
+ +
+ @await Component.InvokeAsync("CirclesControl", Model) +
+
+ +
+
+ +
+
+
+
+@await Component.InvokeAsync("Directory","") +
+ @{ await Html.RenderPartialAsync("_PostFilesPartial"); } +
+ diff --git a/src/Yavsc/Views/Blogspot/Details.cshtml b/src/Yavsc/Views/Blogspot/Details.cshtml index f37ac91d..65ab92ce 100644 --- a/src/Yavsc/Views/Blogspot/Details.cshtml +++ b/src/Yavsc/Views/Blogspot/Details.cshtml @@ -112,7 +112,7 @@ $('span.field-validation-valid[data-valmsg-for="Content"]').html( } -@if ((await AuthorizationService.AuthorizeAsync(User, Model, new EditRequirement())).Succeeded) { +@if ((await AuthorizationService.AuthorizeAsync(User, Model, new EditPermission())).Succeeded) { Edit } Back to List diff --git a/src/Yavsc/Views/Blogspot/Edit.cshtml b/src/Yavsc/Views/Blogspot/Edit.cshtml index d08c52d4..0624a5ca 100644 --- a/src/Yavsc/Views/Blogspot/Edit.cshtml +++ b/src/Yavsc/Views/Blogspot/Edit.cshtml @@ -1,4 +1,4 @@ -@model BlogPost +@model Yavsc.ViewModels.Blog.BlogPostInputViewModel @{ ViewData["Title"] = "Blog post edition"; @@ -6,7 +6,6 @@ @section header { - - - -@{ await Html.RenderPartialAsync("_FSScriptsPartial"); } + @{ await Html.RenderPartialAsync("_FSScriptsPartial"); } } -@section scripts { - - - - @Html.Partial("_ValidationScriptsPartial") - -}

Blog post edition

@@ -131,47 +52,17 @@ -

@Model.Title

+

@Model.Title

- -
+
@Model.Content

-
+
-
-

@ViewData["StatusMessage"]

- - - +
@@ -182,17 +73,6 @@
-
- -
- - - -
-
- -
@@ -230,9 +110,6 @@
-
- -
@await Component.InvokeAsync("Directory","")
@{ await Html.RenderPartialAsync("_PostFilesPartial"); } diff --git a/src/Yavsc/Views/Blogspot/Title.cshtml b/src/Yavsc/Views/Blogspot/Title.cshtml index 6e2b27d5..1f02b3e5 100644 --- a/src/Yavsc/Views/Blogspot/Title.cshtml +++ b/src/Yavsc/Views/Blogspot/Title.cshtml @@ -46,7 +46,7 @@ Details } - @if ((await AuthorizationService.AuthorizeAsync(User, item, new EditRequirement())).Succeeded) { + @if ((await AuthorizationService.AuthorizeAsync(User, item, new EditPermission())).Succeeded) {
  • Edit
  • Delete diff --git a/src/Yavsc/Views/Shared/Components/BlogIndex/Default.cshtml b/src/Yavsc/Views/Shared/Components/BlogIndex/Default.cshtml index 92f81b83..f0a9ab4d 100644 --- a/src/Yavsc/Views/Shared/Components/BlogIndex/Default.cshtml +++ b/src/Yavsc/Views/Shared/Components/BlogIndex/Default.cshtml @@ -49,7 +49,7 @@ Details
  • } - @if ((await AuthorizationService.AuthorizeAsync(User, item, new EditRequirement())).Succeeded) { + @if ((await AuthorizationService.AuthorizeAsync(User, item, new EditPermission())).Succeeded) {
  • Edit
  • Delete diff --git a/src/Yavsc/Views/Shared/Components/CirclesControl/Default.cshtml b/src/Yavsc/Views/Shared/Components/CirclesControl/Default.cshtml index 815cdbd6..d11cf672 100644 --- a/src/Yavsc/Views/Shared/Components/CirclesControl/Default.cshtml +++ b/src/Yavsc/Views/Shared/Components/CirclesControl/Default.cshtml @@ -1,6 +1,6 @@ @model CirclesViewModel - -@foreach (var cb in ViewBag.Access) {  +@if (ViewBag.Access!=null) +foreach (var cb in ViewBag.Access) { diff --git a/src/Yavsc/Views/Shared/Error.cshtml b/src/Yavsc/Views/Shared/Error.cshtml index a1e04783..d5a8de36 100644 --- a/src/Yavsc/Views/Shared/Error.cshtml +++ b/src/Yavsc/Views/Shared/Error.cshtml @@ -6,7 +6,7 @@

    Error.

    An error occurred while processing your request.

    -@if (Model.ShowRequestId) +@if (Model!=null) if (Model.ShowRequestId) {

    Request ID: @Model.RequestId diff --git a/src/Yavsc/Views/Shared/_Layout.cshtml b/src/Yavsc/Views/Shared/_Layout.cshtml index 0682ddaa..b3006a56 100644 --- a/src/Yavsc/Views/Shared/_Layout.cshtml +++ b/src/Yavsc/Views/Shared/_Layout.cshtml @@ -10,8 +10,7 @@ + --> @await RenderSectionAsync("header", false) diff --git a/src/Yavsc/Views/Shared/_LoginPartial.cshtml b/src/Yavsc/Views/Shared/_LoginPartial.cshtml index a95c1363..01f02585 100644 --- a/src/Yavsc/Views/Shared/_LoginPartial.cshtml +++ b/src/Yavsc/Views/Shared/_LoginPartial.cshtml @@ -46,7 +46,9 @@ Manage your account

  • -
  • Your Grants
  • +
  • Grants
  • +
  • Device
  • +
  • Diagnostics
  • Logout
  • diff --git a/src/Yavsc/Views/Shared/_Nav.cshtml b/src/Yavsc/Views/Shared/_Nav.cshtml index 2e0cd068..158a5c00 100644 --- a/src/Yavsc/Views/Shared/_Nav.cshtml +++ b/src/Yavsc/Views/Shared/_Nav.cshtml @@ -5,7 +5,7 @@ diff --git a/src/Yavsc/wwwroot/css/.sass-cache/f72b97d2a2f775ae72a70903abdc00c6553756a7/site.scssc b/src/Yavsc/wwwroot/css/.sass-cache/f72b97d2a2f775ae72a70903abdc00c6553756a7/site.scssc index 5384691e53ac895054a7410d18b416bd9beac339..e91dd8617e756cc2dadd54ee2409897610d9164f 100644 GIT binary patch literal 9265 zcmd^F&2rnw5tf(@MNEAMfryX<0k1on3vm^>oL6YVAJV+1b*!c8?p!PwZCdqXISV9#~;$ z7>9vv8^(_)jb71?Jz-3l?GwlC1h#inN)z>68;Pckk{Q7LQGUNXTk8gv7ll>d>e_iD z|M{UYXZltU+MOoSgw!a<3mw?5-HvEr7%ynAXC2sI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t7&gbFe7Pj4efRTr((K? zV`$KgSug+pv|P%c5HwclTP);(+lN)&%(XFG4GqgL^!|W{ST<;ASfi}#8~9&s2gKJj z`C=WrSL~{TX8_@SCC0{ScG2$zG0Tn1r=P#KhxXKzdF%)!6`)G*Z~&Dbo>Bqb@uEGf+>CDF{($i&|PE4B{6`YtR|4}vt08NV)BLDyZ diff --git a/src/Yavsc/wwwroot/css/site.css b/src/Yavsc/wwwroot/css/site.css index 7681dba1..faf983f2 100644 --- a/src/Yavsc/wwwroot/css/site.css +++ b/src/Yavsc/wwwroot/css/site.css @@ -14,21 +14,13 @@ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); } /* bootstrap.css | http://localhost:5000/lib/bootstrap/css/bootstrap.css */ -.nav-link { - /* background-color: var(--bs-nav-tabs-link-active-bg); */ - background-color: black; } - -.dropdown-item { - /* background-color: transparent; */ - background-color: black; } - -.dropdown-menu { - /* background-color: var(--bs-dropdown-bg); */ - background-color: black; } - div.carousel-inner > div.item > div.carousel-caption-s { margin: .5em; background-color: rgba(0, 0, 0, 0.6); color: #ffffc8; font-weight: bold; padding: .5em; } + +img.blogphoto { + max-width: 100%; + max-height: 100%; } diff --git a/src/Yavsc/wwwroot/css/site.scss b/src/Yavsc/wwwroot/css/site.scss index 93a8d9d7..e5b502b4 100644 --- a/src/Yavsc/wwwroot/css/site.scss +++ b/src/Yavsc/wwwroot/css/site.scss @@ -26,20 +26,6 @@ /* bootstrap.css | http://localhost:5000/lib/bootstrap/css/bootstrap.css */ -.nav-link { - /* background-color: var(--bs-nav-tabs-link-active-bg); */ - background-color: black; -} - -.dropdown-item { - /* background-color: transparent; */ - background-color: black; -} - -.dropdown-menu { - /* background-color: var(--bs-dropdown-bg); */ - background-color: black; -} div.carousel-inner > div.item > div.carousel-caption-s { margin: .5em; @@ -48,3 +34,8 @@ div.carousel-inner > div.item > div.carousel-caption-s { font-weight: bold; padding: .5em; } + +img.blogphoto { + max-width: 100%; + max-height: 100%; +} diff --git a/test/yavscTests/Startup.cs b/test/yavscTests/Startup.cs index c4082e7f..c37acbba 100644 --- a/test/yavscTests/Startup.cs +++ b/test/yavscTests/Startup.cs @@ -615,14 +615,14 @@ namespace yavscTests Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", "google-secret.json"); - /* TODO + ConfigureFileServerApp(app, SiteSetup, env, authorizationService); app.UseRequestLocalization(localizationOptions.Value, (RequestCulture)new RequestCulture((string)"en-US")); ConfigureWorkflow(); - */ + app.UseMvc(routes => {