From 9ac6bb053cb2462770dc279b8a59ce944e8da8f6 Mon Sep 17 00:00:00 2001 From: CaiCandong <50507092+CaiCandong@users.noreply.github.com> Date: Sat, 5 Aug 2023 19:04:14 +0800 Subject: [PATCH] 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 --- 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 569a576ce6..b247e85fa3 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -680,9 +680,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}}