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 5384691e..e91dd861 100644 Binary files a/src/Yavsc/wwwroot/css/.sass-cache/f72b97d2a2f775ae72a70903abdc00c6553756a7/site.scssc and b/src/Yavsc/wwwroot/css/.sass-cache/f72b97d2a2f775ae72a70903abdc00c6553756a7/site.scssc differ 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 => {