mirror of
https://github.com/hargata/lubelog.git
synced 2025-12-10 00:46:08 -06:00
Merge pull request #190 from hargata/Hargata/alternate.logo
allows users to inject their own logo.
This commit is contained in:
commit
d816f73598
@ -9,6 +9,7 @@ namespace CarCareTracker.Helper
|
|||||||
{
|
{
|
||||||
UserConfig GetUserConfig(ClaimsPrincipal user);
|
UserConfig GetUserConfig(ClaimsPrincipal user);
|
||||||
bool SaveUserConfig(ClaimsPrincipal user, UserConfig configData);
|
bool SaveUserConfig(ClaimsPrincipal user, UserConfig configData);
|
||||||
|
string GetLogoUrl();
|
||||||
public bool DeleteUserConfig(int userId);
|
public bool DeleteUserConfig(int userId);
|
||||||
}
|
}
|
||||||
public class ConfigHelper : IConfigHelper
|
public class ConfigHelper : IConfigHelper
|
||||||
@ -24,6 +25,15 @@ namespace CarCareTracker.Helper
|
|||||||
_userConfig = userConfig;
|
_userConfig = userConfig;
|
||||||
_cache = memoryCache;
|
_cache = memoryCache;
|
||||||
}
|
}
|
||||||
|
public string GetLogoUrl()
|
||||||
|
{
|
||||||
|
var logoUrl = _config["LUBELOGGER_LOGO_URL"];
|
||||||
|
if (string.IsNullOrWhiteSpace(logoUrl))
|
||||||
|
{
|
||||||
|
logoUrl = "/defaults/lubelogger_logo.png";
|
||||||
|
}
|
||||||
|
return logoUrl;
|
||||||
|
}
|
||||||
public bool SaveUserConfig(ClaimsPrincipal user, UserConfig configData)
|
public bool SaveUserConfig(ClaimsPrincipal user, UserConfig configData)
|
||||||
{
|
{
|
||||||
var storedUserId = user.FindFirstValue(ClaimTypes.NameIdentifier);
|
var storedUserId = user.FindFirstValue(ClaimTypes.NameIdentifier);
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
@inject IConfigHelper config
|
@inject IConfigHelper config
|
||||||
@{
|
@{
|
||||||
var enableAuth = config.GetUserConfig(User).EnableAuth;
|
var enableAuth = config.GetUserConfig(User).EnableAuth;
|
||||||
|
var logoUrl = config.GetLogoUrl();
|
||||||
}
|
}
|
||||||
@model string
|
@model string
|
||||||
@{
|
@{
|
||||||
@ -35,7 +36,7 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
<div class="d-flex lubelogger-navbar">
|
<div class="d-flex lubelogger-navbar">
|
||||||
<img src="/defaults/lubelogger_logo.png" />
|
<img src="@logoUrl" />
|
||||||
<div class="lubelogger-navbar-button">
|
<div class="lubelogger-navbar-button">
|
||||||
<button type="button" class="btn btn-dark" onclick="showMobileNav()"><i class="bi bi-list lubelogger-menu-icon"></i></button>
|
<button type="button" class="btn btn-dark" onclick="showMobileNav()"><i class="bi bi-list lubelogger-menu-icon"></i></button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user