summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaiCandong <50507092+CaiCandong@users.noreply.github.com>2023-08-05 19:04:14 +0800
committerGitHub <noreply@github.com>2023-08-05 13:04:14 +0200
commit9ac6bb053cb2462770dc279b8a59ce944e8da8f6 (patch)
tree1e4f2f5a73c480d4e7ac976c35294d544eb8d3c5
parent952882fe4ab6950ca0fb33af3885cb3347d46e78 (diff)
downloadgitea-9ac6bb053cb2462770dc279b8a59ce944e8da8f6.tar.gz
gitea-9ac6bb053cb2462770dc279b8a59ce944e8da8f6.zip
Hide `last indexed SHA` when a repo could not be indexed yet (#26340)
Now, for a new repo without any commit, the Last indexed SHA field looks like this: Before: ![image](https://github.com/go-gitea/gitea/assets/50507092/cecc6e24-3366-4093-ae07-c361ea34b373) After: ![image](https://github.com/go-gitea/gitea/assets/50507092/9b6ba703-b0d5-4648-ad6b-9a2341dd60f9) Fixes #26336
-rw-r--r--templates/repo/settings/options.tmpl6
1 files changed, 4 insertions, 2 deletions
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index 569a576ce6..b247e85fa3 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -680,9 +680,11 @@
{{end}}
<h4 class="ui header">{{.locale.Tr "repo.settings.admin_stats_indexer"}}</h4>
<div class="inline fields">
- <label>{{.locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
+ {{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
+ <label>{{.locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
+ {{end}}
<span class="field">
- {{if .StatsIndexerStatus}}
+ {{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
<a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.StatsIndexerStatus.CommitSha}}">
<span class="shortsha">{{ShortSha .StatsIndexerStatus.CommitSha}}</span>
</a>