Working on roles, users and create tenant

This commit is contained in:
Janus C. H. Knudsen 2025-01-14 23:10:30 +01:00
parent 269bf50c78
commit fcffb57ac6
21 changed files with 483 additions and 56 deletions

View file

@ -9,12 +9,12 @@
<None Remove="App.ts" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Akka" Version="1.5.32" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Core\Core.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Views\Components\" />
</ItemGroup>
</Project>

View file

@ -1,23 +0,0 @@
using Microsoft.AspNetCore.Razor.TagHelpers;
namespace Application
{
public class HelloTagHelper : TagHelper
{
public string Name { get; set; }
public override void Process(TagHelperContext context, TagHelperOutput output)
{
output.TagName = "div"; // Output bliver et div element
output.Content.SetHtmlContent($"<h1>Hello {Name}</h1>");
}
}
public class ContentManager
{
//public string GetContent(
//
}
}

View file

@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Mvc.Razor;
namespace Application.Common
{
public class ComponentsViewLocationExpander : IViewLocationExpander
{
public void PopulateValues(ViewLocationExpanderContext context)
{
}
public IEnumerable<string> ExpandViewLocations(ViewLocationExpanderContext context, IEnumerable<string> viewLocations)
{
var componentLocations = new[]
{
"/{0}.cshtml/"
//,
//"/Components/{1}/"
};
return componentLocations.Concat(viewLocations);
}
}
}

View file

@ -0,0 +1,12 @@
<nav>
<ul>
<li><a href="/@Model.Title">Index</a></li>
<li>Overblik</li>
<li>Kalender</li>
<li>Salg</li>
<li>Kunder</li>
<li>Kassesystem</li>
<li>Statistik</li>
<li>Integrationers</li>
</ul>
</nav>

View file

@ -0,0 +1,18 @@
using Microsoft.ApplicationInsights;
using Microsoft.AspNetCore.Mvc;
namespace Application.Components.Navigation
{
public class NavigationViewComponent : ViewComponent
{
public NavigationViewComponent(TelemetryClient telemetryClient)
{
}
public IViewComponentResult Invoke()
{
return View(new { Title = "Hej", Description = "Dette edr en beskrivdelse" });
}
}
}

View file

@ -5,9 +5,10 @@
}
<hello name="John"></hello>
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://learn.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
@* <hello name="John"></hello> *@
<div>
<h1>Calendar.</h1>
<calendar></calendar>
</div>

View file

@ -9,7 +9,7 @@ namespace PlanTempus.Pages
{
private readonly TelemetryClient _telemetry;
public IndexModel(TelemetryClient telemetry, Akka.Actor.ActorSystem system)
public IndexModel(TelemetryClient telemetry)
{
_telemetry = telemetry;

View file

@ -9,18 +9,17 @@
</head>
<body>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<swp-container>
<aside>
<aside-top><img src="~/images/pt-logo2.png" /></aside-top>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2024 - PlanTempus - <a asp-area="" asp-page="/Privacy">Privacy</a>
</div>
</footer>
@await Component.InvokeAsync("Navigation")
</aside>
<main>@RenderBody()</main>
<top>top</top>
<footer>footer</footer>
</swp-container>
@await RenderSectionAsync("Scripts", required: false)

View file

@ -26,7 +26,12 @@ namespace PlanTempus
//services.AddApplicationInsightsTelemetry(ConfigurationRoot["ApplicationInsights:InstrumentationKey"]);
services.AddAntiforgery(x => x.HeaderName = "X-ANTI-FORGERY-TOKEN");
}
services.Configure<Microsoft.AspNetCore.Mvc.Razor.RazorViewEngineOptions>(options =>
{
options.ViewLocationExpanders.Add(new Application.Common.ComponentsViewLocationExpander());
});
}
public void ConfigureContainer(ContainerBuilder builder)
{
builder.RegisterModule(new Core.ModuleRegistry.DbPostgreSqlModule

View file

@ -1,22 +1,171 @@
html {
font-size: 14px;
:root {
--top-height: 70px;
--footer-height: 50px;
--theme-aside-background-color: #233242;
--theme-footer-background-color: #233242;
}
@media (min-width: 768px) {
html {
font-size: 16px;
}
@font-face {
font-family: 'rubik-regular';
src: url('../fonts/rubik-regular.woff2') format('woff2');
}
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
@font-face {
font-family: 'rubik';
src: url('../fonts/rubik-variablefont_wght.woff2') format('woff2');
}
.theme-light {
--theme-aside-background-color: beige;
--theme-footer-background-color: beige;
}
html {
position: relative;
min-height: 100%;
font-size: 14px;
font-family: rubik;
font-weight: 100;
}
html {
display: grid;
min-height: 100%;
}
body {
margin-bottom: 60px;
}
display: grid;
margin: 0;
}
body {
overflow-x: hidden;
margin: 0;
color: #6a7a8c;
background: #f2f4f5;
position: relative
}
.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
margin-top: 0;
margin-bottom: .5rem;
font-weight: 400;
line-height: 1.2;
color: var(--bs-heading-color, inherit);
}
.h1, h1 {
font-size: calc(1.35rem + 1.2vw)
}
@media (min-width: 1200px) {
.h1, h1 {
font-size: 2.25rem
}
}
.h2, h2 {
font-size: calc(1.3125rem + .75vw)
}
@media (min-width: 1200px) {
.h2, h2 {
font-size: 1.875rem
}
}
.h3, h3 {
font-size: calc(1.275rem + .3vw)
}
@media (min-width: 1200px) {
.h3, h3 {
font-size: 1.5rem
}
}
.h4, h4 {
font-size: 1.125rem
}
.h5, h5 {
font-size: 1rem
}
.h6, h6 {
font-size: .875rem
}
swp-container {
display: grid;
grid-template-columns: 250px 1.3fr;
grid-template-rows: var(--top-height) 1000px var(--footer-height);
gap: 0px 0px;
grid-auto-flow: row;
grid-template-areas:
"aside top"
"aside main"
"aside footer";
}
aside {
grid-area: aside;
background-color: var(--theme-aside-background-color);
position: sticky;
top: 0;
height: 100vh;
display: grid;
grid-template-rows: var(--top-height) auto;
}
aside aside-top {
background-color: var(--theme-background-color);
overflow: hidden;
justify-self: center;
}
aside aside-top img {
transform: scale(0.7);
}
aside nav {
margin-top: 50px;
}
aside nav ul {
display: grid;
margin-block-start: 0px;
padding-inline-start: 0px;
grid-auto-rows: 50px;
justify-items: stretch;
align-items: stretch;
}
aside nav li {
align-content: center;
color: #fff;
padding-inline: 12px 15px;
border-left: 2px solid transparent;
}
aside nav li:hover {
background: rgba(0, 0, 0, .1);
border-left: 2px solid #137eff;
}
main {
grid-area: main;
background-color: lightgray;
}
top {
grid-area: top;
background-color: #f2f4f5;
position: sticky;
top: 0;
z-index: 1;
box-shadow: 0 2px 4px rgb(200, 200, 200, 0,15);
}
footer {
grid-area: footer;
background-color: var(--theme-footer-background-color);
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB