Skip to content

Commit 59354d7

Browse files
GiteaBotCaiCandong
andauthored
Hide last indexed SHA when a repo could not be indexed yet (#26340) (#26345)
Backport #26340 by @CaiCandong 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) fix #26336 Co-authored-by: CaiCandong <[email protected]>
1 parent 0b97463 commit 59354d7

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
@@ -711,9 +711,11 @@
711711
{{end}}
712712
<h4 class="ui header">{{.locale.Tr "repo.settings.admin_stats_indexer"}}</h4>
713713
<div class="inline fields">
714-
<label>{{.locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
714+
{{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
715+
<label>{{.locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
716+
{{end}}
715717
<span class="field">
716-
{{if .StatsIndexerStatus}}
718+
{{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
717719
<a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.StatsIndexerStatus.CommitSha}}">
718720
<span class="shortsha">{{ShortSha .StatsIndexerStatus.CommitSha}}</span>
719721
</a>

0 commit comments

Comments
 (0)