impress/app/views/items/_item_list_row.html.haml
Emi Matchu be525d1d67 Oops, fix bug with empty subtitles in Item Getting Guide
Oh weird, even with `flush: true`, `content_for` will ignore an empty
block and *not* flush out the previous content. This could cause rows
whose subtitles *should* have been empty (e.g. no NC trade value) to
display the previous row's value instead.

Let's make this whole situation a bit more robust by having the
*template* clear out the subtitle right before calling the block. That
way, a previous row's value *can't* get in, no matter what.
2024-06-09 15:40:58 -07:00

15 lines
447 B
Text

-# Run the block first, so we can get the subtitle content if provided! Clear
-# out any old values beforehand, too.
- content_for :subtitle, "", flush: true
- content = yield
- subtitle = yield :subtitle
%tr
%td.thumbnail-cell
= link_to item_thumbnail_for(item), item, target: "_blank",
tabindex: "-1"
%td.name-cell
= link_to item.name, item, target: "_blank"
- if subtitle.present?
.subtitle= subtitle
%td.actions-cell= content