refactor(templates): remove ctxData from tmpl files, use ctx.RootData instead (#37567)

Sub-templates have direct access to `ctx.RootData` (the root data map),
so there is no need for callers to explicitly pass it as `ctxData` via `dict`.

Also fix #37569 by the way

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Copilot
2026-05-06 18:21:48 +00:00
committed by GitHub
parent ebc058f682
commit b093c2c43c
95 changed files with 140 additions and 140 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings actions")}}
{{template "org/settings/layout_head" (dict "pageClass" "organization settings actions")}}
<div class="org-setting-content">
{{if eq .PageType "runners"}}
{{template "shared/actions/runner_list" .}}
+1 -1
View File
@@ -1,4 +1,4 @@
{{template "org/settings/layout_head" (dict "ctxData" .)}}
{{template "org/settings/layout_head" (dict)}}
<div class="org-setting-content">
{{template "shared/actions/owner_general_settings" .}}
</div>
+1 -1
View File
@@ -1,4 +1,4 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings options")}}
{{template "org/settings/layout_head" (dict "pageClass" "organization settings options")}}
<div class="org-setting-content">
<h4 class="ui top attached header">
{{ctx.Locale.Tr "settings.applications"}}
@@ -1,4 +1,4 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings options")}}
{{template "org/settings/layout_head" (dict "pageClass" "organization settings options")}}
<div class="org-setting-content">
{{template "user/settings/applications_oauth2_edit_form" .}}
</div>
+1 -1
View File
@@ -1,4 +1,4 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings blocked_users")}}
{{template "org/settings/layout_head" (dict "pageClass" "organization settings blocked_users")}}
<div class="org-setting-content">
{{template "shared/user/blocked_users" .}}
</div>
+2 -2
View File
@@ -1,7 +1,7 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings new webhook")}}
{{template "org/settings/layout_head" (dict "pageClass" "organization settings new webhook")}}
<div class="org-setting-content">
{{$CustomHeaderTitle := ctx.Locale.Tr "repo.settings.update_webhook"}}
{{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = ctx.Locale.Tr "repo.settings.add_webhook"}}{{end}}
{{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}}
{{template "webhook/new" (dict "CustomHeaderTitle" $CustomHeaderTitle)}}
</div>
{{template "org/settings/layout_footer" .}}
+1 -1
View File
@@ -1,4 +1,4 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings webhooks")}}
{{template "org/settings/layout_head" (dict "pageClass" "organization settings webhooks")}}
<div class="org-setting-content">
{{template "repo/settings/webhook/base_list" .}}
</div>
+1 -1
View File
@@ -1,4 +1,4 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings labels")}}
{{template "org/settings/layout_head" (dict "pageClass" "organization settings labels")}}
<div class="org-setting-content">
<div class="flex-text-block">
<div class="tw-flex-1">
+5 -5
View File
@@ -1,10 +1,10 @@
{{template "base/head" .ctxData}}
<div role="main" aria-label="{{.ctxData.Title}}" class="page-content {{.pageClass}}">
{{template "org/header" .ctxData}}
{{template "base/head" ctx.RootData}}
<div role="main" aria-label="{{ctx.RootData.Title}}" class="page-content {{.pageClass}}">
{{template "org/header" ctx.RootData}}
<div class="ui container flex-container">
{{template "org/settings/navbar" .ctxData}}
{{template "org/settings/navbar" ctx.RootData}}
<div class="flex-container-main">
{{template "base/alert" .ctxData}}
{{template "base/alert" ctx.RootData}}
{{/* block: org-setting-content */}}
{{if false}}{{/* to make html structure "likely" complete to prevent IDE warnings */}}
+1 -1
View File
@@ -1,4 +1,4 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings options")}}
{{template "org/settings/layout_head" (dict "pageClass" "organization settings options")}}
<div class="ui segments org-setting-content">
<h4 class="ui top attached header">
+1 -1
View File
@@ -1,4 +1,4 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings packages")}}
{{template "org/settings/layout_head" (dict "pageClass" "organization settings packages")}}
<div class="org-setting-content">
{{template "package/shared/cleanup_rules/list" .}}
{{template "package/shared/cargo" .}}
@@ -1,4 +1,4 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings packages")}}
{{template "org/settings/layout_head" (dict "pageClass" "organization settings packages")}}
<div class="org-setting-content">
{{template "package/shared/cleanup_rules/edit" .}}
</div>
@@ -1,4 +1,4 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings packages")}}
{{template "org/settings/layout_head" (dict "pageClass" "organization settings packages")}}
<div class="org-setting-content">
{{template "package/shared/cleanup_rules/preview" .}}
</div>
+1 -1
View File
@@ -1,4 +1,4 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings runners")}}
{{template "org/settings/layout_head" (dict "pageClass" "organization settings runners")}}
<div class="org-setting-content">
{{template "shared/actions/runner_edit" .}}
</div>