mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 15:01:56 +00:00
Merge pull request #159 from LD-Reborn/158-feature-implement-quick-actionsoverview-page
158 feature implement quick actionsoverview page
This commit is contained in:
@@ -13,13 +13,32 @@
|
|||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, ...</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, ...</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
|
||||||
<data name="Overview" xml:space="preserve">
|
<data name="Home Page" xml:space="preserve">
|
||||||
<value>Übersicht</value>
|
<value>Hauptseite</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Inventory asset" xml:space="preserve">
|
<data name="Hi, {0}!" xml:space="preserve">
|
||||||
<value>Asset inventarisieren</value>
|
<value>Hallo {0}!</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Create user" xml:space="preserve">
|
<data name="Hi!" xml:space="preserve">
|
||||||
<value>Benutzer anlegen</value>
|
<value>Hallo!</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Inventory" xml:space="preserve">
|
||||||
|
<value>Inventur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Manage Assets" xml:space="preserve">
|
||||||
|
<value>Assets verwalten</value>
|
||||||
|
</data>
|
||||||
|
<data name="Manage Locations" xml:space="preserve">
|
||||||
|
<value>Orte verwalten</value>
|
||||||
|
</data>
|
||||||
|
<data name="Manage Users" xml:space="preserve">
|
||||||
|
<value>Benutzer verwalten</value>
|
||||||
|
</data>
|
||||||
|
<data name="Manage Groups" xml:space="preserve">
|
||||||
|
<value>Gruppen verwalten</value>
|
||||||
|
</data>
|
||||||
|
<data name="Navigate from here or the navigation bar" xml:space="preserve">
|
||||||
|
<value>Navigiere von hier oder über die Navigationsleiste</value>
|
||||||
|
</data>
|
||||||
|
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -1,16 +1,55 @@
|
|||||||
|
@using Berufsschule_HAM.Services
|
||||||
@using Microsoft.AspNetCore.Mvc.Localization
|
@using Microsoft.AspNetCore.Mvc.Localization
|
||||||
@using Berufsschule_HAM.Models
|
@using Berufsschule_HAM.Models
|
||||||
|
@using System.Security.Claims
|
||||||
@model HomeIndexViewModel
|
@model HomeIndexViewModel
|
||||||
@inject IViewLocalizer T
|
@inject IViewLocalizer T
|
||||||
|
@inject LdapService _ldap
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = T["Home Page"];
|
ViewData["Title"] = T["Home Page"];
|
||||||
|
bool hasName = User.Identity?.Name is not null;
|
||||||
|
string? username;
|
||||||
|
string name = "";
|
||||||
|
UserModel? user;
|
||||||
|
if (hasName && User.Identity is not null && User.Identity.Name is not null)
|
||||||
|
{
|
||||||
|
username = User.Identity.Name;
|
||||||
|
user = await _ldap.GetUserByUidAsync(username);
|
||||||
|
name = user.Cn ?? "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
<div class="container py-4">
|
<div class="container py-4">
|
||||||
<h2 class="mb-3">@T["Overview"]</h2>
|
<div class="row text-center">
|
||||||
<div class="mb-4 d-flex flex-wrap gap-2">
|
@if (name.Length > 0)
|
||||||
<button class="btn btn-primary">@T["Inventory asset"]</button>
|
{
|
||||||
<button class="btn btn-primary">@T["Create user"]</button>
|
<h3>@T["Hi, {0}!", name]</h3>
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
<h3>@T["Hi!"]</h3>
|
||||||
|
}
|
||||||
|
<p>@T["Navigate from here or the navigation bar"]</p>
|
||||||
|
<div class="mb-4 d-flex flex-wrap gap-2 justify-content-center">
|
||||||
|
@if (User.HasClaim(ClaimTypes.Role, "CanInventorize"))
|
||||||
|
{
|
||||||
|
<a href="/Home/Inventory" class="btn btn-primary">@T["Inventory"]</a>
|
||||||
|
}
|
||||||
|
@if (User.HasClaim(ClaimTypes.Role, "CanManageAssets"))
|
||||||
|
{
|
||||||
|
<a href="/Home/Assets" class="btn btn-primary">@T["Manage Assets"]</a>
|
||||||
|
}
|
||||||
|
@if (User.HasClaim(ClaimTypes.Role, "CanManageLocations"))
|
||||||
|
{
|
||||||
|
<a href="/Home/Locations" class="btn btn-primary">@T["Manage Locations"]</a>
|
||||||
|
}
|
||||||
|
@if (User.HasClaim(ClaimTypes.Role, "CanManageUsers"))
|
||||||
|
{
|
||||||
|
<a href="/Home/Users" class="btn btn-primary">@T["Manage Users"]</a>
|
||||||
|
}
|
||||||
|
@if (User.HasClaim(ClaimTypes.Role, "CanManageGroups"))
|
||||||
|
{
|
||||||
|
<a href="/Home/Groups" class="btn btn-primary">@T["Manage Groups"]</a>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -23,16 +23,13 @@
|
|||||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar bg border-bottom box-shadow mb-3">
|
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar bg border-bottom box-shadow mb-3">
|
||||||
<a href="#main-content" class="skip-link btn btn-primary">@T["Jump to content"]</a>
|
<a href="#main-content" class="skip-link btn btn-primary">@T["Jump to content"]</a>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Berufsschule_HAM</a>
|
<a class="" asp-area="" asp-controller="Home" asp-action="Index"><img src="/HAM_Banner_xs.png" alt="Logo" style="max-height: 40px;"></a>
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||||
aria-expanded="false" aria-label="Toggle navigation">
|
aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
|
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
|
||||||
<ul class="navbar-nav flex-grow-1">
|
<ul class="navbar-nav flex-grow-1">
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link text" asp-area="" asp-controller="Home" asp-action="Index">@T["Quick-Actions"]</a>
|
|
||||||
</li>
|
|
||||||
@if (User.Identity?.IsAuthenticated ?? false)
|
@if (User.Identity?.IsAuthenticated ?? false)
|
||||||
{
|
{
|
||||||
@if (User.HasClaim(ClaimTypes.Role, "CanInventorize"))
|
@if (User.HasClaim(ClaimTypes.Role, "CanInventorize"))
|
||||||
|
|||||||
BIN
src/wwwroot/HAM_Banner_xs.png
Normal file
BIN
src/wwwroot/HAM_Banner_xs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
Reference in New Issue
Block a user