summaryrefslogtreecommitdiff
path: root/app/views/nodes/show.html.erb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-21 21:34:14 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-21 21:34:14 +0200
commitec8329069d36cc6aa444c8a48b6b34a3e8f5c9d2 (patch)
tree8a94a94984c0ff20cb3e6dcf12ee212fc98a9ae0 /app/views/nodes/show.html.erb
parent5b951f012e04e6ef97e4ef645d53bdf433a9eb7f (diff)
Extract Page#headline_asset
The same related_assets.find_by(headline: true) query was written by hand in three places -- content_helper, nodes#show, and the chapter teaser partial (which was still using assets.first, the old position-based rule, until now). Collapsed to one method, one query.
Diffstat (limited to 'app/views/nodes/show.html.erb')
-rw-r--r--app/views/nodes/show.html.erb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb
index a7be3c6f..f2b4b154 100644
--- a/app/views/nodes/show.html.erb
+++ b/app/views/nodes/show.html.erb
@@ -254,7 +254,7 @@
254 </div> 254 </div>
255 255
256 <% if @page.assets.images.any? %> 256 <% if @page.assets.images.any? %>
257 <% headline_asset_id = @page.related_assets.find_by(headline: true)&.asset_id %> 257 <% headline_asset_id = @page.headline_asset&.id %>
258 <div class="node_description">Images</div> 258 <div class="node_description">Images</div>
259 <div class="node_content node_info_group"> 259 <div class="node_content node_info_group">
260 <ul class="thumbnail_list"> 260 <ul class="thumbnail_list">