From 3df8eb60e3227b4cff671e4714d262603b82943b Mon Sep 17 00:00:00 2001 From: Kim Carlbäcker Date: Wed, 27 Apr 2016 03:48:44 +0200 Subject: PDF-Previews in file-lists now working (#3000) --- routers/repo/view.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'routers/repo/view.go') diff --git a/routers/repo/view.go b/routers/repo/view.go index f4242cd5..74c5f1ce 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -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: -- cgit v1.2.3