From 1837e647eb2ae3f4de0ed1a729f0da01c07b9449 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 12 Dec 2020 02:06:22 +0100 Subject: Diff stat improvements (#13954) * Diff stat improvements - Combine number to just total number of changes - Add tooltip over stats bar - Increase contrast on file name - Refactor classes and CSS to be more reusable * misc tweaks * make count bold --- templates/repo/diff/box.tmpl | 12 ++++++------ templates/repo/diff/stats.tmpl | 8 +++----- 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'templates/repo/diff') diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 275dc51501..40e9d277b3 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -36,9 +36,9 @@
    {{range .Diff.Files}}
  1. -
    +
    {{if not .IsBin}} - {{template "repo/diff/stats" .}} + {{template "repo/diff/stats" dict "file" . "root" $}} {{else}} {{$.i18n.Tr "repo.diff.bin"}} {{end}} @@ -53,9 +53,9 @@ {{if $file.IsIncomplete}}

    -
    +
    {{if not $file.IsRenamed}} - {{template "repo/diff/stats" .}} + {{template "repo/diff/stats" dict "file" . "root" $}} {{end}}
    {{$file.Name}} @@ -87,11 +87,11 @@ {{svg "octicon-chevron-down" 18}} {{end}} -
    +
    {{if $file.IsBin}} {{$.i18n.Tr "repo.diff.bin"}} {{else if not $file.IsRenamed}} - {{template "repo/diff/stats" .}} + {{template "repo/diff/stats" dict "file" . "root" $}} {{end}}
    {{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}{{if .IsLFSFile}} ({{$.i18n.Tr "repo.stored_lfs"}}){{end}} diff --git a/templates/repo/diff/stats.tmpl b/templates/repo/diff/stats.tmpl index 7e5d34c3dd..97503f0ea5 100644 --- a/templates/repo/diff/stats.tmpl +++ b/templates/repo/diff/stats.tmpl @@ -1,6 +1,4 @@ -+ {{.Addition}} - -
    -
    +{{Add .file.Addition .file.Deletion}} + +
    -- {{.Deletion}} -- cgit v1.2.3