From 8736b134bd044f81de6ad3a3fb562b2e0e4de213 Mon Sep 17 00:00:00 2001 From: delvh Date: Sun, 6 Aug 2023 21:52:34 +0200 Subject: Display human-readable text instead of cryptic filemodes (#26352) Now, you don't need to be a git expert anymore to know what these numbers mean. ## Before ![grafik](https://github.com/go-gitea/gitea/assets/51889757/9a964bf6-10fd-40a6-aeb2-ac8f437f8c32) ## After ![grafik](https://github.com/go-gitea/gitea/assets/51889757/84573cb9-55b6-4dde-9866-95f71b657554) or when the mode actually changed: ![grafik](https://github.com/go-gitea/gitea/assets/51889757/0f327538-ebdc-40e7-8c99-f9e21b67f638) --- templates/repo/diff/box.tmpl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'templates/repo/diff') diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index c4dd1f658d..324166b03c 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -130,9 +130,11 @@ {{$.locale.Tr "repo.diff.vendored"}} {{end}} {{if and $file.Mode $file.OldMode}} - {{$file.OldMode}} → {{$file.Mode}} + {{$old := $.locale.Tr ($file.ModeTranslationKey $file.OldMode)}} + {{$new := $.locale.Tr ($file.ModeTranslationKey $file.Mode)}} + {{$.locale.Tr "git.filemode.changed_filemode" $old $new}} {{else if $file.Mode}} - {{$file.Mode}} + {{$.locale.Tr ($file.ModeTranslationKey $file.Mode)}} {{end}}
-- cgit v1.2.3