2022-01-07 12:32:00 +09:00
|
|
|
@model BTCPayServer.Controllers.UIManageController.NotificationSettingsViewModel
|
2020-10-20 13:09:09 +02:00
|
|
|
@{
|
2024-10-25 15:48:53 +02:00
|
|
|
ViewData.SetActivePage(ManageNavPages.Notifications, StringLocalizer["Notification Settings"]);
|
2020-10-20 13:09:09 +02:00
|
|
|
}
|
|
|
|
|
2024-06-19 15:23:10 +02:00
|
|
|
<form method="post" asp-action="NotificationSettings">
|
|
|
|
<div class="sticky-header">
|
2024-06-23 19:38:34 +02:00
|
|
|
<nav aria-label="breadcrumb">
|
|
|
|
<ol class="breadcrumb">
|
|
|
|
<li class="breadcrumb-item">
|
2024-10-17 15:51:40 +02:00
|
|
|
<a asp-controller="UINotifications" asp-action="Index" text-translate="true">Notifications</a>
|
2024-06-23 19:38:34 +02:00
|
|
|
</li>
|
2024-10-17 15:51:40 +02:00
|
|
|
<li class="breadcrumb-item active" aria-current="page" text-translate="true">@ViewData["Title"]</li>
|
2024-06-23 19:38:34 +02:00
|
|
|
</ol>
|
2024-07-25 22:46:02 +09:00
|
|
|
<h2 text-translate="true">@ViewData["Title"]</h2>
|
2024-06-23 19:38:34 +02:00
|
|
|
</nav>
|
2024-07-25 15:23:28 +09:00
|
|
|
<button id="page-primary" type="submit" class="btn btn-primary" name="command" value="update">Save</button>
|
2024-06-19 15:23:10 +02:00
|
|
|
</div>
|
|
|
|
<partial name="_StatusMessage" />
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xl-8 col-xxl-constrain">
|
2022-01-27 03:56:46 +01:00
|
|
|
@if (Model.All)
|
|
|
|
{
|
2024-10-17 15:51:40 +02:00
|
|
|
<p text-translate="true">All notifications are disabled.</p>
|
2024-10-25 15:48:53 +02:00
|
|
|
<button type="submit" class="btn btn-primary" name="command" value="enable-all" text-translate="true">Enable notifications</button>
|
2022-01-27 03:56:46 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2024-10-17 15:51:40 +02:00
|
|
|
<p text-translate="true">To disable notification for a feature, kindly toggle off the specified feature.</p>
|
2024-03-14 15:16:48 +01:00
|
|
|
@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" />
|
2024-10-25 15:48:53 +02:00
|
|
|
<label class="form-check-label cursor-pointer" asp-for="DisabledNotifications[index].Selected" text-translate="true">@item.Text</label>
|
2022-01-27 03:56:46 +01:00
|
|
|
</div>
|
2024-03-14 15:16:48 +01:00
|
|
|
}
|
|
|
|
<div class="mt-4">
|
2024-10-17 15:51:40 +02:00
|
|
|
<button type="submit" class="btn btn-secondary" name="command" value="disable-all" text-translate="true">Disable all notifications</button>
|
2022-01-27 03:56:46 +01:00
|
|
|
</div>
|
|
|
|
}
|
2024-06-19 15:23:10 +02:00
|
|
|
</div>
|
2022-01-27 03:56:46 +01:00
|
|
|
</div>
|
2024-06-19 15:23:10 +02:00
|
|
|
</form>
|
2024-03-14 15:16:48 +01:00
|
|
|
|
|
|
|
<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>
|
|
|
|
|