mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 09:54:30 +01:00
4c303d358b
* Remove deprecated CSS options Closes #5945. * Greenfield: Add brandColor to store APIs Closes #5946. * Migrate file IDs to URLs Closes #5953. * Greenfield: Add CSS and logo URL to store settings API Closes #5945. * Add migration test * Store and Server branding can reference file's via fileid:ID * Add PaymentSoundUrl to Store API --------- Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using BTCPayServer.Abstractions.Extensions;
|
|
using BTCPayServer.Data;
|
|
using BTCPayServer.Services;
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
namespace BTCPayServer.Models;
|
|
|
|
public class StoreBrandingViewModel
|
|
{
|
|
public string BrandColor { get; set; }
|
|
public string LogoUrl { get; set; }
|
|
public string CssUrl { get; set; }
|
|
|
|
public StoreBrandingViewModel()
|
|
{
|
|
}
|
|
public static async Task<StoreBrandingViewModel> CreateAsync(HttpRequest request, UriResolver uriResolver, StoreBlob storeBlob)
|
|
{
|
|
if (storeBlob == null)
|
|
return new StoreBrandingViewModel();
|
|
var result = new StoreBrandingViewModel(storeBlob);
|
|
result.LogoUrl = await uriResolver.Resolve(request.GetAbsoluteRootUri(), storeBlob.LogoUrl);
|
|
result.CssUrl = await uriResolver.Resolve(request.GetAbsoluteRootUri(), storeBlob.CssUrl);
|
|
return result;
|
|
}
|
|
private StoreBrandingViewModel(StoreBlob storeBlob)
|
|
{
|
|
BrandColor = storeBlob.BrandColor;
|
|
}
|
|
}
|