From 1ee494a045f496eec71ed200fc1c7368be91dc4d Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 23 Mar 2024 00:54:09 +0100 Subject: [PATCH] [Port] gitea#29982 Introduce `.secondary-nav` and handle `.page-content` spacing universally Fixes: https://github.com/go-gitea/gitea/issues/29981. Introduce `.secondary-nav` as a universal way for styling and margin adjustments inside `.page-content`. If the first child of `.page-content` is `.secondary-nav`, we add margin below it, otherwise we add padding to the first child. Notable changes: - `--color-header-wrapper` is replaced with `--color-secondary-nav-bg`. - `navbar` class is removed. Co-authored-by: Giteabot Co-authored-by: wxiaoguang --- Conflict resolution: Trivial conflict & changed selector to reflect new classes. Ref: https://codeberg.org/forgejo/forgejo/issues/2776 (cherry picked from commit 3ccda41a539b8ba7841919ee12dc2877ddc03818) --- templates/admin/layout_head.tmpl | 2 +- templates/explore/navbar.tmpl | 2 +- templates/repo/header.tmpl | 4 ++-- templates/user/auth/link_account.tmpl | 2 +- templates/user/auth/signin_navbar.tmpl | 2 +- templates/user/auth/signup_openid_navbar.tmpl | 2 +- templates/user/dashboard/navbar.tmpl | 3 +-- tests/e2e/example.test.e2e.js | 2 +- tests/e2e/utils_e2e.js | 2 +- web_src/css/base.css | 18 ++++++++++++++---- web_src/css/dashboard.css | 12 ++++++------ web_src/css/explore.css | 6 ++---- web_src/css/modules/navbar.css | 4 ++++ web_src/css/repo.css | 10 ---------- web_src/css/repo/header.css | 11 +++++------ web_src/css/themes/theme-gitea-dark.css | 2 +- web_src/css/themes/theme-gitea-light.css | 2 +- web_src/css/user.css | 4 ---- 18 files changed, 43 insertions(+), 47 deletions(-) diff --git a/templates/admin/layout_head.tmpl b/templates/admin/layout_head.tmpl index b326c82a6..c1f5fb331 100644 --- a/templates/admin/layout_head.tmpl +++ b/templates/admin/layout_head.tmpl @@ -1,6 +1,6 @@ {{template "base/head" .ctxData}}
-
+
{{template "base/alert" .ctxData}}
diff --git a/templates/explore/navbar.tmpl b/templates/explore/navbar.tmpl index 8841613b9..8e619fa66 100644 --- a/templates/explore/navbar.tmpl +++ b/templates/explore/navbar.tmpl @@ -1,4 +1,4 @@ - +
{{svg "octicon-repo"}} {{ctx.Locale.Tr "explore.repos"}} diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 6f2bf4229..f10efa1e3 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -1,4 +1,4 @@ -
+
{{with .Repository}}
{{end}} - + {{if not (or .Repository.IsBeingCreated .Repository.IsBroken)}}
{{if .Permission.CanRead $.UnitTypeCode}} diff --git a/templates/user/auth/link_account.tmpl b/templates/user/auth/link_account.tmpl index 81ea92c95..8dd49ccd6 100644 --- a/templates/user/auth/link_account.tmpl +++ b/templates/user/auth/link_account.tmpl @@ -1,6 +1,6 @@ {{template "base/head" .}}