]> source.dussan.org Git - gitea.git/commitdiff
Rename CodeIndexerEnabled to IsRepoIndexerEnabled (#30762) (#30767)
authorGiteabot <teabot@gitea.io>
Mon, 29 Apr 2024 21:57:48 +0000 (05:57 +0800)
committerGitHub <noreply@github.com>
Mon, 29 Apr 2024 21:57:48 +0000 (21:57 +0000)
Backport #30762 by @wxiaoguang

Fix  #30761

Most places use `IsRepoIndexerEnabled` but not `CodeIndexerEnabled`, so
it should always use `IsRepoIndexerEnabled` for consistency.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
routers/web/repo/search.go
routers/web/repo/setting/setting.go
templates/repo/settings/options.tmpl
templates/shared/search/code/search.tmpl

index 46f020845358523aeaf9455716677bafa1cb459d..23cf898630f672bb7ede0beaf75bc083c10be869 100644 (file)
@@ -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
index b55e259e4bea9e266ff6b1e1c7f2779160da1935..17a400e3607e5fdd4e2e0362daa3205a06b51529 100644 (file)
@@ -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
 
index 390351723b0779773ced4018f40f6593e0b79dbf..40617021d91c073953b127b5cee8a49e6a893cc1 100644 (file)
                        <form class="ui form" method="post">
                                {{.CsrfTokenHtml}}
                                <input type="hidden" name="action" value="admin_index">
-                               {{if .CodeIndexerEnabled}}
+                               {{if .IsRepoIndexerEnabled}}
                                        <h4 class="ui header">{{ctx.Locale.Tr "repo.settings.admin_code_indexer"}}</h4>
                                        <div class="inline fields">
                                                <label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
index cb873f5a92953430ae313e4ea2c267ea0a001e10..e49ea47e03482dfc832e2300d47658fea6588c42 100644 (file)
@@ -8,7 +8,7 @@
                        <p>{{ctx.Locale.Tr "search.code_search_unavailable"}}</p>
                </div>
        {{else}}
-               {{if not .CodeIndexerEnabled}}
+               {{if not .IsRepoIndexerEnabled}}
                        <div class="ui message">
                                <p>{{ctx.Locale.Tr "search.code_search_by_git_grep"}}</p>
                        </div>