diff --git a/LambertzPortal/LambertzPortal.sln b/LambertzPortal/LambertzPortal.sln new file mode 100644 index 0000000..3a58c0e --- /dev/null +++ b/LambertzPortal/LambertzPortal.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36915.13 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambertzPortal", "LambertzPortal\LambertzPortal.csproj", "{9D60011D-2360-4DDC-AF43-7DF73D9FD56B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9D60011D-2360-4DDC-AF43-7DF73D9FD56B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9D60011D-2360-4DDC-AF43-7DF73D9FD56B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9D60011D-2360-4DDC-AF43-7DF73D9FD56B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9D60011D-2360-4DDC-AF43-7DF73D9FD56B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {EDE6A789-B03B-4ECC-8537-71244B497B07} + EndGlobalSection +EndGlobal diff --git a/LambertzPortal/LambertzPortal/Components/App.razor b/LambertzPortal/LambertzPortal/Components/App.razor new file mode 100644 index 0000000..9ba32f4 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/App.razor @@ -0,0 +1,38 @@ +@using Microsoft.AspNetCore.Mvc.ViewFeatures +@inject IFileVersionProvider FileVersionProvider + + + + + + + + @DxResourceManager.RegisterTheme(ActiveTheme) + @DxResourceManager.RegisterScripts() + + + + + + + + + + +@code { + + static readonly ITheme ActiveTheme = Themes.Fluent.Clone(properties => + { + properties.Mode = ThemeMode.Light; + }); + + [CascadingParameter] + private HttpContext HttpContext { get; set; } = default!; + + private string AppendVersion(string path) + => FileVersionProvider.AddFileVersionToPath( + HttpContext.Request.PathBase.HasValue + ? HttpContext.Request.PathBase.Value + : "/", + path); +} diff --git a/LambertzPortal/LambertzPortal/Components/Layout/Drawer.razor b/LambertzPortal/LambertzPortal/Components/Layout/Drawer.razor new file mode 100644 index 0000000..73a8d3e --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Layout/Drawer.razor @@ -0,0 +1,38 @@ +@inherits DrawerStateComponentBase + +
+ + + + + + @TargetContent + + + + +
+ +@code { + [Parameter] public string? CssClass { get; set; } + [Parameter] public string? PanelWidth { get; set; } + [Parameter] public RenderFragment? TargetContent { get; set; } + [Parameter] public RenderFragment? BodyTemplate { get; set; } + [Parameter] public RenderFragment? HeaderTemplate { get; set; } + [Parameter] public RenderFragment? FooterTemplate { get; set; } +} \ No newline at end of file diff --git a/LambertzPortal/LambertzPortal/Components/Layout/Drawer.razor.css b/LambertzPortal/LambertzPortal/Components/Layout/Drawer.razor.css new file mode 100644 index 0000000..ad63fbe --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Layout/Drawer.razor.css @@ -0,0 +1,53 @@ +.drawer-container { + height: 100%; +} + +.navigation-drawer-shading { + height: 100%; + position: absolute; + transition: ease 300ms; + transition-property: opacity, visibility; + visibility: visible; + width: 100%; + z-index: 99; + background-color: var(--dxds-color-surface-backdrop-default-rest); +} + +.navigation-drawer.mobile.panel-closed .navigation-drawer-shading { + opacity: 0; + visibility: hidden; +} + +::deep .navigation-drawer > .dxbl-drawer-panel { + display: flex; +} + +::deep .navigation-drawer.mobile > .dxbl-drawer-panel { + display: none; +} + +.navigation-drawer-shading { + display: none; +} + +::deep .panel-open:not(.mobile) .nav-buttons-container .menu-button { + display: none; +} + +@media (max-width: 768px) { + ::deep .navigation-drawer > .dxbl-drawer-panel { + display: none; + } + + ::deep .navigation-drawer.mobile > .dxbl-drawer-panel { + display: flex; + } + + .navigation-drawer-shading { + display: block; + } + + ::deep .panel-open:not(.mobile) .nav-buttons-container .menu-button { + display: flex; + } +} diff --git a/LambertzPortal/LambertzPortal/Components/Layout/MainLayout.razor b/LambertzPortal/LambertzPortal/Components/Layout/MainLayout.razor new file mode 100644 index 0000000..e4eae84 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Layout/MainLayout.razor @@ -0,0 +1,53 @@ +@inherits DrawerStateLayoutComponentBase +@inject NavigationManager NavigationManager + +
+ + + + + +
+ +
+
+ + + + +
+ +
+ @Body +
+
+
+
+
+ +@code { + string LocalPath => new Uri(NavigationManager.Uri).LocalPath; +} \ No newline at end of file diff --git a/LambertzPortal/LambertzPortal/Components/Layout/MainLayout.razor.css b/LambertzPortal/LambertzPortal/Components/Layout/MainLayout.razor.css new file mode 100644 index 0000000..de971f8 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Layout/MainLayout.razor.css @@ -0,0 +1,67 @@ +.page { + height: 100%; + min-height: 0; +} + +::deep .navigation-drawer { + --dxbl-drawer-panel-body-padding-x: 0; + --dxbl-drawer-panel-body-padding-y: 1rem; + --dxbl-drawer-panel-footer-bg: none; + --dxbl-drawer-panel-header-bg: none; + --dxbl-drawer-separator-border-width: 0; +} + +::deep .navigation-drawer > .dxbl-drawer-panel { + background-image: linear-gradient(180deg, var(--dxds-color-surface-primary-default-rest) 0%, var(--dxds-primary-170) 150%); +} + +.navigation-drawer-header { + align-items: center; + display: flex; + justify-content: space-between; + padding: 1.375rem 0.375rem; + width: 100%; +} + +.navigation-drawer-header .logo { + height: 1.5rem; + width: 9rem; +} + +.navigation-drawer-footer { + display: flex; + justify-content: space-evenly; + padding-bottom: 0.875rem; + width: 100%; +} + +.drawer-content { + display: flex; + flex-direction: column; + height: 100%; + overflow: auto; + padding: 2rem 1.5rem 1.5rem 1.5rem; +} + +.nav-buttons-container { + align-items: center; + display: flex; + gap: 0.625rem; + min-height: 2rem; +} + +::deep .nav-buttons-container > a { + color: inherit; +} + +::deep .nav-buttons-container .back-button { + padding-left: 0; + padding-right: 0.25rem; +} + +.page-content-container { + display: flex; + flex-direction: column; + flex-grow: 1; + min-height: 0; +} diff --git a/LambertzPortal/LambertzPortal/Components/Layout/NavMenu.razor b/LambertzPortal/LambertzPortal/Components/Layout/NavMenu.razor new file mode 100644 index 0000000..a175606 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Layout/NavMenu.razor @@ -0,0 +1,34 @@ +@inject NavigationManager NavigationManager +@implements IDisposable + +
+ + + + + + + +
+ +@code { + private string? currentLocalPath; + + protected override void OnInitialized() { + currentLocalPath = new Uri(NavigationManager.Uri).LocalPath; + NavigationManager.LocationChanged += OnLocationChanged; + } + + private void OnLocationChanged(object? sender, LocationChangedEventArgs e) { + currentLocalPath = new Uri(NavigationManager.Uri).LocalPath; + InvokeAsync(StateHasChanged); + } + + private string? MenuItemCssClass(string itemPath) { + return string.Equals(currentLocalPath, itemPath, StringComparison.OrdinalIgnoreCase) ? "menu-item-active" : null; + } + + public void Dispose() { + NavigationManager.LocationChanged -= OnLocationChanged; + } +} \ No newline at end of file diff --git a/LambertzPortal/LambertzPortal/Components/Layout/NavMenu.razor.css b/LambertzPortal/LambertzPortal/Components/Layout/NavMenu.razor.css new file mode 100644 index 0000000..eace38e --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Layout/NavMenu.razor.css @@ -0,0 +1,23 @@ +::deep .menu { + --dxbl-menu-bottom-left-border-radius: 0; + --dxbl-menu-bottom-right-border-radius: 0; + --dxbl-menu-top-left-border-radius: 0; + --dxbl-menu-top-right-border-radius: 0; + --dxbl-menu-item-padding-x: 1.125rem; + --dxbl-menu-item-padding-y: 0.5rem; + --dxbl-menu-item-color: var(--dxds-color-content-neutral-default-static-dark-rest); + --dxbl-menu-item-image-color: var(--dxds-color-content-neutral-default-static-dark-rest); + --dxbl-menu-item-hover-bg: rgb(from var(--dxds-color-surface-neutral-default-static-light-rest) r g b / 0.15); + --dxbl-menu-item-hover-color: var(--dxds-color-content-neutral-default-static-dark-hovered); + --dxbl-menu-item-hover-image-color: var(--dxds-color-content-neutral-default-static-dark-hovered); + + background: none; +} + +::deep .menu.display-mobile { + margin-bottom: 2rem; +} + +::deep .menu-item-active { + background-color: rgb(from var(--dxds-color-surface-neutral-default-static-light-rest) r g b / 0.05); +} diff --git a/LambertzPortal/LambertzPortal/Components/Pages/Counter.razor b/LambertzPortal/LambertzPortal/Components/Pages/Counter.razor new file mode 100644 index 0000000..ed65882 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Pages/Counter.razor @@ -0,0 +1,24 @@ +@page "/counter" + +Counter + +

Counter

+ +
+
+
+ @currentCount +
+ current count +
+ Click me +
+ +@code { + private int currentCount; + + private void IncrementCount() + { + currentCount++; + } +} diff --git a/LambertzPortal/LambertzPortal/Components/Pages/Counter.razor.css b/LambertzPortal/LambertzPortal/Components/Pages/Counter.razor.css new file mode 100644 index 0000000..73f0c69 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Pages/Counter.razor.css @@ -0,0 +1,25 @@ +.counter-block { + align-items: center; + border-radius: 1rem; + display: flex; + flex-direction: column; + gap: 1.5rem; + height: 17rem; + justify-content: center; + padding: 2.5rem 1.5rem 1.5rem; + width: 16.875rem; + border: 1px solid var(--dxds-color-border-neutral-default-rest); +} + +.counter-block .counter-content { + align-items: center; + display: flex; + flex-direction: column; + gap: 0.5rem; +} + +.counter-block .counter-count { + font-size: 7.5rem; + font-weight: 400; + line-height: 7.75rem; +} diff --git a/LambertzPortal/LambertzPortal/Components/Pages/Error.razor b/LambertzPortal/LambertzPortal/Components/Pages/Error.razor new file mode 100644 index 0000000..576cc2d --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Pages/Error.razor @@ -0,0 +1,36 @@ +@page "/Error" +@using System.Diagnostics + +Error + +

Error.

+

An error occurred while processing your request.

+ +@if (ShowRequestId) +{ +

+ Request ID: @RequestId +

+} + +

Development Mode

+

+ Swapping to Development environment will display more detailed information about the error that occurred. +

+

+ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +

+ +@code{ + [CascadingParameter] + private HttpContext? HttpContext { get; set; } + + private string? RequestId { get; set; } + private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + protected override void OnInitialized() => + RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; +} diff --git a/LambertzPortal/LambertzPortal/Components/Pages/Index/Index.razor b/LambertzPortal/LambertzPortal/Components/Pages/Index/Index.razor new file mode 100644 index 0000000..818dfb2 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Pages/Index/Index.razor @@ -0,0 +1,26 @@ +@page "/" + +Welcome + +
+ + + + + + + + + + + + + + +
diff --git a/LambertzPortal/LambertzPortal/Components/Pages/Index/Index.razor.css b/LambertzPortal/LambertzPortal/Components/Pages/Index/Index.razor.css new file mode 100644 index 0000000..c1ef55c --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Pages/Index/Index.razor.css @@ -0,0 +1,31 @@ +::deep .index-gridlayout { + container-type: inline-size; + height: auto; + margin-top: auto; + margin-bottom: auto; + padding-bottom: 9rem; +} + +::deep .title { + padding-bottom: 3rem; + text-align: center; +} + +::deep .tiles { + --tile-column-count: 4; + + display: grid; + gap: 1rem; + grid-template-columns: repeat(var(--tile-column-count), max-content); + justify-content: center; + + @container (max-width: 60.5rem) { + --tile-column-count: 3; + } + @container (max-width: 45.125rem) { + --tile-column-count: 2; + } + @container (max-width: 29.75rem) { + --tile-column-count: 1; + } +} \ No newline at end of file diff --git a/LambertzPortal/LambertzPortal/Components/Pages/Index/IndexTile.razor b/LambertzPortal/LambertzPortal/Components/Pages/Index/IndexTile.razor new file mode 100644 index 0000000..89c23fd --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Pages/Index/IndexTile.razor @@ -0,0 +1,119 @@ +@* @inherits DrawerStateComponentBase + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +@code { + [Parameter] public string NavigateUrl { get; set; } = string.Empty; + [Parameter] public string? Title { get; set; } + [Parameter] public string? Description { get; set; } + [Parameter] public string? IconCssClass { get; set; } +} *@ + + +@inherits DrawerStateComponentBase + +
+ @if (OpenInNewTab) + { + + + + + + + + + + + + + + + + + + + + + + + + } + else + { + + + + + + + + + + + + + + + + + + + + + + + + } +
+ +@code { + [Parameter] public string NavigateUrl { get; set; } = string.Empty; + [Parameter] public string? Title { get; set; } + [Parameter] public string? Description { get; set; } + [Parameter] public string? IconCssClass { get; set; } + [Parameter] public bool OpenInNewTab { get; set; } +} + diff --git a/LambertzPortal/LambertzPortal/Components/Pages/Index/IndexTile.razor.css b/LambertzPortal/LambertzPortal/Components/Pages/Index/IndexTile.razor.css new file mode 100644 index 0000000..c399a0b --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Pages/Index/IndexTile.razor.css @@ -0,0 +1,44 @@ +.tile { + border-radius: 0.75rem; + height: 7.5rem; + transition: box-shadow 0.2s; + width: 14.375rem; + border: 1px solid var(--dxds-color-border-neutral-default-rest); +} + +.tile:hover { + box-shadow: 0 4px 8px 0 rgba(170, 170, 170, 0.24), 0 0 2px 0 rgba(170, 170, 170, 0.2); +} + +.tile ::deep > a { + text-decoration: none; +} + +::deep .tile-content { + padding: 1rem; +} + +::deep .tile-icon { + border-radius: 0.375rem; + height: 2.75rem; + padding: 0.75rem; + width: 2.75rem; + border: 1px solid var(--dxds-color-border-neutral-default-rest); +} + +::deep .tile-title { + align-self: center; + color: var(--dxds-color-content-neutral-default-rest); + font-size: var(--dxds-font-size-base-md); + font-weight: var(--dxds-font-weight-base-strong); + letter-spacing: var(--dxds-letter-spacing-base-md); + line-height: var(--dxds-line-height-base-md); +} + +::deep .tile-description { + color: var(--dxds-color-content-neutral-subdued-rest); + font-size: var(--dxds-font-size-base-sm); + font-weight: var(--dxds-font-weight-base-default); + letter-spacing: var(--dxds-letter-spacing-base-sm); + line-height: var(--dxds-line-height-base-sm); +} \ No newline at end of file diff --git a/LambertzPortal/LambertzPortal/Components/Pages/Login.razor b/LambertzPortal/LambertzPortal/Components/Pages/Login.razor new file mode 100644 index 0000000..c4a60b7 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Pages/Login.razor @@ -0,0 +1,68 @@ +@page "/login" +@rendermode InteractiveServer +@using System.ComponentModel.DataAnnotations +@using DevExpress.Blazor + +

Login

+ + + + + + + + + + + + + + + + + + + + + + + + + + + @if (!string.IsNullOrEmpty(_error)) + { +
@_error
+ } + + @if (_success) + { +
Login erfolgreich!
+ } +
+
+ +@code { + + private LoginModel _model = new(); + private string? _error; + private bool _success; + + private async Task OnLogin() + { + + } + + + + private class LoginModel + { + [Required] + public string? Benutzername { get; set; } + + [Required] + public string? Passwort { get; set; } + } +} diff --git a/LambertzPortal/LambertzPortal/Components/Pages/Weather.razor b/LambertzPortal/LambertzPortal/Components/Pages/Weather.razor new file mode 100644 index 0000000..7b10b76 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Pages/Weather.razor @@ -0,0 +1,32 @@ +@page "/weather" + +Weather + +

Weather

+ + + + + + + + + + +@code { + private WeatherForecast[]? forecasts; + + protected override async Task OnInitializedAsync() { + DateOnly startDate = DateOnly.FromDateTime(DateTime.Now); + string[] summaries = ["Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"]; + forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast( + Date: startDate.AddDays(index), + TemperatureC: Random.Shared.Next(-20, 55), + Summary: summaries[Random.Shared.Next(summaries.Length)] + )).ToArray(); + } + + private record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) { + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + } +} diff --git a/LambertzPortal/LambertzPortal/Components/Routes.razor b/LambertzPortal/LambertzPortal/Components/Routes.razor new file mode 100644 index 0000000..a3c9db7 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Routes.razor @@ -0,0 +1,10 @@ + + + + + + +

Sorry, there's nothing at this address.

+
+
+
\ No newline at end of file diff --git a/LambertzPortal/LambertzPortal/Components/Shared/DrawerStateComponentBase.cs b/LambertzPortal/LambertzPortal/Components/Shared/DrawerStateComponentBase.cs new file mode 100644 index 0000000..0802ff6 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/Shared/DrawerStateComponentBase.cs @@ -0,0 +1,77 @@ +using Microsoft.AspNetCore.Components; + +namespace LambertzPortal.Components.Shared +{ + public abstract class DrawerStateComponentBase : ComponentBase + { + [SupplyParameterFromQuery(Name = DrawerStateUrlBuilder.DrawerStateQueryParameterName)] + public bool ToggledDrawer { get; set; } + + [Inject] NavigationManager NavigationManager { get; set; } = null!; + + protected string AddDrawerStateToUrl(string baseUrl) + { + return DrawerStateUrlBuilder.AddStateToUrl(baseUrl, ToggledDrawer, NavigationManager); + } + + protected string AddDrawerStateToUrlToggled(string baseUrl) + { + return DrawerStateUrlBuilder.AddStateToUrl(baseUrl, !ToggledDrawer, NavigationManager); + } + + protected string RemoveDrawerStateFromUrl(string baseUrl) + { + return DrawerStateUrlBuilder.RemoveStateFromUrl(baseUrl, NavigationManager); + } + } + + public abstract class DrawerStateLayoutComponentBase : LayoutComponentBase + { + [SupplyParameterFromQuery(Name = DrawerStateUrlBuilder.DrawerStateQueryParameterName)] + public bool ToggledDrawer { get; set; } + + [Inject] NavigationManager NavigationManager { get; set; } = null!; + + protected string AddDrawerStateToUrl(string baseUrl) + { + return DrawerStateUrlBuilder.AddStateToUrl(baseUrl, ToggledDrawer, NavigationManager); + } + + protected string AddDrawerStateToUrlToggled(string baseUrl) + { + return DrawerStateUrlBuilder.AddStateToUrl(baseUrl, !ToggledDrawer, NavigationManager); + } + + protected string RemoveDrawerStateFromUrl(string baseUrl) + { + return DrawerStateUrlBuilder.RemoveStateFromUrl(baseUrl, NavigationManager); + } + } + + internal static class DrawerStateUrlBuilder + { + public const string DrawerStateQueryParameterName = "toggledSidebar"; + + public static string AddStateToUrl(string baseUrl, bool toggledDrawer, NavigationManager navigationManager) + { + return navigationManager.GetUriWithQueryParameters( + baseUrl, + new Dictionary + { + [DrawerStateQueryParameterName] = toggledDrawer ? true : null + } + ); + } + + public static string RemoveStateFromUrl(string baseUrl, NavigationManager navigationManager) + { + return navigationManager.GetUriWithQueryParameters( + baseUrl, + new Dictionary + { + [DrawerStateQueryParameterName] = null + } + ); + } + } +} \ No newline at end of file diff --git a/LambertzPortal/LambertzPortal/Components/_Imports.razor b/LambertzPortal/LambertzPortal/Components/_Imports.razor new file mode 100644 index 0000000..17fc65c --- /dev/null +++ b/LambertzPortal/LambertzPortal/Components/_Imports.razor @@ -0,0 +1,14 @@ +@using System.Net.Http +@using System.Net.Http.Json +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.JSInterop +@using static Microsoft.AspNetCore.Components.Web.RenderMode +@using LambertzPortal +@using LambertzPortal.Components +@using LambertzPortal.Components.Layout +@using LambertzPortal.Components.Shared + +@using DevExpress.Blazor diff --git a/LambertzPortal/LambertzPortal/Data/LambertzDbContext.cs b/LambertzPortal/LambertzPortal/Data/LambertzDbContext.cs new file mode 100644 index 0000000..298ea42 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Data/LambertzDbContext.cs @@ -0,0 +1,54 @@ +using LambertzPortal.Data; +using Microsoft.EntityFrameworkCore; + +namespace LambertzPortal.Services +{ + public class AuthService + { + private readonly LambertzDbContext _db; + + public AuthService(LambertzDbContext db) + { + _db = db; + } + + public async Task<(bool ok, int userId, string userName, List rechte)> ValidateAsync(string benutzername, string passwort) + { + benutzername = benutzername.Trim(); + + var user = await _db.BlazorUser + .Include(u => u.BenutzerBerechtigungen) + .ThenInclude(ub => ub.Berechtigung) + .SingleOrDefaultAsync(u => u.Benutzername == benutzername && u.Aktiv); + + if (user is null) + { + Console.WriteLine($"[LOGIN] ❌ Benutzer '{benutzername}' nicht gefunden oder inaktiv"); + return (false, 0, "", new List()); + } + + // Klartext-Vergleich (nur Test!) + if (!string.Equals(user.PasswortHash, passwort, StringComparison.Ordinal)) + { + Console.WriteLine($"[LOGIN] ❌ Passwort falsch für '{benutzername}'"); + return (false, 0, "", new List()); + } + + // Rechte sammeln + var rechte = user.BenutzerBerechtigungen + .Select(x => x.Berechtigung.Name) + .Where(x => !string.IsNullOrWhiteSpace(x)) + .Distinct() + .ToList(); + + Console.WriteLine($"[LOGIN] ✅ OK: {user.Benutzername} (ID {user.BenutzerId})"); + Console.WriteLine($"[LOGIN] ✅ Rechte: {string.Join(", ", rechte)}"); + + // Optional: LetzterLogin speichern + user.LetzterLogin = DateTime.Now; + await _db.SaveChangesAsync(); + + return (true, user.BenutzerId, user.Benutzername, rechte); + } + } +} diff --git a/LambertzPortal/LambertzPortal/LambertzPortal.csproj b/LambertzPortal/LambertzPortal/LambertzPortal.csproj new file mode 100644 index 0000000..e1fa742 --- /dev/null +++ b/LambertzPortal/LambertzPortal/LambertzPortal.csproj @@ -0,0 +1,17 @@ + + + net8.0 + enable + enable + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/LambertzPortal/LambertzPortal/Models/BlazorBerechtigung.cs b/LambertzPortal/LambertzPortal/Models/BlazorBerechtigung.cs new file mode 100644 index 0000000..8ea8db1 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Models/BlazorBerechtigung.cs @@ -0,0 +1,11 @@ +namespace LambertzPortal.Models +{ + public class BlazorBerechtigung + { + public int BerechtigungId { get; set; } + public string Name { get; set; } = ""; + public string? Beschreibung { get; set; } + + public ICollection BenutzerBerechtigungen { get; set; } = new List(); + } +} diff --git a/LambertzPortal/LambertzPortal/Models/BlazorUser.cs b/LambertzPortal/LambertzPortal/Models/BlazorUser.cs new file mode 100644 index 0000000..3f1a6ef --- /dev/null +++ b/LambertzPortal/LambertzPortal/Models/BlazorUser.cs @@ -0,0 +1,25 @@ +namespace LambertzPortal.Models +{ + public class BlazorUser + { + public int BenutzerId { get; set; } + public string Benutzername { get; set; } = ""; + public string PasswortHash { get; set; } = ""; + + public string Vorname { get; set; } = ""; + public string Nachname { get; set; } = ""; + public string? Anrede { get; set; } + public string? Email { get; set; } + + public int Firmennummer { get; set; } + public string? Abteilung { get; set; } + + public bool Aktiv { get; set; } = true; + public DateTime? LetzterLogin { get; set; } + + public DateTime ErstelltAm { get; set; } + public string? ErstelltVon { get; set; } + + public ICollection BenutzerBerechtigungen { get; set; } = new List(); + } +} diff --git a/LambertzPortal/LambertzPortal/Models/BlazorUserBerechtigung.cs b/LambertzPortal/LambertzPortal/Models/BlazorUserBerechtigung.cs new file mode 100644 index 0000000..be0aa10 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Models/BlazorUserBerechtigung.cs @@ -0,0 +1,11 @@ +namespace LambertzPortal.Models +{ + public class BlazorUserBerechtigung + { + public int BenutzerId { get; set; } + public BlazorUser Benutzer { get; set; } = default!; + + public int BerechtigungId { get; set; } + public BlazorBerechtigung Berechtigung { get; set; } = default!; + } +} diff --git a/LambertzPortal/LambertzPortal/Program.cs b/LambertzPortal/LambertzPortal/Program.cs new file mode 100644 index 0000000..0a72d05 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Program.cs @@ -0,0 +1,57 @@ +using LambertzPortal.Components; +using LambertzPortal.Data; +using LambertzPortal.Services; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authentication.Cookies; +using Microsoft.EntityFrameworkCore; +using System.Security.Claims; + +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. +builder.Services.AddRazorComponents() + .AddInteractiveServerComponents(); + +builder.Services.AddDevExpressBlazor(options => +{ + options.SizeMode = DevExpress.Blazor.SizeMode.Medium; +}); +builder.Services.AddMvc(); + + +builder.Services.AddDbContext(options => options.UseSqlServer(builder.Configuration.GetConnectionString("LambertzDb"))); + + + +builder.Services.AddAuthorization(); +builder.Services.AddCascadingAuthenticationState(); + +builder.Services.AddScoped(); +builder.Services.AddHttpContextAccessor(); + + + + +var app = builder.Build(); + +if (!app.Environment.IsDevelopment()) +{ + app.UseExceptionHandler("/Error", createScopeForErrors: true); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); +} + +app.UseHttpsRedirection(); + +app.UseStaticFiles(); +app.UseAntiforgery(); + +app.UseAuthentication(); +app.UseAuthorization(); + + +app.MapRazorComponents() + .AddInteractiveServerRenderMode() + .AllowAnonymous(); + +app.Run(); \ No newline at end of file diff --git a/LambertzPortal/LambertzPortal/Properties/launchSettings.json b/LambertzPortal/LambertzPortal/Properties/launchSettings.json new file mode 100644 index 0000000..841adea --- /dev/null +++ b/LambertzPortal/LambertzPortal/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/LambertzPortal/LambertzPortal/Services/AuthService.cs b/LambertzPortal/LambertzPortal/Services/AuthService.cs new file mode 100644 index 0000000..f61dcc4 --- /dev/null +++ b/LambertzPortal/LambertzPortal/Services/AuthService.cs @@ -0,0 +1,55 @@ +using LambertzPortal.Models; +using Microsoft.EntityFrameworkCore; + +namespace LambertzPortal.Data +{ + public class LambertzDbContext : DbContext + { + public LambertzDbContext(DbContextOptions options) + : base(options) + { + } + + public DbSet BlazorUser => Set(); + public DbSet BlazorBerechtigung => Set(); + public DbSet BlazorUserBerechtigung => Set(); + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + // Tabellen & Schema + modelBuilder.Entity() + .ToTable("BlazorUser", "LA"); + + modelBuilder.Entity() + .ToTable("BlazorBerechtigung", "LA"); + + modelBuilder.Entity() + .ToTable("BlazorUserBerechtigung", "LA"); + + // Benutzername eindeutig + modelBuilder.Entity() + .HasIndex(x => x.Benutzername) + .IsUnique(); + + // Zusammengesetzter Primärschlüssel + modelBuilder.Entity() + .HasKey(x => new { x.BenutzerId, x.BerechtigungId }); + + // Relation: User → UserBerechtigungen + modelBuilder.Entity() + .HasOne(x => x.Benutzer) + .WithMany(x => x.BenutzerBerechtigungen) + .HasForeignKey(x => x.BenutzerId) + .OnDelete(DeleteBehavior.Cascade); + + // Relation: Berechtigung → UserBerechtigungen + modelBuilder.Entity() + .HasOne(x => x.Berechtigung) + .WithMany(x => x.BenutzerBerechtigungen) + .HasForeignKey(x => x.BerechtigungId) + .OnDelete(DeleteBehavior.Cascade); + + base.OnModelCreating(modelBuilder); + } + } +} diff --git a/LambertzPortal/LambertzPortal/appsettings.Development.json b/LambertzPortal/LambertzPortal/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/LambertzPortal/LambertzPortal/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/LambertzPortal/LambertzPortal/appsettings.json b/LambertzPortal/LambertzPortal/appsettings.json new file mode 100644 index 0000000..7a4eb80 --- /dev/null +++ b/LambertzPortal/LambertzPortal/appsettings.json @@ -0,0 +1,13 @@ +{ + + "ConnectionStrings": { + "LambertzDb": "Server=app03ac;Database=Lambertz;User ID=LA;Password=la;TrustServerCertificate=True;" + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/LambertzPortal/LambertzPortal/wwwroot/css/icons.css b/LambertzPortal/LambertzPortal/wwwroot/css/icons.css new file mode 100644 index 0000000..bfde075 --- /dev/null +++ b/LambertzPortal/LambertzPortal/wwwroot/css/icons.css @@ -0,0 +1,35 @@ +.icon { + width: 1.25rem; + height: 1.25rem; + background-color: currentcolor; + mask-image: var(--icon-mask-image); + mask-position: center; + mask-repeat: no-repeat; +} + +.icon-back { + --icon-mask-image: url("/images/back.svg"); +} +.icon-close { + --icon-mask-image: url("/images/close.svg"); +} +.icon-demos { + --icon-mask-image: url("/images/demos.svg"); +} +.icon-docs { + --icon-mask-image: url("/images/doc.svg"); +} +.icon-menu { + --icon-mask-image: url("/images/menu.svg"); +} + +/* pages */ +.icon-counter { + --icon-mask-image: url("/images/pages/counter.svg"); +} +.icon-home { + --icon-mask-image: url("/images/pages/home.svg"); +} +.icon-weather { + --icon-mask-image: url("/images/pages/weather.svg"); +} diff --git a/LambertzPortal/LambertzPortal/wwwroot/css/site.css b/LambertzPortal/LambertzPortal/wwwroot/css/site.css new file mode 100644 index 0000000..b12ac59 --- /dev/null +++ b/LambertzPortal/LambertzPortal/wwwroot/css/site.css @@ -0,0 +1,79 @@ +@import url('./icons.css'); + +html, body { + display: flex; + flex-direction: column; + height: 100%; + overflow: hidden; + margin: 0; +} + +.w-100 { + width: 100% !important; +} + +.h-100 { + height: 100% !important; +} + +.h-auto { + height: auto !important; +} + +.overflow-hidden { + overflow: hidden !important; +} + +.text-danger { + color: var(--dxds-color-content-danger-default-rest); +} + +.valid.modified:not([type=checkbox]) { + outline: 1px solid var(--dxds-color-border-success-default-rest); +} + +.invalid { + outline: 1px solid var(--dxds-color-border-danger-default-rest); +} + +.validation-message { + color: var(--dxds-color-content-danger-default-rest); +} + +.button-link { + text-decoration: unset; +} + +.title { + display: flex; + flex-direction: column; + gap: 0.5rem; + padding: 1rem 0; +} + +.title.title-secondary { + padding: 0.313rem 0 0; + color: var(--dxds-color-content-secondary-default-rest); +} + +.title-header-text { + font-size: var(--dxds-font-size-headline-lg); + font-weight: var(--dxds-font-weight-headline-default); + letter-spacing: var(--dxds-letter-spacing-headline-lg); + line-height: var(--dxds-line-height-headline-lg); +} + +.title-content-text { + font-size: var(--dxds-font-size-base-lg); + font-weight: var(--dxds-font-weight-base-default); + letter-spacing: var(--dxds-letter-spacing-base-lg); + line-height: var(--dxds-line-height-base-lg); +} + +.main-content { + align-items: center; + display: flex; + height: 100%; + justify-content: center; + width: 100%; +} diff --git a/LambertzPortal/LambertzPortal/wwwroot/favicon.ico b/LambertzPortal/LambertzPortal/wwwroot/favicon.ico new file mode 100644 index 0000000..df1ae2f Binary files /dev/null and b/LambertzPortal/LambertzPortal/wwwroot/favicon.ico differ diff --git a/LambertzPortal/LambertzPortal/wwwroot/images/back.svg b/LambertzPortal/LambertzPortal/wwwroot/images/back.svg new file mode 100644 index 0000000..8a40753 --- /dev/null +++ b/LambertzPortal/LambertzPortal/wwwroot/images/back.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortal/LambertzPortal/wwwroot/images/cards.svg b/LambertzPortal/LambertzPortal/wwwroot/images/cards.svg new file mode 100644 index 0000000..ffa3334 --- /dev/null +++ b/LambertzPortal/LambertzPortal/wwwroot/images/cards.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LambertzPortal/LambertzPortal/wwwroot/images/close.svg b/LambertzPortal/LambertzPortal/wwwroot/images/close.svg new file mode 100644 index 0000000..137b5b3 --- /dev/null +++ b/LambertzPortal/LambertzPortal/wwwroot/images/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortal/LambertzPortal/wwwroot/images/demos.svg b/LambertzPortal/LambertzPortal/wwwroot/images/demos.svg new file mode 100644 index 0000000..f58c385 --- /dev/null +++ b/LambertzPortal/LambertzPortal/wwwroot/images/demos.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortal/LambertzPortal/wwwroot/images/doc.svg b/LambertzPortal/LambertzPortal/wwwroot/images/doc.svg new file mode 100644 index 0000000..64a8098 --- /dev/null +++ b/LambertzPortal/LambertzPortal/wwwroot/images/doc.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortal/LambertzPortal/wwwroot/images/logo.svg b/LambertzPortal/LambertzPortal/wwwroot/images/logo.svg new file mode 100644 index 0000000..2bbbb18 --- /dev/null +++ b/LambertzPortal/LambertzPortal/wwwroot/images/logo.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/LambertzPortal/LambertzPortal/wwwroot/images/menu.svg b/LambertzPortal/LambertzPortal/wwwroot/images/menu.svg new file mode 100644 index 0000000..cfe69db --- /dev/null +++ b/LambertzPortal/LambertzPortal/wwwroot/images/menu.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortal/LambertzPortal/wwwroot/images/pages/counter.svg b/LambertzPortal/LambertzPortal/wwwroot/images/pages/counter.svg new file mode 100644 index 0000000..6eb7b54 --- /dev/null +++ b/LambertzPortal/LambertzPortal/wwwroot/images/pages/counter.svg @@ -0,0 +1,4 @@ + + + + diff --git a/LambertzPortal/LambertzPortal/wwwroot/images/pages/home.svg b/LambertzPortal/LambertzPortal/wwwroot/images/pages/home.svg new file mode 100644 index 0000000..495c6c5 --- /dev/null +++ b/LambertzPortal/LambertzPortal/wwwroot/images/pages/home.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortal/LambertzPortal/wwwroot/images/pages/weather.svg b/LambertzPortal/LambertzPortal/wwwroot/images/pages/weather.svg new file mode 100644 index 0000000..c69e562 --- /dev/null +++ b/LambertzPortal/LambertzPortal/wwwroot/images/pages/weather.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortalControlling/LambertzPortalControlling.sln b/LambertzPortalControlling/LambertzPortalControlling.sln new file mode 100644 index 0000000..a0982da --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36915.13 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambertzPortalControlling", "LambertzPortalControlling\LambertzPortalControlling.csproj", "{1CF4CA23-F9E0-49F4-A0AF-5CA26EE95486}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1CF4CA23-F9E0-49F4-A0AF-5CA26EE95486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1CF4CA23-F9E0-49F4-A0AF-5CA26EE95486}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1CF4CA23-F9E0-49F4-A0AF-5CA26EE95486}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1CF4CA23-F9E0-49F4-A0AF-5CA26EE95486}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5122DC25-1170-47BD-A077-E824192DAA2D} + EndGlobalSection +EndGlobal diff --git a/LambertzPortalControlling/LambertzPortalControlling/.config/dotnet-tools.json b/LambertzPortalControlling/LambertzPortalControlling/.config/dotnet-tools.json new file mode 100644 index 0000000..a74bf0b --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/.config/dotnet-tools.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ef": { + "version": "10.0.2", + "commands": [ + "dotnet-ef" + ], + "rollForward": false + } + } +} \ No newline at end of file diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/App.razor b/LambertzPortalControlling/LambertzPortalControlling/Components/App.razor new file mode 100644 index 0000000..6635fc6 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/App.razor @@ -0,0 +1,37 @@ +@using Microsoft.AspNetCore.Mvc.ViewFeatures +@inject IFileVersionProvider FileVersionProvider + + + + + + + + @DxResourceManager.RegisterTheme(ActiveTheme) + @DxResourceManager.RegisterScripts() + + + + + + + + + + +@code { + static readonly ITheme ActiveTheme = Themes.Fluent.Clone(properties => { + properties.Mode = ThemeMode.Light; + }); + + [CascadingParameter] + private HttpContext HttpContext { get; set; } = default!; + + private string AppendVersion(string path) + => FileVersionProvider.AddFileVersionToPath( + HttpContext.Request.PathBase.HasValue + ? HttpContext.Request.PathBase.Value + : "/", + path); + +} diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/Drawer.razor b/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/Drawer.razor new file mode 100644 index 0000000..73a8d3e --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/Drawer.razor @@ -0,0 +1,38 @@ +@inherits DrawerStateComponentBase + +
+ + + + + + @TargetContent + + + + +
+ +@code { + [Parameter] public string? CssClass { get; set; } + [Parameter] public string? PanelWidth { get; set; } + [Parameter] public RenderFragment? TargetContent { get; set; } + [Parameter] public RenderFragment? BodyTemplate { get; set; } + [Parameter] public RenderFragment? HeaderTemplate { get; set; } + [Parameter] public RenderFragment? FooterTemplate { get; set; } +} \ No newline at end of file diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/Drawer.razor.css b/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/Drawer.razor.css new file mode 100644 index 0000000..ad63fbe --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/Drawer.razor.css @@ -0,0 +1,53 @@ +.drawer-container { + height: 100%; +} + +.navigation-drawer-shading { + height: 100%; + position: absolute; + transition: ease 300ms; + transition-property: opacity, visibility; + visibility: visible; + width: 100%; + z-index: 99; + background-color: var(--dxds-color-surface-backdrop-default-rest); +} + +.navigation-drawer.mobile.panel-closed .navigation-drawer-shading { + opacity: 0; + visibility: hidden; +} + +::deep .navigation-drawer > .dxbl-drawer-panel { + display: flex; +} + +::deep .navigation-drawer.mobile > .dxbl-drawer-panel { + display: none; +} + +.navigation-drawer-shading { + display: none; +} + +::deep .panel-open:not(.mobile) .nav-buttons-container .menu-button { + display: none; +} + +@media (max-width: 768px) { + ::deep .navigation-drawer > .dxbl-drawer-panel { + display: none; + } + + ::deep .navigation-drawer.mobile > .dxbl-drawer-panel { + display: flex; + } + + .navigation-drawer-shading { + display: block; + } + + ::deep .panel-open:not(.mobile) .nav-buttons-container .menu-button { + display: flex; + } +} diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/MainLayout.razor b/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/MainLayout.razor new file mode 100644 index 0000000..e4eae84 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/MainLayout.razor @@ -0,0 +1,53 @@ +@inherits DrawerStateLayoutComponentBase +@inject NavigationManager NavigationManager + +
+ + + + + +
+ +
+
+ + + + +
+ +
+ @Body +
+
+
+
+
+ +@code { + string LocalPath => new Uri(NavigationManager.Uri).LocalPath; +} \ No newline at end of file diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/MainLayout.razor.css b/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/MainLayout.razor.css new file mode 100644 index 0000000..de971f8 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/MainLayout.razor.css @@ -0,0 +1,67 @@ +.page { + height: 100%; + min-height: 0; +} + +::deep .navigation-drawer { + --dxbl-drawer-panel-body-padding-x: 0; + --dxbl-drawer-panel-body-padding-y: 1rem; + --dxbl-drawer-panel-footer-bg: none; + --dxbl-drawer-panel-header-bg: none; + --dxbl-drawer-separator-border-width: 0; +} + +::deep .navigation-drawer > .dxbl-drawer-panel { + background-image: linear-gradient(180deg, var(--dxds-color-surface-primary-default-rest) 0%, var(--dxds-primary-170) 150%); +} + +.navigation-drawer-header { + align-items: center; + display: flex; + justify-content: space-between; + padding: 1.375rem 0.375rem; + width: 100%; +} + +.navigation-drawer-header .logo { + height: 1.5rem; + width: 9rem; +} + +.navigation-drawer-footer { + display: flex; + justify-content: space-evenly; + padding-bottom: 0.875rem; + width: 100%; +} + +.drawer-content { + display: flex; + flex-direction: column; + height: 100%; + overflow: auto; + padding: 2rem 1.5rem 1.5rem 1.5rem; +} + +.nav-buttons-container { + align-items: center; + display: flex; + gap: 0.625rem; + min-height: 2rem; +} + +::deep .nav-buttons-container > a { + color: inherit; +} + +::deep .nav-buttons-container .back-button { + padding-left: 0; + padding-right: 0.25rem; +} + +.page-content-container { + display: flex; + flex-direction: column; + flex-grow: 1; + min-height: 0; +} diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/NavMenu.razor b/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/NavMenu.razor new file mode 100644 index 0000000..1f38a0d --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/NavMenu.razor @@ -0,0 +1,33 @@ +@inject NavigationManager NavigationManager +@implements IDisposable + +
+ + + + + + +
+ +@code { + private string? currentLocalPath; + + protected override void OnInitialized() { + currentLocalPath = new Uri(NavigationManager.Uri).LocalPath; + NavigationManager.LocationChanged += OnLocationChanged; + } + + private void OnLocationChanged(object? sender, LocationChangedEventArgs e) { + currentLocalPath = new Uri(NavigationManager.Uri).LocalPath; + InvokeAsync(StateHasChanged); + } + + private string? MenuItemCssClass(string itemPath) { + return string.Equals(currentLocalPath, itemPath, StringComparison.OrdinalIgnoreCase) ? "menu-item-active" : null; + } + + public void Dispose() { + NavigationManager.LocationChanged -= OnLocationChanged; + } +} \ No newline at end of file diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/NavMenu.razor.css b/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/NavMenu.razor.css new file mode 100644 index 0000000..eace38e --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Layout/NavMenu.razor.css @@ -0,0 +1,23 @@ +::deep .menu { + --dxbl-menu-bottom-left-border-radius: 0; + --dxbl-menu-bottom-right-border-radius: 0; + --dxbl-menu-top-left-border-radius: 0; + --dxbl-menu-top-right-border-radius: 0; + --dxbl-menu-item-padding-x: 1.125rem; + --dxbl-menu-item-padding-y: 0.5rem; + --dxbl-menu-item-color: var(--dxds-color-content-neutral-default-static-dark-rest); + --dxbl-menu-item-image-color: var(--dxds-color-content-neutral-default-static-dark-rest); + --dxbl-menu-item-hover-bg: rgb(from var(--dxds-color-surface-neutral-default-static-light-rest) r g b / 0.15); + --dxbl-menu-item-hover-color: var(--dxds-color-content-neutral-default-static-dark-hovered); + --dxbl-menu-item-hover-image-color: var(--dxds-color-content-neutral-default-static-dark-hovered); + + background: none; +} + +::deep .menu.display-mobile { + margin-bottom: 2rem; +} + +::deep .menu-item-active { + background-color: rgb(from var(--dxds-color-surface-neutral-default-static-light-rest) r g b / 0.05); +} diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Counter.razor b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Counter.razor new file mode 100644 index 0000000..ed65882 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Counter.razor @@ -0,0 +1,24 @@ +@page "/counter" + +Counter + +

Counter

+ +
+
+
+ @currentCount +
+ current count +
+ Click me +
+ +@code { + private int currentCount; + + private void IncrementCount() + { + currentCount++; + } +} diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Counter.razor.css b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Counter.razor.css new file mode 100644 index 0000000..73f0c69 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Counter.razor.css @@ -0,0 +1,25 @@ +.counter-block { + align-items: center; + border-radius: 1rem; + display: flex; + flex-direction: column; + gap: 1.5rem; + height: 17rem; + justify-content: center; + padding: 2.5rem 1.5rem 1.5rem; + width: 16.875rem; + border: 1px solid var(--dxds-color-border-neutral-default-rest); +} + +.counter-block .counter-content { + align-items: center; + display: flex; + flex-direction: column; + gap: 0.5rem; +} + +.counter-block .counter-count { + font-size: 7.5rem; + font-weight: 400; + line-height: 7.75rem; +} diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Error.razor b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Error.razor new file mode 100644 index 0000000..576cc2d --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Error.razor @@ -0,0 +1,36 @@ +@page "/Error" +@using System.Diagnostics + +Error + +

Error.

+

An error occurred while processing your request.

+ +@if (ShowRequestId) +{ +

+ Request ID: @RequestId +

+} + +

Development Mode

+

+ Swapping to Development environment will display more detailed information about the error that occurred. +

+

+ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +

+ +@code{ + [CascadingParameter] + private HttpContext? HttpContext { get; set; } + + private string? RequestId { get; set; } + private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + protected override void OnInitialized() => + RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; +} diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Index/Index.razor b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Index/Index.razor new file mode 100644 index 0000000..6b9e165 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Index/Index.razor @@ -0,0 +1,26 @@ +@page "/" + +Controlling + +
+ + + + + + + + + + + + + + +
diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Index/Index.razor.css b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Index/Index.razor.css new file mode 100644 index 0000000..c1ef55c --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Index/Index.razor.css @@ -0,0 +1,31 @@ +::deep .index-gridlayout { + container-type: inline-size; + height: auto; + margin-top: auto; + margin-bottom: auto; + padding-bottom: 9rem; +} + +::deep .title { + padding-bottom: 3rem; + text-align: center; +} + +::deep .tiles { + --tile-column-count: 4; + + display: grid; + gap: 1rem; + grid-template-columns: repeat(var(--tile-column-count), max-content); + justify-content: center; + + @container (max-width: 60.5rem) { + --tile-column-count: 3; + } + @container (max-width: 45.125rem) { + --tile-column-count: 2; + } + @container (max-width: 29.75rem) { + --tile-column-count: 1; + } +} \ No newline at end of file diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Index/IndexTile.razor b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Index/IndexTile.razor new file mode 100644 index 0000000..fbfcd44 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Index/IndexTile.razor @@ -0,0 +1,40 @@ +@inherits DrawerStateComponentBase + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +@code { + [Parameter] public string NavigateUrl { get; set; } = string.Empty; + [Parameter] public string? Title { get; set; } + [Parameter] public string? Description { get; set; } + [Parameter] public string? IconCssClass { get; set; } +} \ No newline at end of file diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Index/IndexTile.razor.css b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Index/IndexTile.razor.css new file mode 100644 index 0000000..c399a0b --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Index/IndexTile.razor.css @@ -0,0 +1,44 @@ +.tile { + border-radius: 0.75rem; + height: 7.5rem; + transition: box-shadow 0.2s; + width: 14.375rem; + border: 1px solid var(--dxds-color-border-neutral-default-rest); +} + +.tile:hover { + box-shadow: 0 4px 8px 0 rgba(170, 170, 170, 0.24), 0 0 2px 0 rgba(170, 170, 170, 0.2); +} + +.tile ::deep > a { + text-decoration: none; +} + +::deep .tile-content { + padding: 1rem; +} + +::deep .tile-icon { + border-radius: 0.375rem; + height: 2.75rem; + padding: 0.75rem; + width: 2.75rem; + border: 1px solid var(--dxds-color-border-neutral-default-rest); +} + +::deep .tile-title { + align-self: center; + color: var(--dxds-color-content-neutral-default-rest); + font-size: var(--dxds-font-size-base-md); + font-weight: var(--dxds-font-weight-base-strong); + letter-spacing: var(--dxds-letter-spacing-base-md); + line-height: var(--dxds-line-height-base-md); +} + +::deep .tile-description { + color: var(--dxds-color-content-neutral-subdued-rest); + font-size: var(--dxds-font-size-base-sm); + font-weight: var(--dxds-font-weight-base-default); + letter-spacing: var(--dxds-letter-spacing-base-sm); + line-height: var(--dxds-line-height-base-sm); +} \ No newline at end of file diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Weather.razor b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Weather.razor new file mode 100644 index 0000000..7b10b76 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Pages/Weather.razor @@ -0,0 +1,32 @@ +@page "/weather" + +Weather + +

Weather

+ + + + + + + + + + +@code { + private WeatherForecast[]? forecasts; + + protected override async Task OnInitializedAsync() { + DateOnly startDate = DateOnly.FromDateTime(DateTime.Now); + string[] summaries = ["Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"]; + forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast( + Date: startDate.AddDays(index), + TemperatureC: Random.Shared.Next(-20, 55), + Summary: summaries[Random.Shared.Next(summaries.Length)] + )).ToArray(); + } + + private record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) { + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + } +} diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Routes.razor b/LambertzPortalControlling/LambertzPortalControlling/Components/Routes.razor new file mode 100644 index 0000000..a3c9db7 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Routes.razor @@ -0,0 +1,10 @@ + + + + + + +

Sorry, there's nothing at this address.

+
+
+
\ No newline at end of file diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/Shared/DrawerStateComponentBase.cs b/LambertzPortalControlling/LambertzPortalControlling/Components/Shared/DrawerStateComponentBase.cs new file mode 100644 index 0000000..2839bb7 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/Shared/DrawerStateComponentBase.cs @@ -0,0 +1,77 @@ +using Microsoft.AspNetCore.Components; + +namespace LambertzPortalControlling.Components.Shared +{ + public abstract class DrawerStateComponentBase : ComponentBase + { + [SupplyParameterFromQuery(Name = DrawerStateUrlBuilder.DrawerStateQueryParameterName)] + public bool ToggledDrawer { get; set; } + + [Inject] NavigationManager NavigationManager { get; set; } = null!; + + protected string AddDrawerStateToUrl(string baseUrl) + { + return DrawerStateUrlBuilder.AddStateToUrl(baseUrl, ToggledDrawer, NavigationManager); + } + + protected string AddDrawerStateToUrlToggled(string baseUrl) + { + return DrawerStateUrlBuilder.AddStateToUrl(baseUrl, !ToggledDrawer, NavigationManager); + } + + protected string RemoveDrawerStateFromUrl(string baseUrl) + { + return DrawerStateUrlBuilder.RemoveStateFromUrl(baseUrl, NavigationManager); + } + } + + public abstract class DrawerStateLayoutComponentBase : LayoutComponentBase + { + [SupplyParameterFromQuery(Name = DrawerStateUrlBuilder.DrawerStateQueryParameterName)] + public bool ToggledDrawer { get; set; } + + [Inject] NavigationManager NavigationManager { get; set; } = null!; + + protected string AddDrawerStateToUrl(string baseUrl) + { + return DrawerStateUrlBuilder.AddStateToUrl(baseUrl, ToggledDrawer, NavigationManager); + } + + protected string AddDrawerStateToUrlToggled(string baseUrl) + { + return DrawerStateUrlBuilder.AddStateToUrl(baseUrl, !ToggledDrawer, NavigationManager); + } + + protected string RemoveDrawerStateFromUrl(string baseUrl) + { + return DrawerStateUrlBuilder.RemoveStateFromUrl(baseUrl, NavigationManager); + } + } + + internal static class DrawerStateUrlBuilder + { + public const string DrawerStateQueryParameterName = "toggledSidebar"; + + public static string AddStateToUrl(string baseUrl, bool toggledDrawer, NavigationManager navigationManager) + { + return navigationManager.GetUriWithQueryParameters( + baseUrl, + new Dictionary + { + [DrawerStateQueryParameterName] = toggledDrawer ? true : null + } + ); + } + + public static string RemoveStateFromUrl(string baseUrl, NavigationManager navigationManager) + { + return navigationManager.GetUriWithQueryParameters( + baseUrl, + new Dictionary + { + [DrawerStateQueryParameterName] = null + } + ); + } + } +} \ No newline at end of file diff --git a/LambertzPortalControlling/LambertzPortalControlling/Components/_Imports.razor b/LambertzPortalControlling/LambertzPortalControlling/Components/_Imports.razor new file mode 100644 index 0000000..aea831e --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Components/_Imports.razor @@ -0,0 +1,14 @@ +@using System.Net.Http +@using System.Net.Http.Json +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.JSInterop +@using static Microsoft.AspNetCore.Components.Web.RenderMode +@using LambertzPortalControlling +@using LambertzPortalControlling.Components +@using LambertzPortalControlling.Components.Layout +@using LambertzPortalControlling.Components.Shared + +@using DevExpress.Blazor diff --git a/LambertzPortalControlling/LambertzPortalControlling/LambertzPortalControlling.csproj b/LambertzPortalControlling/LambertzPortalControlling/LambertzPortalControlling.csproj new file mode 100644 index 0000000..2906389 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/LambertzPortalControlling.csproj @@ -0,0 +1,11 @@ + + + net8.0 + enable + enable + + + + + + diff --git a/LambertzPortalControlling/LambertzPortalControlling/Program.cs b/LambertzPortalControlling/LambertzPortalControlling/Program.cs new file mode 100644 index 0000000..19612d8 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Program.cs @@ -0,0 +1,33 @@ +using LambertzPortalControlling.Components; + +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. +builder.Services.AddRazorComponents() + .AddInteractiveServerComponents(); + +builder.Services.AddDevExpressBlazor(options => +{ + options.SizeMode = DevExpress.Blazor.SizeMode.Medium; +}); +builder.Services.AddMvc(); + +var app = builder.Build(); + +if (!app.Environment.IsDevelopment()) +{ + app.UseExceptionHandler("/Error", createScopeForErrors: true); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); +} +app.UsePathBase("/controlling"); +app.UseHttpsRedirection(); + +app.UseStaticFiles(); +app.UseAntiforgery(); + +app.MapRazorComponents() + .AddInteractiveServerRenderMode() + .AllowAnonymous(); + +app.Run(); \ No newline at end of file diff --git a/LambertzPortalControlling/LambertzPortalControlling/Properties/launchSettings.json b/LambertzPortalControlling/LambertzPortalControlling/Properties/launchSettings.json new file mode 100644 index 0000000..841adea --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/LambertzPortalControlling/LambertzPortalControlling/appsettings.Development.json b/LambertzPortalControlling/LambertzPortalControlling/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/LambertzPortalControlling/LambertzPortalControlling/appsettings.json b/LambertzPortalControlling/LambertzPortalControlling/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/LambertzPortalControlling/LambertzPortalControlling/wwwroot/css/icons.css b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/css/icons.css new file mode 100644 index 0000000..bfde075 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/css/icons.css @@ -0,0 +1,35 @@ +.icon { + width: 1.25rem; + height: 1.25rem; + background-color: currentcolor; + mask-image: var(--icon-mask-image); + mask-position: center; + mask-repeat: no-repeat; +} + +.icon-back { + --icon-mask-image: url("/images/back.svg"); +} +.icon-close { + --icon-mask-image: url("/images/close.svg"); +} +.icon-demos { + --icon-mask-image: url("/images/demos.svg"); +} +.icon-docs { + --icon-mask-image: url("/images/doc.svg"); +} +.icon-menu { + --icon-mask-image: url("/images/menu.svg"); +} + +/* pages */ +.icon-counter { + --icon-mask-image: url("/images/pages/counter.svg"); +} +.icon-home { + --icon-mask-image: url("/images/pages/home.svg"); +} +.icon-weather { + --icon-mask-image: url("/images/pages/weather.svg"); +} diff --git a/LambertzPortalControlling/LambertzPortalControlling/wwwroot/css/site.css b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/css/site.css new file mode 100644 index 0000000..b12ac59 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/css/site.css @@ -0,0 +1,79 @@ +@import url('./icons.css'); + +html, body { + display: flex; + flex-direction: column; + height: 100%; + overflow: hidden; + margin: 0; +} + +.w-100 { + width: 100% !important; +} + +.h-100 { + height: 100% !important; +} + +.h-auto { + height: auto !important; +} + +.overflow-hidden { + overflow: hidden !important; +} + +.text-danger { + color: var(--dxds-color-content-danger-default-rest); +} + +.valid.modified:not([type=checkbox]) { + outline: 1px solid var(--dxds-color-border-success-default-rest); +} + +.invalid { + outline: 1px solid var(--dxds-color-border-danger-default-rest); +} + +.validation-message { + color: var(--dxds-color-content-danger-default-rest); +} + +.button-link { + text-decoration: unset; +} + +.title { + display: flex; + flex-direction: column; + gap: 0.5rem; + padding: 1rem 0; +} + +.title.title-secondary { + padding: 0.313rem 0 0; + color: var(--dxds-color-content-secondary-default-rest); +} + +.title-header-text { + font-size: var(--dxds-font-size-headline-lg); + font-weight: var(--dxds-font-weight-headline-default); + letter-spacing: var(--dxds-letter-spacing-headline-lg); + line-height: var(--dxds-line-height-headline-lg); +} + +.title-content-text { + font-size: var(--dxds-font-size-base-lg); + font-weight: var(--dxds-font-weight-base-default); + letter-spacing: var(--dxds-letter-spacing-base-lg); + line-height: var(--dxds-line-height-base-lg); +} + +.main-content { + align-items: center; + display: flex; + height: 100%; + justify-content: center; + width: 100%; +} diff --git a/LambertzPortalControlling/LambertzPortalControlling/wwwroot/favicon.ico b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/favicon.ico new file mode 100644 index 0000000..df1ae2f Binary files /dev/null and b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/favicon.ico differ diff --git a/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/back.svg b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/back.svg new file mode 100644 index 0000000..8a40753 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/back.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/cards.svg b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/cards.svg new file mode 100644 index 0000000..ffa3334 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/cards.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/close.svg b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/close.svg new file mode 100644 index 0000000..137b5b3 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/demos.svg b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/demos.svg new file mode 100644 index 0000000..f58c385 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/demos.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/doc.svg b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/doc.svg new file mode 100644 index 0000000..64a8098 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/doc.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/logo.svg b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/logo.svg new file mode 100644 index 0000000..2bbbb18 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/logo.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/menu.svg b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/menu.svg new file mode 100644 index 0000000..cfe69db --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/menu.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/pages/counter.svg b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/pages/counter.svg new file mode 100644 index 0000000..6eb7b54 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/pages/counter.svg @@ -0,0 +1,4 @@ + + + + diff --git a/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/pages/home.svg b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/pages/home.svg new file mode 100644 index 0000000..495c6c5 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/pages/home.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/pages/weather.svg b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/pages/weather.svg new file mode 100644 index 0000000..c69e562 --- /dev/null +++ b/LambertzPortalControlling/LambertzPortalControlling/wwwroot/images/pages/weather.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf.sln b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf.sln new file mode 100644 index 0000000..c5b49c7 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36915.13 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambertzPortalPersonalverkauf", "LambertzPortalPersonalverkauf\LambertzPortalPersonalverkauf.csproj", "{5A65F5C1-6C5C-4896-98D7-37D78E826C7B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5A65F5C1-6C5C-4896-98D7-37D78E826C7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5A65F5C1-6C5C-4896-98D7-37D78E826C7B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5A65F5C1-6C5C-4896-98D7-37D78E826C7B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5A65F5C1-6C5C-4896-98D7-37D78E826C7B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3E23F239-E222-403B-B2A8-9F322505F12C} + EndGlobalSection +EndGlobal diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/App.razor b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/App.razor new file mode 100644 index 0000000..4ef566c --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/App.razor @@ -0,0 +1,49 @@ +@using Microsoft.AspNetCore.Mvc.ViewFeatures +@inject IFileVersionProvider FileVersionProvider + + + + + + + + @DxResourceManager.RegisterTheme(ActiveTheme) + @DxResourceManager.RegisterScripts() + + + + + + + + + + +@code { + + static readonly ITheme ActiveTheme = Themes.Fluent.Clone(properties => + { + properties.Mode = ThemeMode.Light; + }); + + [CascadingParameter] + private HttpContext HttpContext { get; set; } = default!; + + private string AppendVersion(string path) + => FileVersionProvider.AddFileVersionToPath( + HttpContext.Request.PathBase.HasValue + ? HttpContext.Request.PathBase.Value + : "/", + path); +} + +@* @code { + static readonly ITheme ActiveTheme = Themes.Fluent.Clone(properties => { + properties.Mode = ThemeMode.Light; + }); + + private string AppendVersion(string path) => FileVersionProvider.AddFileVersionToPath("/", path); + +} *@ + + diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/Drawer.razor b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/Drawer.razor new file mode 100644 index 0000000..73a8d3e --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/Drawer.razor @@ -0,0 +1,38 @@ +@inherits DrawerStateComponentBase + +
+ + + + + + @TargetContent + + + + +
+ +@code { + [Parameter] public string? CssClass { get; set; } + [Parameter] public string? PanelWidth { get; set; } + [Parameter] public RenderFragment? TargetContent { get; set; } + [Parameter] public RenderFragment? BodyTemplate { get; set; } + [Parameter] public RenderFragment? HeaderTemplate { get; set; } + [Parameter] public RenderFragment? FooterTemplate { get; set; } +} \ No newline at end of file diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/Drawer.razor.css b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/Drawer.razor.css new file mode 100644 index 0000000..ad63fbe --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/Drawer.razor.css @@ -0,0 +1,53 @@ +.drawer-container { + height: 100%; +} + +.navigation-drawer-shading { + height: 100%; + position: absolute; + transition: ease 300ms; + transition-property: opacity, visibility; + visibility: visible; + width: 100%; + z-index: 99; + background-color: var(--dxds-color-surface-backdrop-default-rest); +} + +.navigation-drawer.mobile.panel-closed .navigation-drawer-shading { + opacity: 0; + visibility: hidden; +} + +::deep .navigation-drawer > .dxbl-drawer-panel { + display: flex; +} + +::deep .navigation-drawer.mobile > .dxbl-drawer-panel { + display: none; +} + +.navigation-drawer-shading { + display: none; +} + +::deep .panel-open:not(.mobile) .nav-buttons-container .menu-button { + display: none; +} + +@media (max-width: 768px) { + ::deep .navigation-drawer > .dxbl-drawer-panel { + display: none; + } + + ::deep .navigation-drawer.mobile > .dxbl-drawer-panel { + display: flex; + } + + .navigation-drawer-shading { + display: block; + } + + ::deep .panel-open:not(.mobile) .nav-buttons-container .menu-button { + display: flex; + } +} diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/MainLayout.razor b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/MainLayout.razor new file mode 100644 index 0000000..e4eae84 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/MainLayout.razor @@ -0,0 +1,53 @@ +@inherits DrawerStateLayoutComponentBase +@inject NavigationManager NavigationManager + +
+ + + + + +
+ +
+
+ + + + +
+ +
+ @Body +
+
+
+
+
+ +@code { + string LocalPath => new Uri(NavigationManager.Uri).LocalPath; +} \ No newline at end of file diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/MainLayout.razor.css b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/MainLayout.razor.css new file mode 100644 index 0000000..de971f8 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/MainLayout.razor.css @@ -0,0 +1,67 @@ +.page { + height: 100%; + min-height: 0; +} + +::deep .navigation-drawer { + --dxbl-drawer-panel-body-padding-x: 0; + --dxbl-drawer-panel-body-padding-y: 1rem; + --dxbl-drawer-panel-footer-bg: none; + --dxbl-drawer-panel-header-bg: none; + --dxbl-drawer-separator-border-width: 0; +} + +::deep .navigation-drawer > .dxbl-drawer-panel { + background-image: linear-gradient(180deg, var(--dxds-color-surface-primary-default-rest) 0%, var(--dxds-primary-170) 150%); +} + +.navigation-drawer-header { + align-items: center; + display: flex; + justify-content: space-between; + padding: 1.375rem 0.375rem; + width: 100%; +} + +.navigation-drawer-header .logo { + height: 1.5rem; + width: 9rem; +} + +.navigation-drawer-footer { + display: flex; + justify-content: space-evenly; + padding-bottom: 0.875rem; + width: 100%; +} + +.drawer-content { + display: flex; + flex-direction: column; + height: 100%; + overflow: auto; + padding: 2rem 1.5rem 1.5rem 1.5rem; +} + +.nav-buttons-container { + align-items: center; + display: flex; + gap: 0.625rem; + min-height: 2rem; +} + +::deep .nav-buttons-container > a { + color: inherit; +} + +::deep .nav-buttons-container .back-button { + padding-left: 0; + padding-right: 0.25rem; +} + +.page-content-container { + display: flex; + flex-direction: column; + flex-grow: 1; + min-height: 0; +} diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/NavMenu.razor b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/NavMenu.razor new file mode 100644 index 0000000..fea8ba5 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/NavMenu.razor @@ -0,0 +1,34 @@ +@inject NavigationManager NavigationManager +@implements IDisposable + +
+ + + + + + + +
+ +@code { + private string? currentLocalPath; + + protected override void OnInitialized() { + currentLocalPath = new Uri(NavigationManager.Uri).LocalPath; + NavigationManager.LocationChanged += OnLocationChanged; + } + + private void OnLocationChanged(object? sender, LocationChangedEventArgs e) { + currentLocalPath = new Uri(NavigationManager.Uri).LocalPath; + InvokeAsync(StateHasChanged); + } + + private string? MenuItemCssClass(string itemPath) { + return string.Equals(currentLocalPath, itemPath, StringComparison.OrdinalIgnoreCase) ? "menu-item-active" : null; + } + + public void Dispose() { + NavigationManager.LocationChanged -= OnLocationChanged; + } +} \ No newline at end of file diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/NavMenu.razor.css b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/NavMenu.razor.css new file mode 100644 index 0000000..eace38e --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Layout/NavMenu.razor.css @@ -0,0 +1,23 @@ +::deep .menu { + --dxbl-menu-bottom-left-border-radius: 0; + --dxbl-menu-bottom-right-border-radius: 0; + --dxbl-menu-top-left-border-radius: 0; + --dxbl-menu-top-right-border-radius: 0; + --dxbl-menu-item-padding-x: 1.125rem; + --dxbl-menu-item-padding-y: 0.5rem; + --dxbl-menu-item-color: var(--dxds-color-content-neutral-default-static-dark-rest); + --dxbl-menu-item-image-color: var(--dxds-color-content-neutral-default-static-dark-rest); + --dxbl-menu-item-hover-bg: rgb(from var(--dxds-color-surface-neutral-default-static-light-rest) r g b / 0.15); + --dxbl-menu-item-hover-color: var(--dxds-color-content-neutral-default-static-dark-hovered); + --dxbl-menu-item-hover-image-color: var(--dxds-color-content-neutral-default-static-dark-hovered); + + background: none; +} + +::deep .menu.display-mobile { + margin-bottom: 2rem; +} + +::deep .menu-item-active { + background-color: rgb(from var(--dxds-color-surface-neutral-default-static-light-rest) r g b / 0.05); +} diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/CookieCheck.razor b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/CookieCheck.razor new file mode 100644 index 0000000..67439a4 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/CookieCheck.razor @@ -0,0 +1,16 @@ +@page "/cookiecheck" +@using Microsoft.AspNetCore.Http + +

CookieCheck

+ +

LambertzTest: @_cookie

+ +@code { + [CascadingParameter] public HttpContext HttpContext { get; set; } = default!; + private string? _cookie; + + protected override void OnInitialized() + { + HttpContext.Request.Cookies.TryGetValue("LambertzTest", out _cookie); + } +} diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Counter.razor b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Counter.razor new file mode 100644 index 0000000..ed65882 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Counter.razor @@ -0,0 +1,24 @@ +@page "/counter" + +Counter + +

Counter

+ +
+
+
+ @currentCount +
+ current count +
+ Click me +
+ +@code { + private int currentCount; + + private void IncrementCount() + { + currentCount++; + } +} diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Counter.razor.css b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Counter.razor.css new file mode 100644 index 0000000..73f0c69 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Counter.razor.css @@ -0,0 +1,25 @@ +.counter-block { + align-items: center; + border-radius: 1rem; + display: flex; + flex-direction: column; + gap: 1.5rem; + height: 17rem; + justify-content: center; + padding: 2.5rem 1.5rem 1.5rem; + width: 16.875rem; + border: 1px solid var(--dxds-color-border-neutral-default-rest); +} + +.counter-block .counter-content { + align-items: center; + display: flex; + flex-direction: column; + gap: 0.5rem; +} + +.counter-block .counter-count { + font-size: 7.5rem; + font-weight: 400; + line-height: 7.75rem; +} diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Error.razor b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Error.razor new file mode 100644 index 0000000..576cc2d --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Error.razor @@ -0,0 +1,36 @@ +@page "/Error" +@using System.Diagnostics + +Error + +

Error.

+

An error occurred while processing your request.

+ +@if (ShowRequestId) +{ +

+ Request ID: @RequestId +

+} + +

Development Mode

+

+ Swapping to Development environment will display more detailed information about the error that occurred. +

+

+ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +

+ +@code{ + [CascadingParameter] + private HttpContext? HttpContext { get; set; } + + private string? RequestId { get; set; } + private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + protected override void OnInitialized() => + RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; +} diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Index/Index.razor b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Index/Index.razor new file mode 100644 index 0000000..c82d581 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Index/Index.razor @@ -0,0 +1,25 @@ +@page "/" + +Welcome + +
+ + + + + + + + + + + + + + +
diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Index/Index.razor.css b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Index/Index.razor.css new file mode 100644 index 0000000..c1ef55c --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Index/Index.razor.css @@ -0,0 +1,31 @@ +::deep .index-gridlayout { + container-type: inline-size; + height: auto; + margin-top: auto; + margin-bottom: auto; + padding-bottom: 9rem; +} + +::deep .title { + padding-bottom: 3rem; + text-align: center; +} + +::deep .tiles { + --tile-column-count: 4; + + display: grid; + gap: 1rem; + grid-template-columns: repeat(var(--tile-column-count), max-content); + justify-content: center; + + @container (max-width: 60.5rem) { + --tile-column-count: 3; + } + @container (max-width: 45.125rem) { + --tile-column-count: 2; + } + @container (max-width: 29.75rem) { + --tile-column-count: 1; + } +} \ No newline at end of file diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Index/IndexTile.razor b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Index/IndexTile.razor new file mode 100644 index 0000000..fbfcd44 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Index/IndexTile.razor @@ -0,0 +1,40 @@ +@inherits DrawerStateComponentBase + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +@code { + [Parameter] public string NavigateUrl { get; set; } = string.Empty; + [Parameter] public string? Title { get; set; } + [Parameter] public string? Description { get; set; } + [Parameter] public string? IconCssClass { get; set; } +} \ No newline at end of file diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Index/IndexTile.razor.css b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Index/IndexTile.razor.css new file mode 100644 index 0000000..c399a0b --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Index/IndexTile.razor.css @@ -0,0 +1,44 @@ +.tile { + border-radius: 0.75rem; + height: 7.5rem; + transition: box-shadow 0.2s; + width: 14.375rem; + border: 1px solid var(--dxds-color-border-neutral-default-rest); +} + +.tile:hover { + box-shadow: 0 4px 8px 0 rgba(170, 170, 170, 0.24), 0 0 2px 0 rgba(170, 170, 170, 0.2); +} + +.tile ::deep > a { + text-decoration: none; +} + +::deep .tile-content { + padding: 1rem; +} + +::deep .tile-icon { + border-radius: 0.375rem; + height: 2.75rem; + padding: 0.75rem; + width: 2.75rem; + border: 1px solid var(--dxds-color-border-neutral-default-rest); +} + +::deep .tile-title { + align-self: center; + color: var(--dxds-color-content-neutral-default-rest); + font-size: var(--dxds-font-size-base-md); + font-weight: var(--dxds-font-weight-base-strong); + letter-spacing: var(--dxds-letter-spacing-base-md); + line-height: var(--dxds-line-height-base-md); +} + +::deep .tile-description { + color: var(--dxds-color-content-neutral-subdued-rest); + font-size: var(--dxds-font-size-base-sm); + font-weight: var(--dxds-font-weight-base-default); + letter-spacing: var(--dxds-letter-spacing-base-sm); + line-height: var(--dxds-line-height-base-sm); +} \ No newline at end of file diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Weather.razor b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Weather.razor new file mode 100644 index 0000000..7b10b76 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Pages/Weather.razor @@ -0,0 +1,32 @@ +@page "/weather" + +Weather + +

Weather

+ + + + + + + + + + +@code { + private WeatherForecast[]? forecasts; + + protected override async Task OnInitializedAsync() { + DateOnly startDate = DateOnly.FromDateTime(DateTime.Now); + string[] summaries = ["Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"]; + forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast( + Date: startDate.AddDays(index), + TemperatureC: Random.Shared.Next(-20, 55), + Summary: summaries[Random.Shared.Next(summaries.Length)] + )).ToArray(); + } + + private record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) { + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + } +} diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Routes.razor b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Routes.razor new file mode 100644 index 0000000..a3c9db7 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Routes.razor @@ -0,0 +1,10 @@ + + + + + + +

Sorry, there's nothing at this address.

+
+
+
\ No newline at end of file diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Shared/DrawerStateComponentBase.cs b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Shared/DrawerStateComponentBase.cs new file mode 100644 index 0000000..8f76a7d --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/Shared/DrawerStateComponentBase.cs @@ -0,0 +1,77 @@ +using Microsoft.AspNetCore.Components; + +namespace LambertzPortalPersonalverkauf.Components.Shared +{ + public abstract class DrawerStateComponentBase : ComponentBase + { + [SupplyParameterFromQuery(Name = DrawerStateUrlBuilder.DrawerStateQueryParameterName)] + public bool ToggledDrawer { get; set; } + + [Inject] NavigationManager NavigationManager { get; set; } = null!; + + protected string AddDrawerStateToUrl(string baseUrl) + { + return DrawerStateUrlBuilder.AddStateToUrl(baseUrl, ToggledDrawer, NavigationManager); + } + + protected string AddDrawerStateToUrlToggled(string baseUrl) + { + return DrawerStateUrlBuilder.AddStateToUrl(baseUrl, !ToggledDrawer, NavigationManager); + } + + protected string RemoveDrawerStateFromUrl(string baseUrl) + { + return DrawerStateUrlBuilder.RemoveStateFromUrl(baseUrl, NavigationManager); + } + } + + public abstract class DrawerStateLayoutComponentBase : LayoutComponentBase + { + [SupplyParameterFromQuery(Name = DrawerStateUrlBuilder.DrawerStateQueryParameterName)] + public bool ToggledDrawer { get; set; } + + [Inject] NavigationManager NavigationManager { get; set; } = null!; + + protected string AddDrawerStateToUrl(string baseUrl) + { + return DrawerStateUrlBuilder.AddStateToUrl(baseUrl, ToggledDrawer, NavigationManager); + } + + protected string AddDrawerStateToUrlToggled(string baseUrl) + { + return DrawerStateUrlBuilder.AddStateToUrl(baseUrl, !ToggledDrawer, NavigationManager); + } + + protected string RemoveDrawerStateFromUrl(string baseUrl) + { + return DrawerStateUrlBuilder.RemoveStateFromUrl(baseUrl, NavigationManager); + } + } + + internal static class DrawerStateUrlBuilder + { + public const string DrawerStateQueryParameterName = "toggledSidebar"; + + public static string AddStateToUrl(string baseUrl, bool toggledDrawer, NavigationManager navigationManager) + { + return navigationManager.GetUriWithQueryParameters( + baseUrl, + new Dictionary + { + [DrawerStateQueryParameterName] = toggledDrawer ? true : null + } + ); + } + + public static string RemoveStateFromUrl(string baseUrl, NavigationManager navigationManager) + { + return navigationManager.GetUriWithQueryParameters( + baseUrl, + new Dictionary + { + [DrawerStateQueryParameterName] = null + } + ); + } + } +} \ No newline at end of file diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/_Imports.razor b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/_Imports.razor new file mode 100644 index 0000000..7cf8e59 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Components/_Imports.razor @@ -0,0 +1,14 @@ +@using System.Net.Http +@using System.Net.Http.Json +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.JSInterop +@using static Microsoft.AspNetCore.Components.Web.RenderMode +@using LambertzPortalPersonalverkauf +@using LambertzPortalPersonalverkauf.Components +@using LambertzPortalPersonalverkauf.Components.Layout +@using LambertzPortalPersonalverkauf.Components.Shared + +@using DevExpress.Blazor diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf.csproj b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf.csproj new file mode 100644 index 0000000..2906389 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf.csproj @@ -0,0 +1,11 @@ + + + net8.0 + enable + enable + + + + + + diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Program.cs b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Program.cs new file mode 100644 index 0000000..3a1cf0f --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Program.cs @@ -0,0 +1,33 @@ +using LambertzPortalPersonalverkauf.Components; + +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. +builder.Services.AddRazorComponents() + .AddInteractiveServerComponents(); + +builder.Services.AddDevExpressBlazor(options => +{ + options.SizeMode = DevExpress.Blazor.SizeMode.Medium; +}); +builder.Services.AddMvc(); + +var app = builder.Build(); + +if (!app.Environment.IsDevelopment()) +{ + app.UseExceptionHandler("/Error", createScopeForErrors: true); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); +} +app.UsePathBase("/pvk"); +app.UseHttpsRedirection(); + +app.UseStaticFiles(); +app.UseAntiforgery(); + +app.MapRazorComponents() + .AddInteractiveServerRenderMode() + .AllowAnonymous(); + +app.Run(); \ No newline at end of file diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Properties/launchSettings.json b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Properties/launchSettings.json new file mode 100644 index 0000000..841adea --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/appsettings.Development.json b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/appsettings.json b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/css/icons.css b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/css/icons.css new file mode 100644 index 0000000..bfde075 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/css/icons.css @@ -0,0 +1,35 @@ +.icon { + width: 1.25rem; + height: 1.25rem; + background-color: currentcolor; + mask-image: var(--icon-mask-image); + mask-position: center; + mask-repeat: no-repeat; +} + +.icon-back { + --icon-mask-image: url("/images/back.svg"); +} +.icon-close { + --icon-mask-image: url("/images/close.svg"); +} +.icon-demos { + --icon-mask-image: url("/images/demos.svg"); +} +.icon-docs { + --icon-mask-image: url("/images/doc.svg"); +} +.icon-menu { + --icon-mask-image: url("/images/menu.svg"); +} + +/* pages */ +.icon-counter { + --icon-mask-image: url("/images/pages/counter.svg"); +} +.icon-home { + --icon-mask-image: url("/images/pages/home.svg"); +} +.icon-weather { + --icon-mask-image: url("/images/pages/weather.svg"); +} diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/css/site.css b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/css/site.css new file mode 100644 index 0000000..b12ac59 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/css/site.css @@ -0,0 +1,79 @@ +@import url('./icons.css'); + +html, body { + display: flex; + flex-direction: column; + height: 100%; + overflow: hidden; + margin: 0; +} + +.w-100 { + width: 100% !important; +} + +.h-100 { + height: 100% !important; +} + +.h-auto { + height: auto !important; +} + +.overflow-hidden { + overflow: hidden !important; +} + +.text-danger { + color: var(--dxds-color-content-danger-default-rest); +} + +.valid.modified:not([type=checkbox]) { + outline: 1px solid var(--dxds-color-border-success-default-rest); +} + +.invalid { + outline: 1px solid var(--dxds-color-border-danger-default-rest); +} + +.validation-message { + color: var(--dxds-color-content-danger-default-rest); +} + +.button-link { + text-decoration: unset; +} + +.title { + display: flex; + flex-direction: column; + gap: 0.5rem; + padding: 1rem 0; +} + +.title.title-secondary { + padding: 0.313rem 0 0; + color: var(--dxds-color-content-secondary-default-rest); +} + +.title-header-text { + font-size: var(--dxds-font-size-headline-lg); + font-weight: var(--dxds-font-weight-headline-default); + letter-spacing: var(--dxds-letter-spacing-headline-lg); + line-height: var(--dxds-line-height-headline-lg); +} + +.title-content-text { + font-size: var(--dxds-font-size-base-lg); + font-weight: var(--dxds-font-weight-base-default); + letter-spacing: var(--dxds-letter-spacing-base-lg); + line-height: var(--dxds-line-height-base-lg); +} + +.main-content { + align-items: center; + display: flex; + height: 100%; + justify-content: center; + width: 100%; +} diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/favicon.ico b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/favicon.ico new file mode 100644 index 0000000..df1ae2f Binary files /dev/null and b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/favicon.ico differ diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/back.svg b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/back.svg new file mode 100644 index 0000000..8a40753 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/back.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/cards.svg b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/cards.svg new file mode 100644 index 0000000..ffa3334 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/cards.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/close.svg b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/close.svg new file mode 100644 index 0000000..137b5b3 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/demos.svg b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/demos.svg new file mode 100644 index 0000000..f58c385 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/demos.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/doc.svg b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/doc.svg new file mode 100644 index 0000000..64a8098 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/doc.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/logo.svg b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/logo.svg new file mode 100644 index 0000000..2bbbb18 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/logo.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/menu.svg b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/menu.svg new file mode 100644 index 0000000..cfe69db --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/menu.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/pages/counter.svg b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/pages/counter.svg new file mode 100644 index 0000000..6eb7b54 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/pages/counter.svg @@ -0,0 +1,4 @@ + + + + diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/pages/home.svg b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/pages/home.svg new file mode 100644 index 0000000..495c6c5 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/pages/home.svg @@ -0,0 +1,3 @@ + + + diff --git a/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/pages/weather.svg b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/pages/weather.svg new file mode 100644 index 0000000..c69e562 --- /dev/null +++ b/LambertzPortalPersonalverkauf/LambertzPortalPersonalverkauf/wwwroot/images/pages/weather.svg @@ -0,0 +1,3 @@ + + + diff --git a/WerksverkaufScanner/WerksverkaufScanner/Pages/_Host.cshtml b/WerksverkaufScanner/WerksverkaufScanner/Pages/_Host.cshtml index 6d268d2..a9e8cda 100644 --- a/WerksverkaufScanner/WerksverkaufScanner/Pages/_Host.cshtml +++ b/WerksverkaufScanner/WerksverkaufScanner/Pages/_Host.cshtml @@ -19,7 +19,7 @@ crossorigin="anonymous" /> - + @@ -28,9 +28,9 @@ - - - + + + @@ -45,7 +45,8 @@ crossorigin="anonymous"> - + +