diff --git a/public/assets/js/admin.js b/public/assets/js/admin.js new file mode 100644 index 0000000..84ddcd8 --- /dev/null +++ b/public/assets/js/admin.js @@ -0,0 +1,10 @@ +document.addEventListener('DOMContentLoaded', function () { + var checkAll = document.getElementById('check-all'); + if (checkAll) { + checkAll.addEventListener('change', function () { + document.querySelectorAll('.bulk-check').forEach(function (cb) { + cb.checked = checkAll.checked; + }); + }); + } +}); diff --git a/public/index.php b/public/index.php index 1e5954a..e40a8ff 100644 --- a/public/index.php +++ b/public/index.php @@ -2463,6 +2463,9 @@ switch ($action) { if ($cat !== '' && in_array($cat, $privateCats, true) && !isLoggedIn()) { return false; } + if (strtotime((string)($a['published_at'] ?? '')) > time() && !hasCapability('view_previews')) { + return false; + } if ($filterCat !== '' && $cat !== $filterCat) { return false; } diff --git a/templates/admin.php b/templates/admin.php index fa5cef0..aadf105 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -214,11 +214,7 @@ function adminStatusBadge(array $a, int $now): string - +