From 4aa1cef99d6f1229176c08f146a5c7e37410cf5f Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Tue, 27 May 2025 12:30:44 +0200 Subject: [PATCH] Show previeable content in the editor Embedded PDF previewing isnt' reliable (not working in Safari with active storage). Instead let's align the editor with Active Storage previews and support pdf previews --- Dockerfile | 2 +- app/views/active_storage/blobs/web/_representation.html.erb | 2 -- app/views/layouts/application.html.erb | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index e0712a39a..64436b2bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,7 +47,7 @@ FROM base # Install packages needed for deployment RUN apt-get update -qq && \ - apt-get install --no-install-recommends -y curl libsqlite3-0 libvips && \ + apt-get install --no-install-recommends -y curl libsqlite3-0 libvips build-essential ffmpeg groff libreoffice-writer libreoffice-impress libreoffice-calc mupdf-tools && \ rm -rf /var/lib/apt/lists /var/cache/apt/archives # Copy built artifacts: gems, application diff --git a/app/views/active_storage/blobs/web/_representation.html.erb b/app/views/active_storage/blobs/web/_representation.html.erb index ca497fd1d..40456e8c7 100644 --- a/app/views/active_storage/blobs/web/_representation.html.erb +++ b/app/views/active_storage/blobs/web/_representation.html.erb @@ -10,8 +10,6 @@ -<% elsif blob.content_type == "application/pdf" %> - <% elsif blob.variable? %> <%= image_tag url_for(blob.variant(loader: { n: -1 }, resize_to_limit: size)) %> <% elsif blob.previewable? %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 0e04cbca9..b667bfb47 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -3,7 +3,7 @@ <%= page_title_tag %> - +