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
This commit is contained in:
CaiCandong 2023-08-05 19:04:14 +08:00 committed by GitHub
parent 952882fe4a
commit 9ac6bb053c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -680,9 +680,11 @@
{{end}} {{end}}
<h4 class="ui header">{{.locale.Tr "repo.settings.admin_stats_indexer"}}</h4> <h4 class="ui header">{{.locale.Tr "repo.settings.admin_stats_indexer"}}</h4>
<div class="inline fields"> <div class="inline fields">
{{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
<label>{{.locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label> <label>{{.locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
{{end}}
<span class="field"> <span class="field">
{{if .StatsIndexerStatus}} {{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
<a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.StatsIndexerStatus.CommitSha}}"> <a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.StatsIndexerStatus.CommitSha}}">
<span class="shortsha">{{ShortSha .StatsIndexerStatus.CommitSha}}</span> <span class="shortsha">{{ShortSha .StatsIndexerStatus.CommitSha}}</span>
</a> </a>