1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-22 16:44:26 +00:00

Rename CodeIndexerEnabled to IsRepoIndexerEnabled (#30762)

Fix  #30761

Most places use `IsRepoIndexerEnabled` but not `CodeIndexerEnabled`, so
it should always use `IsRepoIndexerEnabled` for consistency.
This commit is contained in:
wxiaoguang 2024-04-30 04:15:35 +08:00 committed by GitHub
parent a21ca9b5a5
commit 4daea7c603
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View 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["Repo"] = ctx.Repo.Repository
ctx.Data["SearchResults"] = searchResults ctx.Data["SearchResults"] = searchResults
ctx.Data["SearchResultLanguages"] = searchResultLanguages ctx.Data["SearchResultLanguages"] = searchResultLanguages

View File

@ -65,7 +65,7 @@ func SettingsCtxData(ctx *context.Context) {
signing, _ := asymkey_service.SigningKey(ctx, ctx.Repo.Repository.RepoPath()) signing, _ := asymkey_service.SigningKey(ctx, ctx.Repo.Repository.RepoPath())
ctx.Data["SigningKeyAvailable"] = len(signing) > 0 ctx.Data["SigningKeyAvailable"] = len(signing) > 0
ctx.Data["SigningSettings"] = setting.Repository.Signing ctx.Data["SigningSettings"] = setting.Repository.Signing
ctx.Data["CodeIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
if ctx.Doer.IsAdmin { if ctx.Doer.IsAdmin {
if setting.Indexer.RepoIndexerEnabled { if setting.Indexer.RepoIndexerEnabled {
@ -110,7 +110,7 @@ func SettingsPost(ctx *context.Context) {
signing, _ := asymkey_service.SigningKey(ctx, ctx.Repo.Repository.RepoPath()) signing, _ := asymkey_service.SigningKey(ctx, ctx.Repo.Repository.RepoPath())
ctx.Data["SigningKeyAvailable"] = len(signing) > 0 ctx.Data["SigningKeyAvailable"] = len(signing) > 0
ctx.Data["SigningSettings"] = setting.Repository.Signing ctx.Data["SigningSettings"] = setting.Repository.Signing
ctx.Data["CodeIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
repo := ctx.Repo.Repository repo := ctx.Repo.Repository

View File

@ -739,7 +739,7 @@
<form class="ui form" method="post"> <form class="ui form" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<input type="hidden" name="action" value="admin_index"> <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> <h4 class="ui header">{{ctx.Locale.Tr "repo.settings.admin_code_indexer"}}</h4>
<div class="inline fields"> <div class="inline fields">
<label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label> <label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>

View File

@ -8,7 +8,7 @@
<p>{{ctx.Locale.Tr "search.code_search_unavailable"}}</p> <p>{{ctx.Locale.Tr "search.code_search_unavailable"}}</p>
</div> </div>
{{else}} {{else}}
{{if not .CodeIndexerEnabled}} {{if not .IsRepoIndexerEnabled}}
<div class="ui message"> <div class="ui message">
<p>{{ctx.Locale.Tr "search.code_search_by_git_grep"}}</p> <p>{{ctx.Locale.Tr "search.code_search_by_git_grep"}}</p>
</div> </div>