From 93d18ab25fd3943ada8728f2556ad3c5ccdee5d3 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Mon, 1 Jun 2026 05:23:56 -0500 Subject: [PATCH] feat(licenses): double confirmation modals for permanent deletion (#391) Replace link-action delete buttons with show-modal pattern that opens a Fomantic UI modal with a form. Package deletion requires typing the package name in a required field before the submit button works. Key deletion shows a warning modal with confirmation. Uses Gitea's existing form-fetch-action + modal_actions_confirm pattern, matching how repo deletion works in settings. Both repo and org templates updated with matching modals. Co-Authored-By: Claude Opus 4.6 (1M context) --- options/locale/locale_en-US.json | 3 +++ templates/org/licenses.tmpl | 35 +++++++++++++++++++++++++++--- templates/repo/licenses.tmpl | 37 +++++++++++++++++++++++++++++--- 3 files changed, 69 insertions(+), 6 deletions(-) diff --git a/options/locale/locale_en-US.json b/options/locale/locale_en-US.json index 6a4242e4e5..c88a1c2e2f 100644 --- a/options/locale/locale_en-US.json +++ b/options/locale/locale_en-US.json @@ -2707,6 +2707,9 @@ "repo.licenses.repo_scope": "Repository Scope", "repo.licenses.repo_scope_all": "All repositories in this organization", "repo.licenses.repo_scope_help": "Which repositories this package's keys can access. Select a specific repo or allow all.", + "repo.licenses.confirm_delete_package_typed": "This will permanently delete the package and may orphan associated keys. This action cannot be undone.", + "repo.licenses.confirm_delete_key_typed": "This will permanently remove the license key record. The licensee will immediately lose access.", + "repo.licenses.type_name_to_confirm": "Type the package name to confirm:", "repo.settings.download_gating": "Download Gating", "repo.settings.support_url": "Support / Product Page URL", "repo.settings.support_url_help": "Shown when downloads are gated. Can point to your wiki, product page, or external support site.", diff --git a/templates/org/licenses.tmpl b/templates/org/licenses.tmpl index 17f6614c4b..4a42992c42 100644 --- a/templates/org/licenses.tmpl +++ b/templates/org/licenses.tmpl @@ -131,7 +131,7 @@ {{svg "octicon-archive" 14}} {{if $.CanDelete}} - {{end}} @@ -206,7 +206,7 @@ {{svg "octicon-x" 14}} {{if $.CanDelete}} - {{end}} @@ -246,7 +246,7 @@ {{svg "octicon-reply" 14}} {{if $.CanDelete}} - {{end}} @@ -261,4 +261,33 @@ {{end}} + + + + + {{template "base/footer" .}} diff --git a/templates/repo/licenses.tmpl b/templates/repo/licenses.tmpl index c6b8950a18..de05e12051 100644 --- a/templates/repo/licenses.tmpl +++ b/templates/repo/licenses.tmpl @@ -70,7 +70,7 @@ {{svg "octicon-archive" 14}} {{if $.CanDelete}} - {{end}} @@ -212,7 +212,7 @@ {{svg "octicon-x" 14}} {{if $.CanDelete}} - {{end}} @@ -252,7 +252,7 @@ {{svg "octicon-reply" 14}} {{if $.CanDelete}} - {{end}} @@ -301,4 +301,35 @@ {{end}} + +{{/* ── Delete Package Confirmation Modal ── */}} + + +{{/* ── Delete Key Confirmation Modal ── */}} + + {{template "base/footer" .}}