From e9f8d4e5f017e4af5e5db255027dddfbb275ccf8 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 1 Feb 2023 11:09:04 +0800 Subject: [PATCH 1/2] fix --- templates/repo/diff/box.tmpl | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index f74714499ae54..36b563657c536 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -76,18 +76,17 @@ {{$isImage := or (call $.IsBlobAnImage $blobBase) (call $.IsBlobAnImage $blobHead)}} {{$isCsv := (call $.IsCsvFile $file)}} {{$showFileViewToggle := or $isImage (and (not $file.IsIncomplete) $isCsv)}} -
+ {{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}} +

- {{if or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}} - - {{if $file.ShouldBeHidden}} - {{svg "octicon-chevron-right" 18}} - {{else}} - {{svg "octicon-chevron-down" 18}} - {{end}} - - {{end}} + + {{if $file.ShouldBeHidden}} + {{svg "octicon-chevron-right" 18}} + {{else}} + {{svg "octicon-chevron-down" 18}} + {{end}} +
{{if $file.IsBin}} From e109d0e3ee35676317c2c135234ab86dad899a1e Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 1 Feb 2023 12:18:45 +0800 Subject: [PATCH 2/2] use mono-font for number --- templates/repo/diff/box.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 36b563657c536..798a7eae14d1b 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -87,7 +87,7 @@ {{svg "octicon-chevron-down" 18}} {{end}} -
+
{{if $file.IsBin}} {{$.locale.Tr "repo.diff.bin"}}