Skip to content

Commit 05e3f09

Browse files
committed
Fix LeaderSpotlight display on Workshop show show_associations
1 parent 58825d3 commit 05e3f09

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

app/views/workshops/_show_associations.html.erb

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -52,42 +52,43 @@
5252
</div>
5353
<% end %>
5454

55-
<% if @leader_spotlights.any? %>
56-
<div id="workshop-spotlights" class="flex-1 bg-white p-4 rounded-lg shadow-md mb-3">
57-
<section id="workshopLeaderSpotlights">
58-
<div class="flex items-start justify-between mb-1">
59-
<div class="pr-6">
60-
<h2 class="text-lg font-semibold mb-2">Related Facilitator Spotlight(s)</h2>
55+
<% if true || @leader_spotlights.any? %>
56+
<div id="workshop-spotlights" class="flex-1 bg-white p-4 rounded-lg shadow-md mb-3">
57+
<section id="workshopLeaderSpotlights">
58+
<div class="flex items-start justify-between mb-1">
59+
<div class="pr-6">
60+
<h2 class="text-lg font-semibold mb-2">Related facilitator spotlight(s)</h2>
61+
</div>
62+
<% if current_user.super_user? && @workshop.persisted? %>
63+
<%= link_to "New story",
64+
new_story_path(workshop_id: @workshop.id,
65+
windows_type_id: @workshop.windows_type_id,
66+
owner_id: @workshop_id,
67+
owner_type: "Workshop"),
68+
class: "admin-only bg-blue-100 btn btn-secondary-outline" %>
69+
<% end %>
6170
</div>
62-
<% if current_user.super_user? && @workshop.persisted? %>
63-
<%= link_to "New story",
64-
new_story_path(workshop_id: @workshop.id,
65-
owner_id: @workshop_id, owner_type: "Workshop"),
66-
class: "admin-only bg-blue-100 btn btn-secondary-outline" %>
67-
<% end %>
68-
</div>
6971

70-
<hr class="border-gray-300 mb-4">
71-
<div class="flex flex-wrap gap-4">
72-
<% @leader_spotlights.each do |spotlight| %>
73-
<div class="flex flex-col items-center space-y-2 max-w-[120px] mb-3">
74-
<%= link_to resource_path(spotlight), class: "flex flex-col items-center text-center" do %>
75-
<img
76-
src="<%= spotlight.decorate.main_image_url %>"
77-
alt="<%= spotlight.title.truncate(25) %>"
78-
class="block w-10 h-10 rounded-md object-cover"
79-
onerror="this.onerror=null;this.src='<%= asset_path('missing.png') %>';
80-
this.classList.add('p-2','object-contain');"
81-
/>
82-
<p class="text-sm text-gray-700 mt-1 leading-tight">
83-
<span class="block"><%= spotlight.author %></span>
84-
<span class="block text-xs text-gray-500"><%= spotlight.title %></span>
85-
</p>
86-
<% end %>
87-
</div>
88-
<% end %>
89-
</div>
90-
</section>
91-
</div>
92-
<% end %>
72+
<hr class="border-gray-300 mb-4">
73+
<div class="flex flex-wrap gap-4">
74+
<% @leader_spotlights.each do |spotlight| %>
75+
<div class="flex flex-col items-center space-y-2 max-w-[120px] mb-3">
76+
<%= link_to resource_path(spotlight), class: "flex flex-col items-center text-center" do %>
77+
<%= render "media/display_image",
78+
resource: spotlight,
79+
width: 10, height: 10,
80+
variant: :index,
81+
link_to_object: true,
82+
file: spotlight.decorate.display_image %>
83+
<p class="text-sm text-gray-700 mt-1 leading-tight">
84+
<span class="block"><%= spotlight.author %></span>
85+
<span class="block text-xs text-gray-500"><%= spotlight.title %></span>
86+
</p>
87+
<% end %>
88+
</div>
89+
<% end %>
90+
</div>
91+
</section>
92+
</div>
93+
<% end %>
9394
</div>

0 commit comments

Comments
 (0)