diff --git a/options/locale/locale_en-US.json b/options/locale/locale_en-US.json index 307cccf8bd6bf..0f0906e981c52 100644 --- a/options/locale/locale_en-US.json +++ b/options/locale/locale_en-US.json @@ -3781,10 +3781,10 @@ }, "git.filemode": { "changed_filemode": "%[1]s → %[2]s", - "directory": "Directory", - "normal_file": "Normal file", - "executable_file": "Executable file", - "symbolic_link": "Symbolic link", - "submodule": "Submodule" + "directory": "directory", + "normal_file": "normal", + "executable_file": "executable", + "symbolic_link": "symlink", + "submodule": "submodule" } } diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index ff9bd2e792ede..a42e241099aa5 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -91,34 +91,33 @@ {{svg "octicon-chevron-down" 18}} {{end}} -
- {{if $file.IsBin}} - - {{ctx.Locale.Tr "repo.diff.bin"}} - - {{else}} - {{template "repo/diff/stats" dict "file" . "root" $}} - {{end}} -
- {{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}} - + + {{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}} + {{if .IsLFSFile}}LFS{{end}} {{if $file.IsGenerated}} - {{ctx.Locale.Tr "repo.diff.generated"}} + {{ctx.Locale.Tr "repo.diff.generated"}} {{end}} {{if $file.IsVendored}} - {{ctx.Locale.Tr "repo.diff.vendored"}} + {{ctx.Locale.Tr "repo.diff.vendored"}} {{end}} {{if and $file.Mode $file.OldMode}} {{$old := ctx.Locale.Tr ($file.ModeTranslationKey $file.OldMode)}} {{$new := ctx.Locale.Tr ($file.ModeTranslationKey $file.Mode)}} - {{ctx.Locale.Tr "git.filemode.changed_filemode" $old $new}} + {{ctx.Locale.Tr "git.filemode.changed_filemode" $old $new}} {{else if $file.Mode}} - {{ctx.Locale.Tr ($file.ModeTranslationKey $file.Mode)}} + {{ctx.Locale.Tr ($file.ModeTranslationKey $file.Mode)}} {{end}} -
+
+
+ {{if $file.IsBin}} + {{ctx.Locale.Tr "repo.diff.bin"}} + {{else}} + {{template "repo/diff/stats" dict "file" . "root" $}} + {{end}} +
{{if $showFileViewToggle}}
diff --git a/templates/repo/diff/stats.tmpl b/templates/repo/diff/stats.tmpl index d0dff1bd094d9..a136c78479aab 100644 --- a/templates/repo/diff/stats.tmpl +++ b/templates/repo/diff/stats.tmpl @@ -1,5 +1,10 @@ -{{Eval .file.Addition "+" .file.Deletion}} - - {{/* if the denominator is zero, then the float result is "width: NaNpx", as before, it just works */}} -
-
+
+ + {{if .file.Addition}}+{{.file.Addition}}{{end}} + {{if .file.Deletion}}-{{.file.Deletion}}{{end}} + + + {{/* if the denominator is zero, then the float result is "width: NaNpx", as before, it just works */}} +
+
+
diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 0bf37ca083807..c4611befc6926 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -1684,6 +1684,7 @@ tbody.commit-list { .diff-file-header { padding: 5px 8px !important; box-shadow: 0 -1px 0 1px var(--color-body); /* prevent borders being visible behind top corners when sticky and scrolled */ + font-size: 14px !important; /* override h4.ui.header */ font-weight: var(--font-weight-normal); display: flex; justify-content: space-between; @@ -1693,6 +1694,10 @@ tbody.commit-list { .diff-file-header .file { min-width: 0; + display: flex; + align-items: center; + flex: 1; + gap: 4px; } .diff-file-header .file-link {