blob: a4e1d0496525ff5ca75870a786f34c886fd77dea (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
<div class="container mx-auto px-4 py-8">
<div class="flex flex-col lg:flex-row gap-8">
<%# Left side - Main thumbnail %>
<div class="lg:w-1/2">
<%= image_tag @pdfresource.thumbnails.first,
class: "w-full rounded-lg shadow-lg",
alt: @pdfresource.name %>
</div>
<%# Right side - Product details %>
<div class="lg:w-1/2">
<h1 class="text-3xl font-bold mb-4"><%= @pdfresource.name %></h1>
<div class="mb-4">
<span class="text-gray-600">Maths</span>
<span class="float-right text-gray-600">Year 1 (5-6yrs)</span>
</div>
<div class="mb-4">
<p class="text-gray-600">Contains <%= @pdfresource.pdfs.count %> PDF file<%= 's' if @pdfresource.pdfs.count != 1 %>.</p>
</div>
<div class="text-2xl font-bold mb-6">
£<%= number_with_precision(@pdfresource.price || 0.00, precision: 2) %>
</div>
<div class="mb-8">
<h2 class="text-xl font-semibold mb-2">Product summary</h2>
<p class="text-gray-700"><%= @pdfresource.description %></p>
</div>
<%= button_to "Add to basket", '#',
class: "bg-blue-500 hover:bg-blue-600 text-white font-semibold py-2 px-6 rounded-lg" %>
</div>
</div>
<%# Bottom thumbnails gallery %>
<div class="mt-8">
<div class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4">
<% @pdfresource.pdf_snapshots.each do |snapshot| %>
<%= image_tag snapshot,
class: "w-full rounded-lg shadow cursor-pointer hover:opacity-75 transition-opacity",
alt: "PDF preview" %>
<% end %>
</div>
</div>
</div>
|