From 72bac983657c561b0318d908ecbaae3959d7a81e Mon Sep 17 00:00:00 2001 From: Gusted Date: Fri, 8 Aug 2025 01:53:23 +0200 Subject: [PATCH] feat: require `data-modal-id` for delete buttons (#8711) All instances should have a `data-modal-id` now. Throw a user-friendly error if this is not the case (custom templates, or missed cases). Checked via `rg -P -e '^(?=.*delete-button)' | grep -v "data-modal-id"` Removed two instances of delete modals and one case of simplified logic. ## Rationale I am currently surveying the existing modals in Forgejo in the context of eventually replacing the modals implementation with our own modal implementation. This refactor fixes one of the many inconsistencies that the current usage of modals has. It should explicitly specify which modal should be used to avoids any problems if new modals are introduced on the page (for example via https://codeberg.org/forgejo/forgejo/pulls/8662). Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8711 Reviewed-by: oliverpool Co-authored-by: Gusted Co-committed-by: Gusted --- templates/admin/auth/edit.tmpl | 4 ++-- templates/admin/emails/list.tmpl | 4 ++-- templates/admin/packages/list.tmpl | 4 ++-- templates/admin/repo/list.tmpl | 4 ++-- templates/admin/stacktrace-row.tmpl | 2 +- templates/admin/stacktrace.tmpl | 2 +- templates/org/settings/delete.tmpl | 4 ++-- templates/org/team/new.tmpl | 4 ++-- templates/projects/list.tmpl | 4 ++-- templates/projects/view.tmpl | 4 ++-- templates/repo/branch/list.tmpl | 4 ++-- templates/repo/issue/labels/edit_delete_label.tmpl | 2 +- templates/repo/issue/labels/label_list.tmpl | 7 ++----- templates/repo/issue/milestones.tmpl | 4 ++-- templates/repo/issue/view_content.tmpl | 2 +- templates/repo/issue/view_content/pull.tmpl | 4 ++-- templates/repo/release/list.tmpl | 13 ------------- templates/repo/release/new.tmpl | 4 ++-- templates/repo/settings/branches.tmpl | 4 ++-- templates/repo/settings/collaboration.tmpl | 6 +++--- templates/repo/settings/deploy_keys.tmpl | 4 ++-- templates/repo/settings/webhook/base_list.tmpl | 2 +- templates/repo/settings/webhook/delete_modal.tmpl | 2 +- templates/repo/tag/list.tmpl | 4 ++-- templates/repo/wiki/view.tmpl | 4 ++-- templates/shared/actions/runner_edit.tmpl | 2 +- templates/user/dashboard/milestones.tmpl | 11 ----------- templates/webhook/shared-settings.tmpl | 2 +- web_src/js/features/common-global.js | 9 +++++---- 29 files changed, 50 insertions(+), 76 deletions(-) diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index 11be03acc5..d4eaa29117 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -404,7 +404,7 @@
- +
@@ -421,7 +421,7 @@ -