From 1b64b0b709c5704de48120e20bdfad32f34b0b5d Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 14 Nov 2024 12:01:49 +0000 Subject: Adds credits and cleaner handling of page count using ruby --- app/views/pdfresources/_form.html.erb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'app/views/pdfresources/_form.html.erb') diff --git a/app/views/pdfresources/_form.html.erb b/app/views/pdfresources/_form.html.erb index 7b1ce60..1ad8fb1 100644 --- a/app/views/pdfresources/_form.html.erb +++ b/app/views/pdfresources/_form.html.erb @@ -53,14 +53,16 @@
<%= required_label_tag(form, :thumbnails) %> - <% if pdfresource.thumbnails.any? %> + <% if pdfresource.thumbnails.any? && pdfresource.persisted? %>

Current Thumbnails:

<% pdfresource.thumbnails.each do |thumbnail| %>
- <%= image_tag thumbnail, class: "rounded-lg shadow-sm" %> -

<%= thumbnail.filename %>

+ <% if thumbnail.persisted? %> + <%= image_tag url_for(thumbnail), class: "rounded-lg shadow-sm" %> +

<%= thumbnail.filename %>

+ <% end %>
<% end %>
-- cgit v1.2.3