mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-10 17:26:05 +01:00
* Resolves: check box to toggle in various setting views * resolve conflicts * Notification logic reversal * remove transform property in the toggle * Handle email tls certificate check * Unifications and fixes --------- Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
51 lines
2.1 KiB
Text
51 lines
2.1 KiB
Text
@model BTCPayServer.Controllers.UIManageController.NotificationSettingsViewModel
|
|
@{
|
|
ViewData.SetActivePage(ManageNavPages.Notifications, "Notification Settings");
|
|
}
|
|
<h3 class="mb-3">@ViewData["Title"]</h3>
|
|
|
|
<div class="row">
|
|
<div class="col-xl-8 col-xxl-constrain">
|
|
<form method="post" asp-action="NotificationSettings">
|
|
@if (Model.All)
|
|
{
|
|
<p>All notifications are disabled.</p>
|
|
<button type="submit" class="btn btn-primary" name="command" value="enable-all">Enable notifications</button>
|
|
}
|
|
else
|
|
{
|
|
<p>To disable notification for a feature, kindly toggle off the specified feature.</p>
|
|
@for (var index = 0; index < Model.DisabledNotifications.Count; index++)
|
|
{
|
|
var item = Model.DisabledNotifications[index];
|
|
<div class="d-flex align-items-center my-3">
|
|
<input type="hidden" asp-for="DisabledNotifications[index].Value" />
|
|
<input type="checkbox" asp-for="DisabledNotifications[index].Selected" class="btcpay-toggle me-3" />
|
|
<label class="form-check-label cursor-pointer" asp-for="DisabledNotifications[index].Selected">
|
|
@item.Text
|
|
</label>
|
|
</div>
|
|
}
|
|
<div class="mt-4">
|
|
<button type="submit" class="btn btn-primary" name="command" value="update">Save</button>
|
|
<button type="submit" class="btn btn-secondary ms-3" name="command" value="disable-all">Disable all notifications</button>
|
|
</div>
|
|
}
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function toggleAllCheckboxes(checkbox) {
|
|
var checkboxes = document.querySelectorAll('.btcpay-toggle');
|
|
var label = document.getElementById('toggleAllLabel');
|
|
var isChecked = checkbox.checked;
|
|
|
|
checkboxes.forEach(function (item) {
|
|
item.checked = isChecked;
|
|
});
|
|
|
|
label.textContent = isChecked ? 'Disable All' : 'Enable All';
|
|
}
|
|
</script>
|
|
|