Skip to content

Commit b6a7445

Browse files
authored
Update workshop display (#553)
* Update workshop display (series workshops stay in 2 columns until xs, tab styling, image overlay styling) * Add inner-hero class back to workshop show header
1 parent d21d033 commit b6a7445

File tree

9 files changed

+91
-675
lines changed

9 files changed

+91
-675
lines changed

app/frontend/stylesheets/application.tailwind.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,7 @@
7777
.rotate-180 {
7878
transform: rotate(180deg);
7979
}
80+
81+
.is-active {
82+
@apply text-primary border-b-2 border-primary font-bold bg-gray-100;
83+
}

app/models/workshop.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ def author_name
103103

104104
def date
105105
if month.present? && year.present?
106-
"#{month}/#{year}"
106+
Date.new(year.to_i, month.to_i).strftime("%B %Y")
107107
else
108-
"#{created_at.month}/#{created_at.year}"
108+
created_at.strftime("%B %Y")
109109
end
110110
end
111111

app/views/workshops/_index_row.html.erb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,21 @@
1313
<div
1414
id="workshop-<%= workshop.id %>"
1515
class="
16-
flex flex-col md:flex-row
16+
flex flex-col sm:flex-row
1717
<%= "admin-only bg-blue-100" if workshop.inactive? %>
1818
border-b border-gray-200 bg-white py-4 gap-4
19-
px-4 md:px-0 <!-- ⭐ Mobile padding -->
20-
"
21-
>
19+
px-4 sm:px-0">
2220
<div id="workshop-<%= workshop.id %>-anchor" style="position: relative; top: -200px;"></div>
2321

2422
<!-- 1️⃣ Image -->
25-
<div class="flex-shrink-0 w-full md:w-32 h-32 md:h-24 bg-gray-100 rounded overflow-hidden">
23+
<div class="flex-shrink-0 w-full sm:w-32 h-32 sm:h-24 bg-gray-100 rounded overflow-hidden">
2624
<%= link_to workshop_path(workshop) do %>
2725
<img class="object-cover w-full h-full" src="<%= workshop.main_image_url %>">
2826
<% end %>
2927
</div>
3028

3129
<!-- Content (bookmark + title+ + description) -->
32-
<div class="flex flex-col md:flex-row gap-4 flex-1">
30+
<div class="flex flex-col sm:flex-row gap-4 flex-1">
3331

3432
<!-- 2️⃣ Title / author / metadata -->
3533
<div class="flex flex-1 gap-4">
@@ -81,7 +79,7 @@
8179
</div>
8280

8381
<!-- 3️⃣ Description -->
84-
<div class="flex flex-1 gap-4 pr-4 md:pr-3">
82+
<div class="flex flex-1 gap-4 pr-4 sm:pr-3">
8583

8684
<!-- Empty placeholder where the bookmark column would be -->
8785
<div class="w-6 flex-shrink-0"></div>

0 commit comments

Comments
 (0)