From 3ccda41a539b8ba7841919ee12dc2877ddc03818 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 23 Mar 2024 00:54:09 +0100 Subject: [PATCH] Introduce `.secondary-nav` and handle `.page-content` spacing universally (#29982) 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 --- 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 | 19 ++++++++++++++----- web_src/css/dashboard.css | 7 +++---- 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, 40 insertions(+), 46 deletions(-) diff --git a/templates/admin/layout_head.tmpl b/templates/admin/layout_head.tmpl index b326c82a6c..c1f5fb3314 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 8841613b9f..8e619fa66f 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 6edfee6c7c..187a56bdcc 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 81ea92c959..8dd49ccd60 100644 --- a/templates/user/auth/link_account.tmpl +++ b/templates/user/auth/link_account.tmpl @@ -1,6 +1,6 @@ {{template "base/head" .}}