aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/view_file.tmpl
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-06-13 09:06:46 +0800
committerGitHub <noreply@github.com>2024-06-13 01:06:46 +0000
commit47ca61d8ba41f363745f6d0f93cb8efafa92564b (patch)
tree53d5325e00d626144fa119c7b8a48b498bf347a3 /templates/repo/view_file.tmpl
parent7115dce773e3021b3538ae360c4e7344d5bbf45b (diff)
downloadgitea-47ca61d8ba41f363745f6d0f93cb8efafa92564b.tar.gz
gitea-47ca61d8ba41f363745f6d0f93cb8efafa92564b.zip
Improve detecting empty files (#31332)
Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'templates/repo/view_file.tmpl')
-rw-r--r--templates/repo/view_file.tmpl2
1 files changed, 2 insertions, 0 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index 0a34b6c325..0ec400cfe9 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -91,6 +91,8 @@
<div class="file-view{{if .IsMarkup}} markup {{.MarkupType}}{{else if .IsPlainText}} plain-text{{else if .IsTextSource}} code-view{{end}}">
{{if .IsFileTooLarge}}
{{template "shared/filetoolarge" dict "RawFileLink" .RawFileLink}}
+ {{else if not .FileSize}}
+ {{template "shared/fileisempty"}}
{{else if .IsMarkup}}
{{if .FileContent}}{{.FileContent}}{{end}}
{{else if .IsPlainText}}