diff --git a/.codex-history.md b/.codex-history.md
index 5326d4ee7f..b37f3d55e3 100644
--- a/.codex-history.md
+++ b/.codex-history.md
@@ -888,3 +888,8 @@ History search guidance:
- 2 - Mod: `Retry` and `Delete This Repository` stay hidden until the migration task is fully stopped.
- 3 - Fix: canceled migrations now persist as `stopped` and no longer show the raw `clone error: context canceled ...` message.
- 4 - Fix: added an opt-in Windows process-tree kill for migration clone commands via `taskkill /T /F`, because Git helper processes could remain alive after `Cancel`, keep writing `tmp_pack_*`, and block cleanup or retry.
+
+185 - [2026-05-24 04:23:19] - v1.27.0-dev-196-g6ea9c8660f - Type: Modified - [admin] [badges] [orgs] [delete] Added direct delete actions in the admin badges and organizations tables.
+- 1 - Mod: `/-/admin/badges` now shows a delete button in each row that opens the badge delete modal directly from the table.
+- 2 - Mod: `/-/admin/orgs` now shows a delete button in each row that opens an organization delete modal directly from the table.
+- 3 - Mod: the new table actions reuse the original delete modal layouts already used in badge edit and organization settings, and deleting an organization from `/-/admin/orgs` now returns to the admin organizations list instead of `/`.
diff --git a/routers/web/admin/orgs.go b/routers/web/admin/orgs.go
index 62a8b30b13..b4ac3b6953 100644
--- a/routers/web/admin/orgs.go
+++ b/routers/web/admin/orgs.go
@@ -22,6 +22,7 @@ const (
func Organizations(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("admin.organizations")
ctx.Data["PageIsAdminOrganizations"] = true
+ ctx.Data["CurrentRequestURI"] = ctx.Req.RequestURI // edit/add - by petru @ codex
if ctx.FormString("sort") == "" {
ctx.SetFormString("sort", UserSearchDefaultAdminSort)
diff --git a/routers/web/org/setting.go b/routers/web/org/setting.go
index ca1da6617e..a091fab22c 100644
--- a/routers/web/org/setting.go
+++ b/routers/web/org/setting.go
@@ -14,6 +14,7 @@ import (
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/models/webhook"
+ "code.gitea.io/gitea/modules/httplib"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/optional"
repo_module "code.gitea.io/gitea/modules/repository"
@@ -39,6 +40,15 @@ const (
tplSettingsLabels templates.TplName = "org/settings/labels"
)
+// start edit/add - by petru @ codex
+func setOrgSettingsRedirectTo(ctx *context.Context) {
+ if redirectTo := ctx.FormString("redirect_to"); redirectTo != "" && httplib.IsRelativeURL(redirectTo) {
+ ctx.Data["RedirectTo"] = redirectTo
+ }
+}
+
+// end edit/add - by petru @ codex
+
// Settings render the main settings page
func Settings(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("org.settings")
@@ -47,6 +57,7 @@ func Settings(ctx *context.Context) {
ctx.Data["CurrentVisibility"] = ctx.Org.Organization.Visibility
ctx.Data["RepoAdminChangeTeamAccess"] = ctx.Org.Organization.RepoAdminChangeTeamAccess
ctx.Data["ContextUser"] = ctx.ContextUser
+ setOrgSettingsRedirectTo(ctx) // edit/add - by petru @ codex
if _, err := shared_user.RenderUserOrgHeader(ctx); err != nil {
ctx.ServerError("RenderUserOrgHeader", err)
@@ -63,6 +74,7 @@ func SettingsPost(ctx *context.Context) {
ctx.Data["PageIsOrgSettings"] = true
ctx.Data["PageIsSettingsOptions"] = true
ctx.Data["CurrentVisibility"] = ctx.Org.Organization.Visibility
+ setOrgSettingsRedirectTo(ctx) // edit/add - by petru @ codex
if ctx.HasError() {
ctx.HTML(http.StatusOK, tplSettingsOptions)
@@ -143,7 +155,13 @@ func SettingsDeleteOrgPost(ctx *context.Context) {
}
ctx.Flash.Success(ctx.Tr("org.settings.delete_successful", ctx.Org.Organization.Name))
- ctx.JSONRedirect(setting.AppSubURL + "/")
+ // start edit/add - by petru @ codex
+ redirectTo := setting.AppSubURL + "/"
+ if formRedirectTo := ctx.FormString("redirect_to"); formRedirectTo != "" && httplib.IsRelativeURL(formRedirectTo) {
+ redirectTo = formRedirectTo
+ }
+ ctx.JSONRedirect(redirectTo)
+ // end edit/add - by petru @ codex
}
// Webhooks render webhook list page
diff --git a/templates/admin/badge/list.tmpl b/templates/admin/badge/list.tmpl
index cc654aa796..3fb98f4795 100644
--- a/templates/admin/badge/list.tmpl
+++ b/templates/admin/badge/list.tmpl
@@ -51,10 +51,16 @@
{{.Description}} |
+ {{/* start edit/add - by petru @ codex */}}
+ {{/* end edit/add - by petru @ codex */}}
|
{{end}}
@@ -64,4 +70,19 @@
{{template "base/paginate" .}}
+
+{{/* start edit/add - by petru @ codex */}}
+
+{{/* end edit/add - by petru @ codex */}}
{{template "admin/layout_footer" .}}
diff --git a/templates/admin/org/list.tmpl b/templates/admin/org/list.tmpl
index 1bd7914097..4db81e99ea 100644
--- a/templates/admin/org/list.tmpl
+++ b/templates/admin/org/list.tmpl
@@ -77,7 +77,18 @@
{{.NumMembers}} |
{{.NumRepos}} |
{{DateUtils.AbsoluteShort .CreatedUnix}} |
- {{svg "octicon-pencil"}} |
+
+ {{/* start edit/add - by petru @ codex */}}
+
+ {{/* end edit/add - by petru @ codex */}}
+ |
{{else}}
| {{ctx.Locale.Tr "no_results_found"}} |
@@ -88,4 +99,40 @@
{{template "base/paginate" .}}
+
+{{/* start edit/add - by petru @ codex */}}
+
+
+
+
+
+ - {{ctx.Locale.Tr "org.settings.delete_notices_1"}}
+ - {{ctx.Locale.Tr "org.settings.delete_notices_2" ``}}
+ - {{ctx.Locale.Tr "org.settings.delete_notices_3" ``}}
+ - {{ctx.Locale.Tr "org.settings.delete_notices_4" ``}}
+
+
+
+
+
+{{/* end edit/add - by petru @ codex */}}
{{template "admin/layout_footer" .}}
diff --git a/templates/org/settings/options_dangerzone.tmpl b/templates/org/settings/options_dangerzone.tmpl
index df513c5525..cce3d62e0f 100644
--- a/templates/org/settings/options_dangerzone.tmpl
+++ b/templates/org/settings/options_dangerzone.tmpl
@@ -122,6 +122,11 @@