339 lines
17 KiB
Plaintext
339 lines
17 KiB
Plaintext
@inject Microsoft.ApplicationInsights.AspNetCore.JavaScriptSnippet JavaScriptSnippet
|
|
@using System.Globalization
|
|
@using gehGassi.Domain.Users
|
|
@using gehGassi.Permissions
|
|
@using gehGassi.Web.Auth
|
|
@using gehGassi.Web.Helper
|
|
@using Microsoft.AspNetCore.Authorization
|
|
@using Microsoft.AspNetCore.Builder
|
|
@using Microsoft.AspNetCore.Http
|
|
@using Microsoft.AspNetCore.Mvc.Localization
|
|
@using Microsoft.Extensions.Options
|
|
@inject IViewLocalizer Localizer
|
|
@inject IOptions<LicenseOptions> LicenseOptions
|
|
@inject IOptions<RequestLocalizationOptions> RequestLocalizationOptions
|
|
@inject IOptions<ApplicationInsightsOptions> ApplicationInsightsOptions
|
|
@inject IOptions<SystemJsOptions> SystemJsOptions
|
|
@inject IAuthorizationService AuthorizationService
|
|
@{
|
|
ApplicationUser appUser = ViewBag.ApplicationUser;
|
|
var returnUrl = Context.Request.Path;
|
|
//Sonderbehandlung Sprachwechsel. Bei POST geht das leider nicht. Daher Redirect auf das Dashboard der Sektion
|
|
//if (returnUrl.ToString().ToLowerInvariant().Contains("indextenant"))
|
|
//{
|
|
// returnUrl = Url.Action("IndexTenant", "Home");
|
|
//}
|
|
//if (returnUrl.ToString().ToLowerInvariant().Contains("indexcustomer"))
|
|
//{
|
|
// returnUrl = Url.Action("IndexCustomer", "Home");
|
|
//}
|
|
//if (returnUrl.ToString().ToLowerInvariant().Contains("indexsettingscustomer"))
|
|
//{
|
|
// returnUrl = Url.Action("IndexCustomer", "Home");
|
|
//}
|
|
var sideBarCss = "sidebar-fixed";
|
|
var userPhoto = "";
|
|
var userName = "";
|
|
if (appUser != null)
|
|
{
|
|
userPhoto = appUser.Photo;
|
|
userName = appUser.NameForLookup;
|
|
if (!appUser.Settings.SidebarShow)
|
|
{
|
|
sideBarCss = "sidebar-fixed hide";
|
|
}
|
|
else
|
|
{
|
|
if (appUser.Settings.SidebarMinimized)
|
|
{
|
|
sideBarCss += " sidebar-narrow-unfoldable";
|
|
}
|
|
}
|
|
}
|
|
var selectedCustomerId = User.CustomerUniqueId();
|
|
var selectedCustomerName = User.CustomerName();
|
|
var selectedCustomerClass = "";
|
|
|
|
if (string.IsNullOrWhiteSpace(selectedCustomerName))
|
|
{
|
|
selectedCustomerName = Localizer["Common_None"].Value;
|
|
selectedCustomerClass = "opacity-50";
|
|
}
|
|
|
|
var selectedAppUserName = User.AppUserName();
|
|
var selectedAppUserClass = "";
|
|
|
|
if (string.IsNullOrWhiteSpace(selectedAppUserName))
|
|
{
|
|
selectedAppUserName = Localizer["Common_None"].Value;
|
|
selectedAppUserClass = "opacity-50";
|
|
}
|
|
|
|
var renderSessionSettings = false;
|
|
int sessionTimeout = 0;
|
|
int sessionWarning = 0;
|
|
//int courseIdleTimeout = 15;
|
|
IOptions<SessionSettings> sessionSettings = ViewBag.SessionSettings;
|
|
if (sessionSettings != null && sessionSettings.Value.Autologout)
|
|
{
|
|
renderSessionSettings = true;
|
|
sessionTimeout = sessionSettings.Value.TimeOut;
|
|
sessionWarning = sessionSettings.Value.Warning;
|
|
}
|
|
if (sessionSettings != null)
|
|
{
|
|
//courseIdleTimeout = sessionSettings.Value.CourseIdleTimeout;
|
|
}
|
|
string version = ViewBag.Version;
|
|
}
|
|
<!DOCTYPE html>
|
|
<html lang="@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName)">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
|
<meta name="robots" content="noindex,nofollow">
|
|
<title>@ViewData["Title"] :: @LicenseOptions.Value.Software</title>
|
|
|
|
<environment names="Development">
|
|
<link rel="stylesheet" href="~/css/syncfusion_bootstrap5.css" asp-append-version="false" />
|
|
<link href="~/css/CoreUi.css" rel="stylesheet">
|
|
<link href="~/css/simplebar.css" rel="stylesheet">
|
|
<link href="~/lib/font-awesome/css/fontawesome.css" rel="stylesheet">
|
|
<link href="~/lib/font-awesome/css/brands.css" rel="stylesheet">
|
|
<link href="~/lib/font-awesome/css/solid.css" rel="stylesheet">
|
|
<link href="~/css/Animate.css" rel="stylesheet">
|
|
<link href="~/css/Site.css" rel="stylesheet" asp-append-version="false">
|
|
</environment>
|
|
<environment names="Production,Staging,Live">
|
|
<link rel="stylesheet" href="~/css/syncfusion_bootstrap5.min.css" asp-append-version="true" />
|
|
<link href="~/css/CoreUi.min.css" rel="stylesheet" asp-append-version="true">
|
|
<link href="~/css/simplebar.min.css" rel="stylesheet" asp-append-version="true">
|
|
<link href="~/lib/font-awesome/css/fontawesome.min.css" rel="stylesheet" asp-append-version="true">
|
|
<link href="~/lib/font-awesome/css/brands.min.css" rel="stylesheet" asp-append-version="true">
|
|
<link href="~/lib/font-awesome/css/solid.min.css" rel="stylesheet" asp-append-version="true">
|
|
<link href="~/css/Animate.min.css" rel="stylesheet">
|
|
<link href="~/css/Site.min.css" rel="stylesheet" asp-append-version="true">
|
|
</environment>
|
|
<partial name="_FavIcons" />
|
|
<partial name="_OpenGraphMeta" />
|
|
|
|
@RenderSection("Css", required: false)
|
|
@Html.Raw(JavaScriptSnippet.FullScript)
|
|
</head>
|
|
<body>
|
|
<div id="globalLoading" class="tmloading">
|
|
<div class="spinner">
|
|
<div class="double-bounce1"></div>
|
|
<div class="double-bounce2"></div>
|
|
</div>
|
|
</div>
|
|
<aside id="sideBarRight" style="visibility: hidden; padding: 15px;">
|
|
</aside>
|
|
|
|
<div class="sidebar sidebar-dark @sideBarCss" id="sidebar">
|
|
<div class="sidebar-brand d-none d-md-flex">
|
|
<img class="sidebar-brand-full" src="~/images/logo_small.png" alt="gehGassi">
|
|
<img class="sidebar-brand-narrow" src="~/images/logo_icon.png" alt="gehGassi">
|
|
</div>
|
|
|
|
@(await Html.PartialAsync("_SideBar"))
|
|
|
|
<button id="sideBarMinimize" class="sidebar-toggler" type="button" data-coreui-toggle="unfoldable"></button>
|
|
</div>
|
|
<div class="wrapper d-flex flex-column min-vh-100 bg-light">
|
|
<form asp-area="" asp-controller="Account" asp-action="Logout" asp-route-culture="@CultureInfo.CurrentCulture.TwoLetterISOLanguageName" method="post" id="logoutForm" style="display: none;"></form>
|
|
<form asp-area="" asp-controller="Home" asp-action="SetLanguage" method="post" id="languageForm" style="display: none;"></form>
|
|
<form method="post" id="postForm" style="display: none;"></form>
|
|
<header class="header header-sticky mb-4">
|
|
<div class="container-fluid">
|
|
<button id="sideBarCollapse" class="header-toggler px-md-0 me-md-3" type="button" onclick="coreui.Sidebar.getInstance(document.querySelector('#sidebar')).toggle()">
|
|
<i class="fa fa-bars"></i>
|
|
</button>
|
|
<a class="header-brand d-none d-md-flex" href="#">
|
|
<img src="~/images/logo_small.png" alt="gehGassi">
|
|
</a>
|
|
<ul class="header-nav d-none d-md-flex">
|
|
|
|
</ul>
|
|
<ul class="header-nav ms-auto">
|
|
</ul>
|
|
<ul class="header-nav ms-3">
|
|
<!-- Shoppingcart-->
|
|
@if ((await AuthorizationService.AuthorizeAsync(User, Policies.CustomerOnly)).Succeeded && User.CustomerId().HasValue)
|
|
{
|
|
<li id="cartInfo" class="nav-item" cb-permissions="@Tools.PermissionList(Permission.ShopAccess)">
|
|
<span style="position: relative;">
|
|
<a class="cart-link" asp-action="ShowCart" asp-controller="Shop">
|
|
<span class="" style=""><i class="fa fa-cart-shopping" style="margin-top: 0.75rem;" title="@Localizer["Common_ShoppingCart"]"></i></span>
|
|
<span id="cartCount" class="badge bg-secondary me-2">0</span>
|
|
</a>
|
|
</span>
|
|
</li>
|
|
}
|
|
|
|
<!-- Auswahl Mandante / Kunde-->
|
|
@if ((await AuthorizationService.AuthorizeAsync(User, Policies.AdministratorOnly)).Succeeded || (await AuthorizationService.AuthorizeAsync(User, Policies.PowerUserOnly)).Succeeded)
|
|
{
|
|
<li class="nav-item" cb-permissions="@Tools.PermissionList(Permission.ImpersionateAdmin)">
|
|
<span class="me-2 @selectedAppUserClass" style="vertical-align: middle;"><i class="fa fa-bone" style="margin-top: 0.5rem;" title="@Localizer["Common_SelectedAppUser"] @selectedAppUserName"></i></span>
|
|
<span class="me-2 @selectedCustomerClass" style="vertical-align: middle;"><i class="fa fa-street-view" style="margin-top: 0.5rem;" title="@Localizer["Common_SelectedCustomer"] @selectedCustomerName"></i></span>
|
|
<button id="btnImpersionateAdmin" cb-permissions="@Tools.PermissionList(Permission.ImpersionateAdmin)" type="button" class="btn btn-primary btn-sm me-2 mt-1"><i class="fa fa-drivers-license"></i></button>
|
|
</li>
|
|
}
|
|
|
|
<!--Language-->
|
|
<li class="nav-item dropdown">
|
|
<a class="nav-link " data-coreui-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
|
<img class="" src="~/images/Languages/@(CultureInfo.CurrentCulture.TwoLetterISOLanguageName).png" alt="@Localizer["Common_Language"]">
|
|
</a>
|
|
<div class="dropdown-menu dropdown-menu-end pt-0 shadow">
|
|
@foreach (var lang in RequestLocalizationOptions.Value.SupportedCultures)
|
|
{
|
|
<a class="dropdown-item selectLanguage" href="#" data-culture="@(lang.TwoLetterISOLanguageName)" data-returnUrl="@returnUrl">
|
|
<img src="~/images/Languages/@(lang.TwoLetterISOLanguageName).png" alt="@lang.NativeName"/> @lang.NativeName
|
|
</a>
|
|
}
|
|
</div>
|
|
</li>
|
|
<!-- Profil-->
|
|
<li class="nav-item dropdown">
|
|
<a class="nav-link py-0" data-coreui-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
|
<div class="avatar avatar-md">
|
|
<img id="avatar" class="avatar-img img-avatar-small" src="@Tools.GetProfileImage(userPhoto)" alt="@userName">
|
|
@*<span id="avatarName" class="d-none d-md-inline text-nowrap">@userName</span>*@
|
|
</div>
|
|
</a>
|
|
<div class="dropdown-menu dropdown-menu-end pt-0 shadow" style="" data-popper-placement="bottom-end">
|
|
<div class="dropdown-header bg-light py-2">
|
|
<div class="fw-semibold">@userName</div>
|
|
</div>
|
|
<a asp-controller="Manage" asp-action="EditProfile" class="dropdown-item fs-6"><i class="fa fa-address-card me-2"></i> @Localizer["Common_Profile"]</a>
|
|
<a asp-controller="Manage" asp-action="ChangePassword" class="dropdown-item fs-6"><i class="fa fa-pen-to-square me-2"></i> @Localizer["Common_ChangePassword"]</a>
|
|
<a asp-controller="Fido" asp-action="Index" class="dropdown-item fs-6"><i class="fa fa-key me-2"></i> @Localizer["Common_Fido"]</a>
|
|
<div class="dropdown-divider"></div>
|
|
<a id="logout" class="dropdown-item fs-6" href="#">
|
|
<i class="fa-solid fa-right-from-bracket me-2"></i> @Localizer["Common_Logout"]
|
|
</a>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="header-divider"></div>
|
|
<div class="container-fluid">
|
|
<nav aria-label="breadcrumb">
|
|
@await RenderSectionAsync("pageTitle", false)
|
|
<div id="pageTitleAdd" class="d-inline ml-1 color-black"></div>
|
|
|
|
</nav>
|
|
</div>
|
|
</header>
|
|
<div class="body flex-grow-1 px-3">
|
|
<div class="container-fluid">
|
|
@RenderBody()
|
|
</div>
|
|
</div>
|
|
<footer class="footer">
|
|
<div>
|
|
<a href="@LicenseOptions.Value.Address" target="_blank">@LicenseOptions.Value.Software</a>
|
|
<span>(@LicenseOptions.Value.Version)</span>
|
|
<span>© @DateTime.UtcNow.Year <strong><a href="https://gehgassi.com" target="_blank">gehgassi GmbH</a></strong></span>
|
|
</div>
|
|
<div class="ms-md-auto">
|
|
<span>Software by <strong><a href="https://creativebits.com" target="_blank">creative BITS</a></strong></span>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
|
|
|
|
<div id="modalDialog" style="display: none;">
|
|
<div id="modalDialogText"></div>
|
|
<div id="modalDialogButtons" class="dialogButtons">
|
|
<a id="modalDialogOk" href="#" class="btn btn-primary">@Localizer["Button_Ok"]</a>
|
|
<a id="modalDialogCancel" href="#" class="btn btn-primary">@Localizer["Button_Cancel"]</a>
|
|
</div>
|
|
</div>
|
|
<div id="modalModule" style="display: none;">
|
|
<div id="modalModuleContent"></div>
|
|
</div>
|
|
<script>
|
|
window.paceOptions = { ajax: { ignoreURLs: ['sessionHub', '__browserLink', 'browserLinkSignalR'], trackWebSockets: false } }
|
|
</script>
|
|
<environment names="Development">
|
|
<!--[if !IE]>-->
|
|
<script asp-append-version="true" src="~/lib/promise-polyfill/polyfill.js"></script>
|
|
<!--<![endif]-->
|
|
<script asp-append-version="true" src="~/config/importmap.json" type="systemjs-importmap"></script>
|
|
<script asp-append-version="true" src="~/lib/systemjs/system.js"></script>
|
|
|
|
<script asp-append-version="true" src="~/lib/jquery/jquery.js"></script>
|
|
<script asp-append-version="true" src="~/lib/bundle/bundle.js"></script>
|
|
<script asp-append-version="true" src="~/lib/bootstrap/js/bootstrap.js"></script>
|
|
|
|
<script asp-append-version="true" src="~/lib/cldr/cldrbundle.js"></script>
|
|
<script asp-append-version="true" src="~/lib/globalize/globalizebundle.js"></script>
|
|
<script asp-append-version="true" src="~/lib/jquery-validation/jqueryValidationBundle.js"></script>
|
|
|
|
<script asp-append-version="true" src="~/lib/coreui/scripts/coreui.bundle.min.js"></script>
|
|
<script asp-append-version="true" src="~/lib/simplebar/simplebar.js"></script>
|
|
|
|
@await RenderSectionAsync("ScriptsExternal", required: false)
|
|
|
|
<script asp-append-version="true" src="~/lib/systemjs/extras/amd.js"></script>
|
|
<script asp-append-version="true" src="~/lib/systemjs/extras/named-register.js"></script>
|
|
<system-js-config />
|
|
</environment>
|
|
<environment names="Production,Staging,Live">
|
|
<!--[if !IE]>-->
|
|
<script asp-append-version="true" src="~/lib/promise-polyfill/polyfill.min.js"></script>
|
|
<!--<![endif]-->
|
|
<script asp-append-version="true" src="~/config/importmapRelease.json" type="systemjs-importmap"></script>
|
|
<script asp-append-version="true" src="~/lib/systemjs/system.min.js"></script>
|
|
|
|
<script asp-append-version="true" src="~/lib/jquery/jquery.min.js"></script>
|
|
<script asp-append-version="true" src="~/lib/bundle/bundle.min.js"></script>
|
|
<script asp-append-version="true" src="~/lib/bootstrap/js/bootstrap.min.js"></script>
|
|
|
|
<script asp-append-version="true" src="~/lib/cldr/cldrbundle.min.js"></script>
|
|
<script asp-append-version="true" src="~/lib/globalize/globalizebundle.min.js"></script>
|
|
<script asp-append-version="true" src="~/lib/jquery-validation/jqueryValidationBundle.min.js"></script>
|
|
|
|
<script asp-append-version="true" src="~/lib/coreui/scripts/coreui.bundle.min.js"></script>
|
|
<script asp-append-version="true" src="~/lib/simplebar/simplebar.min.js"></script>
|
|
|
|
@await RenderSectionAsync("ScriptsExternal", required: false)
|
|
|
|
<script asp-append-version="true" src="~/lib/systemjs/extras/amd.min.js"></script>
|
|
<script asp-append-version="true" src="~/lib/systemjs/extras/named-register.min.js"></script>
|
|
<system-js-config />
|
|
</environment>
|
|
<system-js url="~/scripts/Views/Shared/Layout.js" fresh-import="true" add-fresh-import-function="true" load-on-post="true"></system-js>
|
|
|
|
@Html.Hidden("jsGetResourcesClientUrl", Url.Action("GetResource", "Language", new { lang = CultureInfo.CurrentCulture.TwoLetterISOLanguageName, resource = "Client", version = SystemJsOptions.Value.FileVersion }))
|
|
@Html.Hidden("jsGetResourcesTextUrl", Url.Action("GetResource", "Language", new { lang = CultureInfo.CurrentCulture.TwoLetterISOLanguageName, resource = "Text", version = SystemJsOptions.Value.FileVersion }))
|
|
@Html.Hidden("jsGetResourcesAnnotationsUrl", Url.Action("GetResource", "Language", new { lang = CultureInfo.CurrentCulture.TwoLetterISOLanguageName, resource = "Annotations", version = SystemJsOptions.Value.FileVersion }))
|
|
@Html.Hidden("jsImagePrefix", $"/file/documents/")
|
|
@Html.Hidden("jsImagePrefixUncached", $"/File/uncached/documents/")
|
|
@Html.Hidden("jsMe", User.Identity.Name)
|
|
@Html.Hidden("jsSidebarShow", Url.Action("SetSidebarShow", "Common"))
|
|
@Html.Hidden("jsSidebarMinimized", Url.Action("SetSidebarMinimized", "Common"))
|
|
@Html.Hidden("jsVersion", LicenseOptions.Value.Version)
|
|
@Html.Hidden("jsAuditInfoUrl", Url.Action("AuditInfo", "Common"))
|
|
@Html.Hidden("jsImpersionateAdminUrl", Url.Action("ImpersionateAdmin", "Common"))
|
|
@Html.Hidden("jsGetCart", Url.Action("GetOrCreateCart", "Shop"))
|
|
|
|
@*@Html.Hidden("jsVersion", version)*@
|
|
@if (renderSessionSettings)
|
|
{
|
|
@Html.Hidden("jsAst", sessionTimeout)
|
|
@Html.Hidden("jsAsw", sessionWarning)
|
|
}
|
|
@*@Html.Hidden("jsCIT", courseIdleTimeout)*@
|
|
@if (selectedCustomerId != null)
|
|
{
|
|
<input type="hidden" id="jsScid" value="@selectedCustomerId.ToString()" cb-permissions="@Tools.PermissionList(Permission.ShopAccess)"/>
|
|
}
|
|
@await RenderSectionAsync("Scripts", required: false)
|
|
</body>
|
|
</html>
|