mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
PDF-Previews in file-lists now working (#3000)
This commit is contained in:
@ -70,7 +70,6 @@ func Home(ctx *context.Context) {
|
||||
ctx.Handle(404, "repo.Home", nil)
|
||||
return
|
||||
}
|
||||
|
||||
if entry != nil && !entry.IsDir() {
|
||||
blob := entry.Blob()
|
||||
|
||||
@ -92,9 +91,12 @@ func Home(ctx *context.Context) {
|
||||
|
||||
_, isTextFile := base.IsTextFile(buf)
|
||||
_, isImageFile := base.IsImageFile(buf)
|
||||
_, isPDFFile := base.IsPDFFile(buf)
|
||||
ctx.Data["IsFileText"] = isTextFile
|
||||
|
||||
switch {
|
||||
case isPDFFile:
|
||||
ctx.Data["IsPDFFile"] = true
|
||||
case isImageFile:
|
||||
ctx.Data["IsImageFile"] = true
|
||||
case isTextFile:
|
||||
|
Reference in New Issue
Block a user