PDF view in letter view

This commit is contained in:
Norore 2024-06-10 00:51:51 +02:00
parent e2e47eff46
commit ad6200d071
3 changed files with 17 additions and 3 deletions

View file

@ -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 ]

View file

@ -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)

View file

@ -1,8 +1,12 @@
<h2><%= @letter.title %></h2>
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 %>
<div>
<%= @letter.document %>
<iframe src="<%= url_for @letter.document %>"
type="<%= @letter.document.attachment.blob.content_type %>"
style="width:1000px; height:800px;"></iframe>
</div>