From 1ab2cdce92bae8fef1bff9b0eecf9ca1c4c52db5 Mon Sep 17 00:00:00 2001 From: Bernhard Froehlich Date: Tue, 21 Aug 2018 13:47:28 +0000 Subject: [PATCH 1/2] Add missing History link to directory listings The feature to list commits from a subdirectory is already there but so far the history link to it was missing. There is a History button in the view_file.tmpl already so avoid showing two history buttons in that case. The GitHub webinterface has the same History button in the same place so this makes gitea a little bit more compatible. Signed-off-by: Bernhard Froehlich --- templates/repo/home.tmpl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 685351ecb2f8c..e1e7315aa660b 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -113,6 +113,14 @@ + {{else}} + {{if not .IsViewFile}} + + {{end}} {{end}} From 6cc272ecffabf62f58eb5029096b1631eb6c5ec2 Mon Sep 17 00:00:00 2001 From: Bernhard Froehlich Date: Tue, 21 Aug 2018 13:47:28 +0000 Subject: [PATCH 2/2] Add missing History link to directory listings The feature to list commits from a subdirectory is already there but so far the history link to it was missing. There is a History button in the view_file.tmpl already so avoid showing two history buttons in that case. The GitHub webinterface has the same History button in the same place so this makes gitea a little bit more compatible. Signed-off-by: Bernhard Froehlich --- templates/repo/home.tmpl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 685351ecb2f8c..f14f2b9a2865e 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -64,8 +64,8 @@ {{ $l := Subtract $n 1}}
{{EllipsisString .Repository.Name 30}}{{range $i, $v := .TreeNames}}/{{if eq $i $l}}{{EllipsisString $v 30}}{{else}}{{ $p := index $.Paths $i}}{{EllipsisString $v 30}}{{end}}{{end}}
- {{if .Repository.CanEnableEditor}} -
+
+ {{if .Repository.CanEnableEditor}} {{if .CanAddFile}} {{.i18n.Tr "repo.editor.new_file"}} @@ -76,8 +76,13 @@ {{.i18n.Tr "repo.editor.upload_file"}} {{end}} -
- {{end}} + {{end}} + {{if and (ne $n 0) (not .IsViewFile)}} + + {{.i18n.Tr "repo.file_history"}} + + {{end}} +