From f597c789e1482da2c8c8751f6a8dbced9ebaed18 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 6 Aug 2023 00:08:17 +0800 Subject: [PATCH] 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 <50507092+CaiCandong@users.noreply.github.com> (cherry picked from commit 59354d7135c4d380e11cb35ae0ac59a0ec7bf041) --- templates/repo/settings/options.tmpl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index 1e940c581b..f1ce48e871 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -711,9 +711,11 @@ {{end}}

{{.locale.Tr "repo.settings.admin_stats_indexer"}}

- + {{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}} + + {{end}} - {{if .StatsIndexerStatus}} + {{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}} {{ShortSha .StatsIndexerStatus.CommitSha}}