From 4daea7c603c085eeda7017ac7188de7828824ed4 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 30 Apr 2024 04:15:35 +0800 Subject: [PATCH 1/2] Rename CodeIndexerEnabled to IsRepoIndexerEnabled (#30762) Fix #30761 Most places use `IsRepoIndexerEnabled` but not `CodeIndexerEnabled`, so it should always use `IsRepoIndexerEnabled` for consistency. --- routers/web/repo/search.go | 2 +- routers/web/repo/setting/setting.go | 4 ++-- templates/repo/settings/options.tmpl | 2 +- templates/shared/search/code/search.tmpl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/routers/web/repo/search.go b/routers/web/repo/search.go index 46f0208453..23cf898630 100644 --- a/routers/web/repo/search.go +++ b/routers/web/repo/search.go @@ -86,7 +86,7 @@ func Search(ctx *context.Context) { } } - ctx.Data["CodeIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled + ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled ctx.Data["Repo"] = ctx.Repo.Repository ctx.Data["SearchResults"] = searchResults ctx.Data["SearchResultLanguages"] = searchResultLanguages diff --git a/routers/web/repo/setting/setting.go b/routers/web/repo/setting/setting.go index b55e259e4b..17a400e360 100644 --- a/routers/web/repo/setting/setting.go +++ b/routers/web/repo/setting/setting.go @@ -65,7 +65,7 @@ func SettingsCtxData(ctx *context.Context) { signing, _ := asymkey_service.SigningKey(ctx, ctx.Repo.Repository.RepoPath()) ctx.Data["SigningKeyAvailable"] = len(signing) > 0 ctx.Data["SigningSettings"] = setting.Repository.Signing - ctx.Data["CodeIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled + ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled if ctx.Doer.IsAdmin { if setting.Indexer.RepoIndexerEnabled { @@ -110,7 +110,7 @@ func SettingsPost(ctx *context.Context) { signing, _ := asymkey_service.SigningKey(ctx, ctx.Repo.Repository.RepoPath()) ctx.Data["SigningKeyAvailable"] = len(signing) > 0 ctx.Data["SigningSettings"] = setting.Repository.Signing - ctx.Data["CodeIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled + ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled repo := ctx.Repo.Repository diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index 390351723b..40617021d9 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -739,7 +739,7 @@
{{.CsrfTokenHtml}} - {{if .CodeIndexerEnabled}} + {{if .IsRepoIndexerEnabled}}

{{ctx.Locale.Tr "repo.settings.admin_code_indexer"}}

diff --git a/templates/shared/search/code/search.tmpl b/templates/shared/search/code/search.tmpl index cb873f5a92..e49ea47e03 100644 --- a/templates/shared/search/code/search.tmpl +++ b/templates/shared/search/code/search.tmpl @@ -8,7 +8,7 @@

{{ctx.Locale.Tr "search.code_search_unavailable"}}

{{else}} - {{if not .CodeIndexerEnabled}} + {{if not .IsRepoIndexerEnabled}}

{{ctx.Locale.Tr "search.code_search_by_git_grep"}}

From a3d9f0d9151dbdcd77bf68f70b8e9497da5f2d3f Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 Apr 2024 22:53:15 +0200 Subject: [PATCH 2/2] Fix all rounded borders, change affected tab menus to pills (#30707) Fixes https://github.com/go-gitea/gitea/issues/30673, all 23 issues. Notes: - Tab bar menus had to change to pills because of unsolvable issue with the border-radius as tab bar renders a overlapping border onto the box below. And I think pills look better. - Added padding to code editor empty preview message - Hide monaco's built-in blue focus border, we don't need it and it never showed before either. - Label add menu is simplified, removing the nested segment. Screenshot 2024-04-25 at 22 26 19 Screenshot 2024-04-25 at 22 28 00 Screenshot 2024-04-25 at 22 36 53 Screenshot 2024-04-25 at 22 56 09 Screenshot 2024-04-25 at 22 57 12 --------- Co-authored-by: wxiaoguang Co-authored-by: Giteabot --- routers/web/repo/editor.go | 6 ++-- templates/org/team/members.tmpl | 4 +-- templates/org/team/navbar.tmpl | 2 +- templates/org/team/repositories.tmpl | 2 +- templates/repo/commit_page.tmpl | 2 +- templates/repo/editor/diff_preview.tmpl | 6 ++++ templates/repo/editor/edit.tmpl | 8 ++--- templates/repo/editor/patch.tmpl | 4 +-- .../issue/labels/label_load_template.tmpl | 33 +++++++++---------- templates/repo/tag/list.tmpl | 2 ++ .../notification_subscriptions.tmpl | 4 +-- templates/user/settings/account.tmpl | 2 +- templates/user/settings/applications.tmpl | 2 +- .../applications_oauth2_edit_form.tmpl | 2 +- .../settings/applications_oauth2_list.tmpl | 2 +- templates/user/settings/security/openid.tmpl | 2 +- web_src/css/features/codeeditor.css | 5 +++ web_src/css/modules/card.css | 1 + web_src/css/modules/menu.css | 20 +++++++++++ web_src/css/modules/modal.css | 2 ++ web_src/css/modules/segment.css | 8 ++++- web_src/css/repo.css | 18 ++++++++++ web_src/css/repo/list-header.css | 19 ----------- web_src/js/features/codeeditor.js | 1 + web_src/js/features/repo-editor.js | 18 +++++----- 25 files changed, 107 insertions(+), 68 deletions(-) diff --git a/routers/web/repo/editor.go b/routers/web/repo/editor.go index 474f7ff1da..474d7503e4 100644 --- a/routers/web/repo/editor.go +++ b/routers/web/repo/editor.go @@ -419,11 +419,9 @@ func DiffPreviewPost(ctx *context.Context) { return } - if diff.NumFiles == 0 { - ctx.PlainText(http.StatusOK, ctx.Locale.TrString("repo.editor.no_changes_to_show")) - return + if diff.NumFiles != 0 { + ctx.Data["File"] = diff.Files[0] } - ctx.Data["File"] = diff.Files[0] ctx.HTML(http.StatusOK, tplEditDiffPreview) } diff --git a/templates/org/team/members.tmpl b/templates/org/team/members.tmpl index 7e9a59a6bf..5433f01530 100644 --- a/templates/org/team/members.tmpl +++ b/templates/org/team/members.tmpl @@ -8,7 +8,7 @@
{{template "org/team/navbar" .}} {{if .IsOrganizationOwner}} -
+
{{.CsrfTokenHtml}} @@ -21,7 +21,7 @@
{{end}} -
+
{{range .Team.Members}}
diff --git a/templates/org/team/navbar.tmpl b/templates/org/team/navbar.tmpl index 8f2571e1f6..9704f63f6f 100644 --- a/templates/org/team/navbar.tmpl +++ b/templates/org/team/navbar.tmpl @@ -1,4 +1,4 @@ -
{{end}} -
+
{{range .Team.Repos}}
diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index 938d93b323..b8195ac544 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -139,7 +139,7 @@ {{end}} {{template "repo/commit_load_branches_and_tags" .}}
-
+
{{if .Author}} {{ctx.AvatarUtils.Avatar .Author 28 "tw-mr-2"}} diff --git a/templates/repo/editor/diff_preview.tmpl b/templates/repo/editor/diff_preview.tmpl index e2e922be34..fd543a5ab9 100644 --- a/templates/repo/editor/diff_preview.tmpl +++ b/templates/repo/editor/diff_preview.tmpl @@ -1,3 +1,4 @@ +{{if .File}}
@@ -9,3 +10,8 @@
+{{else}} +
+ {{ctx.Locale.Tr "repo.editor.no_changes_to_show"}} +
+{{end}} diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl index d52e5a047a..ae3f12669c 100644 --- a/templates/repo/editor/edit.tmpl +++ b/templates/repo/editor/edit.tmpl @@ -26,14 +26,14 @@
-