Store Branding: Refactoring and logo as favicon (#5519)

* Store Branding: Refactoring and logo as favicon

- Encapsulates store branding properties into their own view model
- Uses the logo as favicon on public pages

* Refactorings

* Updates
This commit is contained in:
d11n
2023-12-01 16:13:44 +01:00
committed by GitHub
parent afed3a0899
commit 44b7ed0e6e
33 changed files with 138 additions and 140 deletions

View File

@@ -139,9 +139,10 @@ namespace BTCPayServer.Controllers
public async Task<IActionResult> Index(string storeId)
{
var userId = _UserManager.GetUserId(User);
if(userId is null)
if (string.IsNullOrEmpty(userId))
return Forbid();
var store = await _Repo.FindStore(storeId, _UserManager.GetUserId(User));
var store = await _Repo.FindStore(storeId, userId);
if (store is null)
{
return Forbid();
@@ -158,12 +159,10 @@ namespace BTCPayServer.Controllers
return View();
}
[HttpGet]
[Route("{storeId}/users")]
[HttpGet("{storeId}/users")]
public async Task<IActionResult> StoreUsers()
{
StoreUsersViewModel vm = new StoreUsersViewModel();
vm.Role = StoreRoleId.Guest.Role;
var vm = new StoreUsersViewModel { Role = StoreRoleId.Guest.Role };
await FillUsers(vm);
return View(vm);
}
@@ -182,8 +181,7 @@ namespace BTCPayServer.Controllers
public StoreData CurrentStore => HttpContext.GetStoreData();
[HttpPost]
[Route("{storeId}/users")]
[HttpPost("{storeId}/users")]
public async Task<IActionResult> StoreUsers(string storeId, StoreUsersViewModel vm)
{
await FillUsers(vm);