From 08896cd9f657c3697af0ed2415a8461080a0eb0a Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 7 Oct 2019 06:59:17 +0200 Subject: add file line count info on UI (#8396) Also reworked the header to remove the filename (which is redundant with the file path above) and made the header a flexbox with a monospace font. Fixes: https://github.com/go-gitea/gitea/issues/8170 --- templates/repo/view_file.tmpl | 82 +++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 39 deletions(-) (limited to 'templates/repo/view_file.tmpl') diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 50e4c33946..71607bd1f8 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -1,48 +1,52 @@
-

-
-
- {{if .ReadmeExist}} - - {{if .ReadmeInList}} - {{.FileName}} - {{else}} - {{.FileName}} {{FileSize .FileSize}}{{if .IsLFSFile}} ({{.i18n.Tr "repo.stored_lfs"}}){{end}} +

+
+ {{if .ReadmeInList}} + + {{.FileName}} + {{else}} +
+ {{if .NumLines}} +
+ {{.NumLines}} {{.i18n.Tr "repo.lines"}} +
{{end}} - {{else}} - - {{.FileName}} {{FileSize .FileSize}}{{if .IsLFSFile}} ({{.i18n.Tr "repo.stored_lfs"}}){{end}} - {{end}} -
-
- {{if not .ReadmeInList}} -
-
- {{.i18n.Tr "repo.file_raw"}} - {{if not .IsViewCommit}} - {{.i18n.Tr "repo.file_permalink"}} - {{end}} - {{if .IsTextFile}} - {{.i18n.Tr "repo.blame"}} - {{end}} - {{.i18n.Tr "repo.file_history"}} + {{if .FileSize}} +
+ {{FileSize .FileSize}}{{if .IsLFSFile}} ({{.i18n.Tr "repo.stored_lfs"}}){{end}}
- {{if .Repository.CanEnableEditor}} - {{if .CanEditFile}} - - {{else}} - - {{end}} - {{if .CanDeleteFile}} - - {{else}} - - {{end}} - {{end}} -
+ {{end}} +
+ {{end}} +
+ {{if not .ReadmeInList}} +
+
+
+ {{.i18n.Tr "repo.file_raw"}} + {{if not .IsViewCommit}} + {{.i18n.Tr "repo.file_permalink"}} + {{end}} + {{if .IsTextFile}} + {{.i18n.Tr "repo.blame"}} + {{end}} + {{.i18n.Tr "repo.file_history"}} +
+ {{if .Repository.CanEnableEditor}} + {{if .CanEditFile}} + + {{else}} + + {{end}} + {{if .CanDeleteFile}} + + {{else}} + + {{end}} {{end}}
+ {{end}}

-- cgit v1.2.3