btcpayserver/BTCPayServer/Views/UIManage/NotificationSettings.cshtml

42 lines
1.8 KiB
Text
Raw Normal View History

@using BTCPayServer.Abstractions.Contracts
2022-01-07 12:32:00 +09:00
@model BTCPayServer.Controllers.UIManageController.NotificationSettingsViewModel
@inject IEnumerable<INotificationHandler> NotificationHandlers
@{
ViewData.SetActivePage(ManageNavPages.Notifications, "Notification Settings");
}
2021-11-12 21:25:24 -08:00
<h2 class="mb-4">@ViewData["Title"]</h2>
<form method="post" asp-action="NotificationSettings">
@if (Model.All)
{
<div>
All notifications are disabled.
<button type="submit" class="btn btn-primary" name="command" value="enable-all">Enable</button>
</div>
}
else
{
<div class="form-group">
<p>Do not receive notifications for</p>
<div class="card">
<ul class="list-group list-group-flush">
@for (var index = 0; index < Model.DisabledNotifications.Count; index++)
{
var item = Model.DisabledNotifications[index];
<li class="list-group-item">
<input type="hidden" asp-for="DisabledNotifications[index].Value"/>
<input type="checkbox" asp-for="DisabledNotifications[index].Selected" class="form-check-input form-check-inline"/>
<label class="mb-0 cursor-pointer" asp-for="DisabledNotifications[index].Selected">
@item.Text
</label>
</li>
}
</ul>
</div>
</div>
2021-11-12 21:25:24 -08:00
<div class="form-group mt-4">
<button type="submit" class="btn btn-primary" name="command" value="update">Save</button>
2021-11-12 21:25:24 -08:00
<button type="submit" class="btn btn-secondary ms-3" name="command" value="disable-all">Disable all</button>
</div>
}
2021-11-12 21:25:24 -08:00
</form>