diff options
author | Matthew Lemon <y@yulqen.org> | 2024-11-14 16:33:24 +0000 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-11-14 16:33:24 +0000 |
commit | e58324f1491709d9f73d1402186586c4810b4eb3 (patch) | |
tree | fab20219747446e6bf59c2fd9f87368b03d2e842 | |
parent | 851521dc475e3d434ff8e13bd9f9e558aa9af772 (diff) |
Fixed the positioning of the three featured cards on index page
-rw-r--r-- | app/views/pdfresources/_pdfresource.html.erb | 7 | ||||
-rw-r--r-- | app/views/pdfresources/index.html.erb | 13 |
2 files changed, 13 insertions, 7 deletions
diff --git a/app/views/pdfresources/_pdfresource.html.erb b/app/views/pdfresources/_pdfresource.html.erb index 8c96080..7ce1807 100644 --- a/app/views/pdfresources/_pdfresource.html.erb +++ b/app/views/pdfresources/_pdfresource.html.erb @@ -1,6 +1,7 @@ -<div id="<%= dom_id pdfresource %>" class="w-[400px] rounded overflow-hidden shadow-lg border p-5"> - <div> - <%= image_tag url_for(pdfresource.thumbnails.first), size: "500x100", class: "rounded-t-lg" %> +<div id="<%= dom_id pdfresource %>" class="h-full rounded overflow-hidden shadow-lg border p-5"> + + <div class="aspect-w-16 aspect-h-9 mb-4"> + <%= image_tag url_for(pdfresource.thumbnails.first), class: "w-full h-full object-cover rounded-t-lg" %> </div> <p class="my-5"> diff --git a/app/views/pdfresources/index.html.erb b/app/views/pdfresources/index.html.erb index 158e505..880fb90 100644 --- a/app/views/pdfresources/index.html.erb +++ b/app/views/pdfresources/index.html.erb @@ -9,10 +9,15 @@ <h1 class="font-bold text-4xl m-12">Featured Resources</h1> </div> - <div id="pdfresources" class="flex flex-wrap justify-between"> - <% @pdfresources.where("feature_slot < 4").each do |pdfresource| %> - <%= render pdfresource %> - <% end %> + <div id="pdfresources" class="max-w-7xl mx-auto"> + <% featured_resources = @pdfresources.where("feature_slot < 4").order(:feature_slot) %> + <div class="flex flex-col md:flex-row gap-6"> + <% featured_resources.each do |pdfresource| %> + <div class="flex-1"> + <%= render pdfresource %> + </div> + <% end %> + </div> </div> <% if Current.session.user.is_admin %> |