Added pdf preview

This commit is contained in:
David Böhm
2024-08-09 12:35:58 +02:00
parent 33db74df71
commit cd07247e5f
4 changed files with 21 additions and 2 deletions

View File

@@ -45,7 +45,7 @@ gem 'tzinfo-data', platforms: %i[windows jruby]
gem 'bootsnap', require: false
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"
gem "image_processing", "~> 1.2"
group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem

View File

@@ -105,11 +105,20 @@ GEM
erubi (1.13.0)
faker (3.4.2)
i18n (>= 1.8.11, < 2)
ffi (1.17.0-aarch64-linux-gnu)
ffi (1.17.0-arm-linux-gnu)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86-linux-gnu)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
globalid (1.2.1)
activesupport (>= 6.1)
hashery (2.1.2)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
image_processing (1.13.0)
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)
@@ -135,6 +144,7 @@ GEM
net-smtp
marcel (1.0.4)
matrix (0.4.2)
mini_magick (4.13.2)
mini_mime (1.1.5)
minitest (5.24.1)
msgpack (1.7.2)
@@ -223,6 +233,9 @@ GEM
rexml (3.3.4)
strscan
ruby-rc4 (0.1.5)
ruby-vips (2.2.2)
ffi (~> 1.12)
logger
rubyzip (2.3.2)
selenium-webdriver (4.23.0)
base64 (~> 0.2)
@@ -296,6 +309,7 @@ DEPENDENCIES
capybara
debug
faker (~> 3.4)
image_processing (~> 1.2)
importmap-rails
inline_svg (~> 1.9)
jbuilder

View File

@@ -3,6 +3,11 @@
<span class="p-1.5 text-xs font-medium uppercase tracking-wider bg-opacity-50 text-status-<%= job.status %> bg-status-<%= job.status %>-light rounded-lg"><%= job.id %></span>
</td>
<td class="p-3 text-sm text-hsrm-gray whitespace-nowrap"> <%= job.fullname %> </td>
<td class="p-3 text-sm text-hsrm-gray whitespace-nowrap">
<% if job.pdf.attached? %>
<%= image_tag job.pdf.preview(resize_to_limit: [100, 100]) %>
<% end %>
</td>
<td class="p-3 text-sm text-hsrm-gray whitespace-nowrap">
<% if job.pdf.attached? %>
<%#= link_to job.pdf.filename, rails_blob_path(job.pdf, disposition: "attachment") %>

View File

@@ -12,7 +12,7 @@
<tr>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> ID </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left"> Auftraggeber </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left"> PDF </th>
<th colspan="2" class="p-3 text-sm font-semibold tracking-wide text-left"> PDF </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A0 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A1 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A2 </th>