aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/pdfresources/_form.html.erb8
-rw-r--r--app/views/pdfresources/show.html.erb3
2 files changed, 8 insertions, 3 deletions
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 @@
<div class="my-5">
<%= required_label_tag(form, :thumbnails) %>
- <% if pdfresource.thumbnails.any? %>
+ <% if pdfresource.thumbnails.any? && pdfresource.persisted? %>
<div class="mb-4 p-4 bg-gray-50 rounded-lg">
<h3 class="font-medium text-gray-700">Current Thumbnails:</h3>
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
<% pdfresource.thumbnails.each do |thumbnail| %>
<div class="relative">
- <%= image_tag thumbnail, class: "rounded-lg shadow-sm" %>
- <p class="text-xs text-gray-500 mt-1"><%= thumbnail.filename %></p>
+ <% if thumbnail.persisted? %>
+ <%= image_tag url_for(thumbnail), class: "rounded-lg shadow-sm" %>
+ <p class="text-xs text-gray-500 mt-1"><%= thumbnail.filename %></p>
+ <% end %>
</div>
<% end %>
</div>
diff --git a/app/views/pdfresources/show.html.erb b/app/views/pdfresources/show.html.erb
index 525e5dd..dc6dcd7 100644
--- a/app/views/pdfresources/show.html.erb
+++ b/app/views/pdfresources/show.html.erb
@@ -22,6 +22,9 @@
<div class="text-2xl font-bold mb-6">
£<%= number_with_precision(@pdfresource.price || 0.00, precision: 2) %>
+ <% if @pdfresource.credits %>
+ (or <%= @pdfresource.credits %> credit<%= 's' if @pdfresource.credits != 1 %>)
+ <% end %>
</div>
<div class="mb-8">