aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/pdfresources/_pdfresource.html.erb
blob: 5edbd354908445ad2c93a74cac33a969563114ac (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
<div id="<%= dom_id pdfresource %>" class="h-full rounded-lg overflow-hidden shadow-lg border">
  <%# Image section %>
  <div class="aspect-w-16 aspect-h-9">
    <%= image_tag url_for(pdfresource.thumbnails.first), class: "w-full h-full object-cover" %>
  </div>

  <%# Content section %>
  <div class="p-4">
    <%# Title %>
    <h2 class="text-xl font-semibold mb-2">
      <%= link_to pdfresource.name, pdfresource %>
    </h2>

    <%# Tags/badges %>
    <div class="flex gap-2 mb-3">
      <span class="px-2 py-1 bg-gray-200 text-sm rounded">Reception (4-5yrs)</span>
      <span class="px-2 py-1 bg-blue-500 text-white text-sm rounded">EYs Maths</span>
      <span class="px-2 py-1 bg-purple-500 text-white text-sm rounded">Feature slot: <%= pdfresource.feature_slot %></span>
    </div>

    <%# Description %>
    <p class="text-gray-600 mb-4">
      <%= pdfresource.card_description %>
    </p>

    <%# Footer with price and add to cart %>
    <div class="flex items-center justify-between mt-auto">
      <div class="flex gap-4 text-gray-600 font-bold">
        <span>£<%= number_with_precision(pdfresource.price, precision: 2) %></span>
        <span class="border-l pl-4"><%= pdfresource.credits %> credits</span>
      </div>
      <%= button_to "Add to basket", "#", class: "bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded" %>
    </div>
  </div>
</div>