From 3c845f9d40b318b0c8c2b66db310454f55221c97 Mon Sep 17 00:00:00 2001 From: Pontoporeia Date: Sun, 5 Jul 2026 11:13:05 +0200 Subject: [PATCH] acces.php: remove Mot de passe column, add key icon copy button, reorder actions, switch URL icon to link-simple; fix dialog functions not on window; fix archive: move form into dialog (native submit); add caret icon to archived links details --- TODO.md | 1 + app/public/assets/css/admin.css | 12 ++++-- app/public/assets/icons/key.svg | 1 + app/public/assets/icons/link-simple.svg | 1 + app/public/assets/js/app/admin-acces.js | 21 +++------- app/templates/admin/acces.php | 54 ++++++++++--------------- 6 files changed, 39 insertions(+), 51 deletions(-) create mode 100644 app/public/assets/icons/key.svg create mode 100644 app/public/assets/icons/link-simple.svg diff --git a/TODO.md b/TODO.md index 129eedd..792a118 100644 --- a/TODO.md +++ b/TODO.md @@ -19,3 +19,4 @@ - [x] Move cleanup UI from modal to dedicated page (like add.php/edit.php) - [x] Replace
with
/ in cleanup fragments (like contenus.php) - [x] Standardise test group recipes: lint-php, lint-css, lint-js, test + add fix recipe + make lint pass clean +- [x] Remove Mot de passe column from acces.php, add key.svg icon button in Actions to copy password to clipboard, reorder actions (URL/password/edit/toggle/archive), switch URL icon to link-simple.svg diff --git a/app/public/assets/css/admin.css b/app/public/assets/css/admin.css index 51fc42d..167f6b3 100644 --- a/app/public/assets/css/admin.css +++ b/app/public/assets/css/admin.css @@ -1157,7 +1157,8 @@ th.admin-ap-col { /*
/ inside cleanup sections */ .n-grid > details > summary, -.n-section > summary { +.n-section > summary, +.admin-archived-links > summary { cursor: pointer; font-weight: 600; font-size: var(--step--1); @@ -1170,7 +1171,8 @@ th.admin-ap-col { gap: var(--space-2xs); } .n-grid > details > summary::-webkit-details-marker, -.n-section > summary::-webkit-details-marker { +.n-section > summary::-webkit-details-marker, +.admin-archived-links > summary::-webkit-details-marker { display: none; } .n-section[open], @@ -1184,7 +1186,8 @@ th.admin-ap-col { } .n-grid > details > summary::before, -.n-section > summary::before { +.n-section > summary::before, +.admin-archived-links > summary::before { content: ""; display: inline-block; width: 16px; @@ -1198,7 +1201,8 @@ th.admin-ap-col { transition: transform 0.15s; } .n-grid > details[open] > summary::before, -.n-section[open] > summary::before { +.n-section[open] > summary::before, +.admin-archived-links[open] > summary::before { transform: rotate(90deg); } .n-grid > details > :not(summary), diff --git a/app/public/assets/icons/key.svg b/app/public/assets/icons/key.svg new file mode 100644 index 0000000..a43a4b2 --- /dev/null +++ b/app/public/assets/icons/key.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/public/assets/icons/link-simple.svg b/app/public/assets/icons/link-simple.svg new file mode 100644 index 0000000..aa60753 --- /dev/null +++ b/app/public/assets/icons/link-simple.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/public/assets/js/app/admin-acces.js b/app/public/assets/js/app/admin-acces.js index 84003b5..9f83a41 100644 --- a/app/public/assets/js/app/admin-acces.js +++ b/app/public/assets/js/app/admin-acces.js @@ -74,38 +74,29 @@ function _copyTextToClipboard(text) { .catch(() => {}); } -function _openEditDialog(id, name, _hasPassword, expiresVal) { +window.openEditDialog = function (id, name, _hasPassword, expiresVal) { document.getElementById("edit-link-id").value = id; document.getElementById("edit-name").value = name || ""; document.getElementById("edit-expires").value = expiresVal || ""; document.getElementById("edit-dialog").showModal(); } -function _openApproveDialog(requestId) { +window.openApproveDialog = function (requestId) { document.getElementById("approve-request-id").value = requestId; document.getElementById("approve-dialog").showModal(); } -function _openRejectDialog(requestId) { +window.openRejectDialog = function (requestId) { document.getElementById("reject-request-id").value = requestId; document.getElementById("reject-dialog").showModal(); } -var _pendingArchiveLinkId = null; - -function _openArchiveLinkDialog(id) { - _pendingArchiveLinkId = id; +window.openArchiveLinkDialog = function (id) { + document.getElementById("archive-link-id").value = id; document.getElementById("archive-link-dialog").showModal(); } -function _executeArchiveLink() { - var form = document.getElementById( - `archive-link-form-${_pendingArchiveLinkId}`, - ); - if (form) form.submit(); -} - -function _openDeleteArchivedLinkDialog(id) { +window.openDeleteArchivedLinkDialog = function (id) { document.getElementById("delete-archived-link-id").value = id; document.getElementById("delete-archived-link-dialog").showModal(); } diff --git a/app/templates/admin/acces.php b/app/templates/admin/acces.php index 71d9ebb..559aef3 100644 --- a/app/templates/admin/acces.php +++ b/app/templates/admin/acces.php @@ -28,7 +28,6 @@ Objet Année Statut - Mot de passe Utilisations Expiration Créé le @@ -78,34 +77,26 @@ - - -
- Oui - - -
- - Non - -
+ + + + + -
@@ -120,16 +111,10 @@
- +
@@ -139,7 +124,7 @@ -
+