Skip to content

Commit 9ac6bb0

Browse files
authored
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
1 parent 952882f commit 9ac6bb0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

templates/repo/settings/options.tmpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,11 @@
680680
{{end}}
681681
<h4 class="ui header">{{.locale.Tr "repo.settings.admin_stats_indexer"}}</h4>
682682
<div class="inline fields">
683-
<label>{{.locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
683+
{{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
684+
<label>{{.locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
685+
{{end}}
684686
<span class="field">
685-
{{if .StatsIndexerStatus}}
687+
{{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
686688
<a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.StatsIndexerStatus.CommitSha}}">
687689
<span class="shortsha">{{ShortSha .StatsIndexerStatus.CommitSha}}</span>
688690
</a>

0 commit comments

Comments
 (0)