|
27 | 27 | <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 gap-4"> |
28 | 28 | <% @featured_materials.each do |m| %> |
29 | 29 | <div class="card bg-base-100 shadow-md overflow-hidden w-full transition-transform duration-300 hover:-translate-y-1 hover:shadow-xl"> |
30 | | - <% if m.thumbnail_url.present? %> |
| 30 | + <% if m.thumbnail.present? %> |
31 | 31 | <figure class="w-full aspect-[4/3] max-h-40 overflow-hidden"> |
32 | | - <img src="<%= m.thumbnail_url %>" alt="<%= m.title %> thumbnail" class="w-full h-full object-cover transition-transform duration-300 ease-out hover:scale-105"> |
| 32 | + <img src="<%= m.thumbnail %>" alt="<%= m.title %> thumbnail" class="w-full h-full object-cover transition-transform duration-300 ease-out hover:scale-105"> |
33 | 33 | </figure> |
34 | 34 | <% end %> |
35 | 35 | <div class="card-body p-2"> |
36 | 36 | <span class="badge badge-secondary capitalize w-fit text-[10px]"><%= m.level %></span> |
37 | 37 | <h3 class="card-title text-lg text-black mt-1"><%= m.title %></h3> |
38 | 38 | <div class="card-actions justify-start mt-2"> |
39 | | - <%= link_to 'Open resource', m.link_url, class: 'link link-primary text-sm transition-colors duration-200 hover:underline', target: '_blank', rel: 'noopener' %> |
| 39 | + <%= link_to 'Open resource', m.link, class: 'link link-primary text-sm transition-colors duration-200 hover:underline', target: '_blank', rel: 'noopener' %> |
40 | 40 | </div> |
41 | 41 | </div> |
42 | 42 | </div> |
|
50 | 50 | <% @materials.each_with_index do |m, i| %> |
51 | 51 | <div class="pb-6 border-b border-dotted border-gray-300 w-full max-w-md"> <!-- from sm → md --> |
52 | 52 | <div class="card bg-base-100 shadow-md overflow-hidden w-full max-w-md transition-transform duration-300 hover:-translate-y-1 hover:shadow-xl"> <!-- slightly larger card --> |
53 | | - <% if m.thumbnail_url.present? %> |
| 53 | + <% if m.thumbnail.present? %> |
54 | 54 | <figure class="w-full aspect-video max-h-48 overflow-hidden"> <!-- a little taller thumbnail --> |
55 | | - <img src="<%= m.thumbnail_url %>" alt="<%= m.title %> thumbnail" class="w-full h-full object-cover transition-transform duration-300 ease-out hover:scale-105"> |
| 55 | + <img src="<%= m.thumbnail %>" alt="<%= m.title %> thumbnail" class="w-full h-full object-cover transition-transform duration-300 ease-out hover:scale-105"> |
56 | 56 | </figure> |
57 | 57 | <% end %> |
58 | 58 | <div class="card-body p-3 md:p-4"> <!-- slightly more breathing room --> |
59 | 59 | <span class="badge badge-ghost capitalize w-fit text-xs md:text-sm"><%= m.level %></span> |
60 | 60 | <h3 class="card-title text-base mt-1"><%= m.title %></h3> |
61 | 61 | <div class="card-actions justify-start mt-2"> |
62 | | - <%= link_to 'Open resource', m.link_url, class: 'link link-primary text-sm transition-colors duration-200 hover:underline', target: '_blank', rel: 'noopener' %> |
| 62 | + <%= link_to 'Open resource', m.link, class: 'link link-primary text-sm transition-colors duration-200 hover:underline', target: '_blank', rel: 'noopener' %> |
63 | 63 | </div> |
64 | 64 | </div> |
65 | 65 | </div> |
|
0 commit comments