diff options
author | JakobDev <jakobdev@gmx.de> | 2024-01-15 17:42:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-15 17:42:15 +0100 |
commit | 885cc32b14584ee2d01009768895b7a776441504 (patch) | |
tree | 3eb87de74da708b35945d32e30443de2f649077c /templates/repo/view_file.tmpl | |
parent | 2c3da59e275b69ebf984bb70954f42a7bcb0b49d (diff) | |
download | gitea-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.

---------
Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Diffstat (limited to 'templates/repo/view_file.tmpl')
-rw-r--r-- | templates/repo/view_file.tmpl | 16 |
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}} |