Files
btcpayserver/BTCPayServer/Views/Notifications/Index.cshtml
d11n ed7031981b Bootstrap v5 migration (#2490)
* Swap bootstrap asset files

* Update themes and color definitions

* Move general bootstrap customizations

* Theme updates

Theme updates

* Remove BuildBundlerMinifier

This lead to an error, because BuildBundlerMinifier and BundlerMinifier.Core seem to conflict here. Details: https://stackoverflow.com/a/61119586

* Rewplace btn-block class with w-100

* Update badge classes

* Remove old font family head variable

* Update margin classes

* Cleanups

* Update float classes

* Update text classes

* Update padding classes

* Update border classes

* UPdate dropdown classes

* Update select classes

* Update neutral custom props

* Update bootstrap and customizations

* Update ChromeDriver; disable smooth scroll

https://github.com/SeleniumHQ/selenium/issues/8295

* Improve alert messages

* Improve bootstrap customizations

* Disable reduced motion

See also 7358282f

* Update Bootstrap data attributes

* Update file inputs

* Update input groups

* Replace deprecated jumbotron class

* Update variables; re-add negative margin util classes

* Update cards

* Update form labels

* Debug alerts

* Fix aria-labelledby associations

* Dropdown-related test fixes

* Fix CanUseWebhooks test

* Test fixes

* Nav updates

* Fix nav usage in wallet send and payouts

* Update alert and modal close buttons

* Re-add backdrop properties

* Upgrade Bootstrap to v5 final

* Update screen reader classes

* Update font-weight classes

* Update monospace font classes

* Update accordians

* Update close icon usage

* Cleanup

* Update scripts and style integrations

* Update input group texts

* Update LN node setup page

* Update more form control classes

* Update inline forms

* Add js specific test

* Upgrade Vue.js

* Remove unused JS

* Upgrade Bootstrap to v5.0.1

* Try container related test updates

* Separate jQuery bundle

* Remove jQuery from LND seed backup page

* Remove unused code

* Refactor email autofill js

* Refactor camera scanner JS

* Re-add tests

* Re-add BuildBundlerMinifier

* Do not minify bundles containing Bootstrap

Details https://github.com/madskristensen/BundlerMinifier/issues/558

* Update bundles

* Cleanup JS test

* Cleanup tests involving dropdowns

* Cleanup tests involving collapses

* Cleanup locale additions in ConfigureCore

* Cleanup bundles

* Remove duplicate status message

* Cleanup formatting

* Fix missing validation scripts

* Remove unused unminified Bootstrap js files

* Fix classic theme

* Fix Casa theme

* Fix PoS validation
2021-05-19 11:39:27 +09:00

150 lines
5.9 KiB
Plaintext

@model BTCPayServer.Models.NotificationViewModels.IndexViewModel
@{
ViewData["Title"] = "Notifications";
}
<section>
<div class="container">
<partial name="_StatusMessage" />
<div class="row">
<div class="col-lg-12 section-heading">
<h2>@ViewData["Title"]</h2>
<hr class="primary">
</div>
</div>
<form method="post" asp-action="MassAction">
<div class="row button-row">
<div class="col-lg-6">
<span class="dropdown" style="display:none;" id="MassAction">
<button class="btn btn-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Actions
</button>
<div class="dropdown-menu">
<button type="submit" class="dropdown-item" name="command" value="mark-seen"><i class="fa fa-eye"></i> Mark seen</button>
<button type="submit" class="dropdown-item" name="command" value="mark-unseen"><i class="fa fa-eye-slash"></i> Mark unseen</button>
<button type="submit" class="dropdown-item" name="command" value="delete"><i class="fa fa-trash-o"></i> Delete</button>
</div>
</span>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<table class="table table-sm table-responsive-md">
<thead>
<tr>
<th width="30px" class="only-for-js">
@if (Model.Total > 0)
{
<input name="selectedItems" type="checkbox" onClick="selectAll(this);" />
}
</th>
<th width="190px">
Date
<a href="javascript:switchTimeFormat()">
<span class="fa fa-clock-o" title="Switch date format"></span>
</a>
</th>
<th>Message</th>
<th class="text-end">Actions</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Items)
{
<tr data-guid="@item.Id" class="notification-row @(item.Seen ? "seen" : "")">
<td class="only-for-js">
<input name="selectedItems" type="checkbox" class="selector" value="@item.Id"/>
</td>
<td onclick="toggleRowCheckbox(this)">
<span class="switchTimeFormat" data-switch="@item.Created.ToTimeAgo()">
@item.Created.ToBrowserDate()
</span>
</td>
<td onclick="toggleRowCheckbox(this)">
@item.Body
</td>
<td class="text-end fw-normal">
@if (!String.IsNullOrEmpty(item.ActionLink))
{
<a href="@item.ActionLink" class="btn btn-link p-0">Details</a>
<span class="d-none d-md-inline-block"> - </span>
}
<button onclick="return rowseen(this)" class="btn btn-link p-0 btn-toggle-seen" type="submit" name="command" value="flip-individual:@(item.Id)">
<span>Mark&nbsp;</span><span class="seen-text"></span>
</button>
</td>
</tr>
}
</tbody>
</table>
<vc:pager view-model="Model" />
</div>
</div>
</form>
</div>
</section>
<style>
.notification-row.loading {
cursor: wait;
pointer-events: none;
}
.seen-text::after {
content: "seen";
}
tr.seen td .seen-text::after {
content: "unseen";
}
tr td {
font-weight: bold;
}
tr.seen td {
font-weight: normal;
}
</style>
<script type="text/javascript">
function rowseen(sender) {
var row = $(sender).parents(".notification-row").toggleClass("loading");
var guid = row.data("guid");
var url = "@Url.Action("FlipRead", "Notifications", new {id = "placeholder"})".replace("placeholder", guid);
$.post(url, function (data) {
row.toggleClass("seen loading");
});
return false;
}
function toggleRowCheckbox(sender){
var input = $(sender).parents(".notification-row").find(".selector");
input.prop('checked', !input.prop("checked"));
updateSelectors();
}
function selectAll(sender){
var inputs = $(".notification-row").find(".selector");
inputs.each(function (index, input) {
$(input).prop("checked", !$(input).prop("checked"));
});
updateSelectors();
}
document.addEventListener("DOMContentLoaded", function () {
$(".selector").change(updateSelectors);
updateSelectors();
});
function updateSelectors() {
var count = $(".selector:checked").length;
if (count > 0) {
$("#MassAction").children().eq(0).text("Batch Action (" + count + ")");
$("#MassAction").show();
} else {
$("#MassAction").hide();
}
}
</script>