From 44e0cfa96e8f402b18b88be6ca5c2f368924bfa0 Mon Sep 17 00:00:00 2001 From: Hester Gong Date: Sun, 23 Apr 2023 18:21:21 +0800 Subject: [PATCH] Change to vertical navbar layout for secondary navbar for repo/user/admin settings (#24246) Co-Author: @wxiaoguang This is the first step of #24229. And this PR will only includes html changes, and followed by other PRs that fine tune css and change to submenus. After: Admin Level Screen Shot 2023-04-21 at 10 07 16 User Level Screen Shot 2023-04-21 at 10 07 23 Repo Level Screen Shot 2023-04-21 at 10 07 07 --------- Co-authored-by: wxiaoguang --- templates/admin/applications/list.tmpl | 20 +++++++------------ templates/admin/applications/oauth2_edit.tmpl | 11 +++++----- templates/admin/auth/edit.tmpl | 11 ++++------ templates/admin/auth/list.tmpl | 10 +++------- templates/admin/auth/new.tmpl | 10 +++------- templates/admin/config.tmpl | 10 +++------- templates/admin/dashboard.tmpl | 10 +++------- templates/admin/emails/list.tmpl | 10 +++------- templates/admin/hook_new.tmpl | 10 +++------- templates/admin/hooks.tmpl | 10 +++------- templates/admin/layout_footer.tmpl | 11 ++++++++++ templates/admin/layout_head.tmpl | 13 ++++++++++++ templates/admin/monitor.tmpl | 14 ++++++------- templates/admin/navbar.tmpl | 5 +++-- templates/admin/notice.tmpl | 11 ++++------ templates/admin/org/list.tmpl | 10 +++------- templates/admin/packages/list.tmpl | 11 ++++------ templates/admin/queue.tmpl | 15 ++++++-------- templates/admin/repo/list.tmpl | 11 ++++------ templates/admin/repo/unadopted.tmpl | 10 +++------- templates/admin/runners/base.tmpl | 9 +++------ templates/admin/runners/edit.tmpl | 9 +++------ templates/admin/stacktrace.tmpl | 11 ++++------ templates/admin/user/edit.tmpl | 11 ++++------ templates/admin/user/list.tmpl | 10 +++------- templates/admin/user/new.tmpl | 10 +++------- templates/org/settings/applications.tmpl | 15 +++----------- .../settings/applications_oauth2_edit.tmpl | 12 +++++------ templates/org/settings/delete.tmpl | 17 +++++----------- templates/org/settings/hook_new.tmpl | 16 ++++----------- templates/org/settings/hooks.tmpl | 14 +++---------- templates/org/settings/labels.tmpl | 18 ++++------------- templates/org/settings/layout_footer.tmpl | 11 ++++++++++ templates/org/settings/layout_head.tmpl | 14 +++++++++++++ templates/org/settings/options.tmpl | 15 +++----------- templates/org/settings/packages.tmpl | 15 +++----------- .../settings/packages_cleanup_rules_edit.tmpl | 15 +++----------- .../packages_cleanup_rules_preview.tmpl | 14 +++---------- templates/org/settings/runners.tmpl | 14 +++---------- templates/org/settings/runners_edit.tmpl | 14 +++---------- templates/org/settings/secrets.tmpl | 16 +++------------ templates/repo/settings/branches.tmpl | 11 +++------- templates/repo/settings/collaboration.tmpl | 12 ++++------- templates/repo/settings/deploy_keys.tmpl | 12 ++++------- templates/repo/settings/githook_edit.tmpl | 11 +++------- templates/repo/settings/githooks.tmpl | 11 +++------- templates/repo/settings/layout_footer.tmpl | 11 ++++++++++ templates/repo/settings/layout_head.tmpl | 14 +++++++++++++ templates/repo/settings/lfs.tmpl | 10 +++------- templates/repo/settings/lfs_file.tmpl | 11 +++------- templates/repo/settings/lfs_file_find.tmpl | 11 +++------- templates/repo/settings/lfs_locks.tmpl | 11 +++------- templates/repo/settings/lfs_pointers.tmpl | 11 +++------- templates/repo/settings/navbar.tmpl | 5 +++-- templates/repo/settings/options.tmpl | 12 +++-------- templates/repo/settings/protected_branch.tmpl | 11 +++------- templates/repo/settings/runner_edit.tmpl | 10 +++------- templates/repo/settings/runners.tmpl | 10 +++------- templates/repo/settings/secrets.tmpl | 11 +++------- templates/repo/settings/tags.tmpl | 11 +++------- templates/repo/settings/webhook/base.tmpl | 10 +++------- templates/repo/settings/webhook/list.tmpl | 1 - templates/repo/settings/webhook/new.tmpl | 11 +++------- templates/shared/actions/runner_edit.tmpl | 1 - templates/shared/actions/runner_list.tmpl | 1 - templates/user/settings/account.tmpl | 10 +++------- templates/user/settings/appearance.tmpl | 11 +++------- templates/user/settings/applications.tmpl | 11 +++------- .../settings/applications_oauth2_edit.tmpl | 12 +++++------ .../applications_oauth2_edit_form.tmpl | 1 - templates/user/settings/hook_new.tmpl | 14 +++++-------- templates/user/settings/hooks.tmpl | 9 +++------ templates/user/settings/keys.tmpl | 11 +++------- templates/user/settings/layout_footer.tmpl | 11 ++++++++++ templates/user/settings/layout_head.tmpl | 13 ++++++++++++ templates/user/settings/navbar.tmpl | 5 +++-- templates/user/settings/organization.tmpl | 12 +++++------ templates/user/settings/packages.tmpl | 9 +++------ .../settings/packages_cleanup_rules_edit.tmpl | 10 +++------- .../packages_cleanup_rules_preview.tmpl | 9 +++------ templates/user/settings/profile.tmpl | 10 +++------- templates/user/settings/repos.tmpl | 11 ++++------ templates/user/settings/secrets.tmpl | 10 +++------- .../user/settings/security/security.tmpl | 10 +++------- .../user/settings/security/twofa_enroll.tmpl | 10 +++------- 85 files changed, 350 insertions(+), 582 deletions(-) create mode 100644 templates/admin/layout_footer.tmpl create mode 100644 templates/admin/layout_head.tmpl create mode 100644 templates/org/settings/layout_footer.tmpl create mode 100644 templates/org/settings/layout_head.tmpl create mode 100644 templates/repo/settings/layout_footer.tmpl create mode 100644 templates/repo/settings/layout_head.tmpl create mode 100644 templates/user/settings/layout_footer.tmpl create mode 100644 templates/user/settings/layout_head.tmpl diff --git a/templates/admin/applications/list.tmpl b/templates/admin/applications/list.tmpl index 4da6cb0446..a292051fd0 100644 --- a/templates/admin/applications/list.tmpl +++ b/templates/admin/applications/list.tmpl @@ -1,14 +1,8 @@ -{{template "base/head" .}} -
- {{template "admin/navbar" .}} -
-
- {{template "base/alert" .}} -

- {{.locale.Tr "settings.applications"}} -

- {{template "user/settings/applications_oauth2_list" .}} -
+{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin config")}} +
+

+ {{.locale.Tr "settings.applications"}} +

+ {{template "user/settings/applications_oauth2_list" .}}
-
-{{template "base/footer" .}} +{{template "admin/layout_footer" .}} diff --git a/templates/admin/applications/oauth2_edit.tmpl b/templates/admin/applications/oauth2_edit.tmpl index 20231c4b1c..668bfe0633 100644 --- a/templates/admin/applications/oauth2_edit.tmpl +++ b/templates/admin/applications/oauth2_edit.tmpl @@ -1,7 +1,6 @@ -{{template "base/head" .}} -
- {{template "admin/navbar" .}} +{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin config")}} +
- {{template "user/settings/applications_oauth2_edit_form" .}} -
-{{template "base/footer" .}} + {{template "user/settings/applications_oauth2_edit_form" .}} +
+{{template "admin/layout_footer" .}} diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index c3ff228ac0..c39725699c 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -1,8 +1,5 @@ -{{template "base/head" .}} -
- {{template "admin/navbar" .}} -
- {{template "base/alert" .}} +{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin edit authentication")}} +

{{.locale.Tr "admin.auths.edit"}}

@@ -438,7 +435,6 @@
-
-{{template "base/footer" .}} + +{{template "admin/layout_footer" .}} diff --git a/templates/admin/auth/list.tmpl b/templates/admin/auth/list.tmpl index 3b8d17ff7d..5350672026 100644 --- a/templates/admin/auth/list.tmpl +++ b/templates/admin/auth/list.tmpl @@ -1,8 +1,5 @@ -{{template "base/head" .}} -
- {{template "admin/navbar" .}} -
- {{template "base/alert" .}} +{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin authentication")}} +

{{.locale.Tr "admin.auths.auth_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})
@@ -38,5 +35,4 @@

-
-{{template "base/footer" .}} +{{template "admin/layout_footer" .}} diff --git a/templates/admin/auth/new.tmpl b/templates/admin/auth/new.tmpl index b7715cb5fe..5d9a9083c5 100644 --- a/templates/admin/auth/new.tmpl +++ b/templates/admin/auth/new.tmpl @@ -1,8 +1,5 @@ -{{template "base/head" .}} -
- {{template "admin/navbar" .}} -
- {{template "base/alert" .}} +{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin new authentication")}} +

{{.locale.Tr "admin.auths.new"}}

@@ -122,5 +119,4 @@
-
-{{template "base/footer" .}} +{{template "admin/layout_footer" .}} diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index 14281c70c0..136ad38f16 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -1,8 +1,5 @@ -{{template "base/head" .}} -
- {{template "admin/navbar" .}} -
- {{template "base/alert" .}} +{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin config")}} +

{{.locale.Tr "admin.config.server_config"}}

@@ -426,5 +423,4 @@
-
-{{template "base/footer" .}} +{{template "admin/layout_footer" .}} diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl index fc1b1f4385..93fcae4ca4 100644 --- a/templates/admin/dashboard.tmpl +++ b/templates/admin/dashboard.tmpl @@ -1,8 +1,5 @@ -{{template "base/head" .}} -
- {{template "admin/navbar" .}} -
- {{template "base/alert" .}} +{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin dashboard")}} +
{{if .NeedUpdate}}

{{(.locale.Tr "admin.dashboard.new_version_hint" .RemoteVersion AppVer) | Str2html}}

@@ -145,5 +142,4 @@
-
-{{template "base/footer" .}} +{{template "admin/layout_footer" .}} diff --git a/templates/admin/emails/list.tmpl b/templates/admin/emails/list.tmpl index 61af571095..05c6aa66b4 100644 --- a/templates/admin/emails/list.tmpl +++ b/templates/admin/emails/list.tmpl @@ -1,8 +1,5 @@ -{{template "base/head" .}} -
- {{template "admin/navbar" .}} -
- {{template "base/alert" .}} +{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}} +

{{.locale.Tr "admin.emails.email_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})

@@ -101,5 +98,4 @@
-
-{{template "base/footer" .}} +{{template "admin/layout_footer" .}} diff --git a/templates/admin/hook_new.tmpl b/templates/admin/hook_new.tmpl index 0c018ff293..1abdd4c813 100644 --- a/templates/admin/hook_new.tmpl +++ b/templates/admin/hook_new.tmpl @@ -1,8 +1,5 @@ -{{template "base/head" .}} -
- {{template "admin/navbar" .}} -
- {{template "base/alert" .}} +{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin settings new webhook")}} +

{{if .PageIsAdminDefaultHooksNew}} {{.locale.Tr "admin.defaulthooks.add_webhook"}} @@ -55,5 +52,4 @@ {{template "repo/settings/webhook/history" .}}

-
-{{template "base/footer" .}} +{{template "admin/layout_footer" .}} diff --git a/templates/admin/hooks.tmpl b/templates/admin/hooks.tmpl index 26f92c7064..c77d27dbd0 100644 --- a/templates/admin/hooks.tmpl +++ b/templates/admin/hooks.tmpl @@ -1,13 +1,9 @@ -{{template "base/head" .}} -
- {{template "admin/navbar" .}} -
- {{template "base/alert" .}} +{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin hooks")}} +
{{template "repo/settings/webhook/base_list" .SystemWebhooks}} {{template "repo/settings/webhook/base_list" .DefaultWebhooks}} {{template "repo/settings/webhook/delete_modal" .}}
-
-{{template "base/footer" .}} +{{template "admin/layout_footer" .}} diff --git a/templates/admin/layout_footer.tmpl b/templates/admin/layout_footer.tmpl new file mode 100644 index 0000000000..8d6e564d51 --- /dev/null +++ b/templates/admin/layout_footer.tmpl @@ -0,0 +1,11 @@ +{{if false}}{{/* to make html structure "likely" complete to prevent IDE warnings */}} +
+
+
+ {{/* block: admin-setting-content */}} +{{end}} + +
+
+
+{{template "base/footer" .}} diff --git a/templates/admin/layout_head.tmpl b/templates/admin/layout_head.tmpl new file mode 100644 index 0000000000..6d84f8f359 --- /dev/null +++ b/templates/admin/layout_head.tmpl @@ -0,0 +1,13 @@ +{{template "base/head" .ctxData}} +
+
+ {{template "admin/navbar" .ctxData}} +
+ {{template "base/alert" .ctxData}} + {{/* block: admin-setting-content */}} + +{{if false}}{{/* to make html structure "likely" complete to prevent IDE warnings */}} +
+
+
+{{end}} diff --git a/templates/admin/monitor.tmpl b/templates/admin/monitor.tmpl index 4d66d3bfbb..4b9e51503c 100644 --- a/templates/admin/monitor.tmpl +++ b/templates/admin/monitor.tmpl @@ -1,8 +1,5 @@ -{{template "base/head" .}} -
- {{template "admin/navbar" .}} -
- {{template "base/alert" .}} +{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}} +
{{template "admin/cron" .}}

{{.locale.Tr "admin.monitor.queues"}} @@ -26,7 +23,7 @@ {{.Type}} {{.ExemplarType}} {{$sum := .NumberOfWorkers}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}} - {{$sum := .NumberInQueue}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}} + {{$sum = .NumberInQueue}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}} {{if lt $sum 0}}{{$.locale.Tr "admin.monitor.queue.review"}}{{else}}{{$.locale.Tr "admin.monitor.queue.review_add"}}{{end}} {{end}} @@ -36,7 +33,7 @@ {{template "admin/process" .}}

-
+ -{{template "base/footer" .}} + +{{template "admin/layout_footer" .}} diff --git a/templates/admin/navbar.tmpl b/templates/admin/navbar.tmpl index 97ee917167..e8eb54e58d 100644 --- a/templates/admin/navbar.tmpl +++ b/templates/admin/navbar.tmpl @@ -1,5 +1,6 @@ -