mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-06 02:15:20 +02:00
PDF-Previews in file-lists now working (#3000)
This commit is contained in:
parent
0325bec283
commit
3df8eb60e3
95 changed files with 64456 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue