mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-20 15:34:24 +01:00
Policies: Cleanup and improvements (#5731)
* Policies: Turn checkboxes into toggles * Move email policy to server email settings * Move maintenance policies to server maintenance settings * Policies: Adjust spacings * Policies: Remove DisableInstantNotifications setting * Wording updates * Move maintenance settings back
This commit is contained in:
31
BTCPayServer/Models/EmailsViewModel.cs
Normal file
31
BTCPayServer/Models/EmailsViewModel.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using BTCPayServer.Services.Mails;
|
||||
using BTCPayServer.Validation;
|
||||
|
||||
namespace BTCPayServer.Models;
|
||||
|
||||
public class EmailsViewModel
|
||||
{
|
||||
public EmailSettings Settings { get; set; }
|
||||
public EmailSettings FallbackSettings { get; set; }
|
||||
public bool PasswordSet { get; set; }
|
||||
|
||||
[MailboxAddress]
|
||||
[Display(Name = "Test Email")]
|
||||
public string TestEmail { get; set; }
|
||||
|
||||
public EmailsViewModel()
|
||||
{
|
||||
}
|
||||
|
||||
public EmailsViewModel(EmailSettings settings, EmailSettings fallbackSettings = null)
|
||||
{
|
||||
Settings = settings;
|
||||
FallbackSettings = fallbackSettings;
|
||||
PasswordSet = !string.IsNullOrEmpty(settings?.Password);
|
||||
}
|
||||
|
||||
public bool IsSetup() => Settings?.IsComplete() is true;
|
||||
public bool IsFallbackSetup() => FallbackSettings?.IsComplete() is true;
|
||||
public bool UsesFallback() => IsFallbackSetup() && Settings == FallbackSettings;
|
||||
}
|
||||
Reference in New Issue
Block a user