From 0386a42f70d1026c50697b12378f5026a63182b9 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 22 Apr 2024 12:48:14 +0200 Subject: [PATCH] Hide diff stats on empty PRs (#30629) When a PR is empty, e.g. has neither additions nor deletions, we don't need to show this: Screenshot 2024-04-21 at 23 25 38 --- templates/repo/pulls/tab_menu.tmpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/repo/pulls/tab_menu.tmpl b/templates/repo/pulls/tab_menu.tmpl index c0e48928f..a6d058f16 100644 --- a/templates/repo/pulls/tab_menu.tmpl +++ b/templates/repo/pulls/tab_menu.tmpl @@ -15,12 +15,14 @@ {{ctx.Locale.Tr "repo.pulls.tab_files"}} {{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}} + {{if or .Diff.TotalAddition .Diff.TotalDeletion}} {{if .Diff.TotalAddition}}+{{.Diff.TotalAddition}}{{end}} {{if .Diff.TotalDeletion}}-{{.Diff.TotalDeletion}}{{end}}
+ {{end}}