summaryrefslogtreecommitdiffstats
path: root/templates/repo/view_file.tmpl
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2024-01-15 17:42:15 +0100
committerGitHub <noreply@github.com>2024-01-15 17:42:15 +0100
commit885cc32b14584ee2d01009768895b7a776441504 (patch)
tree3eb87de74da708b35945d32e30443de2f649077c /templates/repo/view_file.tmpl
parent2c3da59e275b69ebf984bb70954f42a7bcb0b49d (diff)
downloadgitea-885cc32b14584ee2d01009768895b7a776441504.tar.gz
gitea-885cc32b14584ee2d01009768895b7a776441504.zip
Show latest commit for file (#28067)
If you view a file, you can now see the latest commit that changed that file. ![grafik](https://github.com/go-gitea/gitea/assets/15185051/272c3120-6db7-4f88-86e1-60080c9aabe5) --------- Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Diffstat (limited to 'templates/repo/view_file.tmpl')
-rw-r--r--templates/repo/view_file.tmpl16
1 files changed, 16 insertions, 0 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index e7d1c04c12..e6591df7e3 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -9,6 +9,22 @@
<div class="text left gt-whitespace-pre">{{.FileWarning}}</div>
</div>
{{end}}
+
+ {{if not .ReadmeInList}}
+ <div id="repo-file-commit-box" class="ui top attached header list-header gt-mb-4">
+ <div>
+ {{template "repo/latest_commit" .}}
+ </div>
+ {{if .LatestCommit}}
+ {{if .LatestCommit.Committer}}
+ <div class="ui text grey right age">
+ {{TimeSince .LatestCommit.Committer.When ctx.Locale}}
+ </div>
+ {{end}}
+ {{end}}
+ </div>
+ {{end}}
+
<h4 class="file-header ui top attached header gt-df gt-ac gt-sb gt-fw">
<div class="file-header-left gt-df gt-ac gt-py-3 gt-pr-4">
{{if .ReadmeInList}}