From ad6200d0717d10d1c3b45c776ddeaaa1778c8fe2 Mon Sep 17 00:00:00 2001 From: Norore Date: Mon, 10 Jun 2024 00:51:51 +0200 Subject: [PATCH] PDF view in letter view --- Gemfile | 2 ++ Gemfile.lock | 8 ++++++++ app/views/letters/show.html.erb | 10 +++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index c3fe87f..9d57b76 100644 --- a/Gemfile +++ b/Gemfile @@ -44,6 +44,8 @@ gem "tzinfo-data", platforms: %i[ mswin mswin64 mingw x64_mingw jruby ] # Reduces boot times through caching; required in config/boot.rb gem "bootsnap", require: false +gem "image_processing", ">= 1.2" + group :development, :test do # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem gem "debug", platforms: %i[ mri mswin mswin64 mingw x64_mingw ] diff --git a/Gemfile.lock b/Gemfile.lock index bfe1782..24cb543 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -104,10 +104,14 @@ GEM drb (2.2.1) error_highlight (0.6.0) erubi (1.12.0) + ffi (1.17.0) globalid (1.2.1) activesupport (>= 6.1) i18n (1.14.5) concurrent-ruby (~> 1.0) + image_processing (1.12.2) + mini_magick (>= 4.9.5, < 5) + ruby-vips (>= 2.0.17, < 3) importmap-rails (2.0.1) actionpack (>= 6.0.0) activesupport (>= 6.0.0) @@ -129,6 +133,7 @@ GEM net-smtp marcel (1.0.4) matrix (0.4.2) + mini_magick (4.12.0) mini_mime (1.1.5) minitest (5.23.1) msgpack (1.7.2) @@ -196,6 +201,8 @@ GEM io-console (~> 0.5) rexml (3.2.8) strscan (>= 3.0.9) + ruby-vips (2.2.1) + ffi (~> 1.12) rubyzip (2.3.2) selenium-webdriver (4.21.1) base64 (~> 0.2) @@ -245,6 +252,7 @@ DEPENDENCIES cssbundling-rails debug error_highlight (>= 0.4.0) + image_processing (>= 1.2) importmap-rails jbuilder puma (>= 5.0) diff --git a/app/views/letters/show.html.erb b/app/views/letters/show.html.erb index 6dddd76..1c96895 100644 --- a/app/views/letters/show.html.erb +++ b/app/views/letters/show.html.erb @@ -1,8 +1,12 @@

<%= @letter.title %>

-Rédigée par : <%= @letter.author %> <% unless @letter.private_email %>(<%= @letter.email %>) <% end %> +Rédigée par : <%= @letter.author %> +<% unless @letter.private_email %> + (<%= @letter.email %>) +<% end %>
- <%= @letter.document %> +
-