summaryrefslogtreecommitdiffstats
path: root/routers/repo/view.go
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2019-10-07 06:59:17 +0200
committertechknowlogick <techknowlogick@gitea.io>2019-10-07 00:59:17 -0400
commit08896cd9f657c3697af0ed2415a8461080a0eb0a (patch)
treedb5078c9e8b9354e8fb966d5080007353e6ea5cb /routers/repo/view.go
parent51fade4c44c3517923cd07783ab05a55aaa84dcd (diff)
downloadgitea-08896cd9f657c3697af0ed2415a8461080a0eb0a.tar.gz
gitea-08896cd9f657c3697af0ed2415a8461080a0eb0a.zip
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
Diffstat (limited to 'routers/repo/view.go')
-rw-r--r--routers/repo/view.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go
index 00790a4ef3..1967b511ca 100644
--- a/routers/repo/view.go
+++ b/routers/repo/view.go
@@ -304,6 +304,8 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
var output bytes.Buffer
lines := strings.Split(fileContent, "\n")
+ ctx.Data["NumLines"] = len(lines)
+
//Remove blank line at the end of file
if len(lines) > 0 && lines[len(lines)-1] == "" {
lines = lines[:len(lines)-1]