summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-21 14:25:28 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-21 14:25:28 +0200
commitb54f70cb35df91d51b7829a10b8294ae5f28b7f5 (patch)
treecb3cb95cac71239523f8b51bad5742b10e8ab678
parentc14683fe37fabe06082f43e8bf67debc4cca7297 (diff)
Show which image is headlined on nodes#show
The editable sidebar has had a star toggle since headline designation shipped; the read-only view never gained any equivalent indicator. Same visual language -- gold filled star, same .is_headline card highlight already defined in admin.css.
-rw-r--r--app/views/nodes/show.html.erb10
-rw-r--r--public/stylesheets/admin.css24
2 files changed, 33 insertions, 1 deletions
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb
index af05778..a7be3c6 100644
--- a/app/views/nodes/show.html.erb
+++ b/app/views/nodes/show.html.erb
@@ -254,11 +254,19 @@
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 <div class="node_description">Images</div> 258 <div class="node_description">Images</div>
258 <div class="node_content node_info_group"> 259 <div class="node_content node_info_group">
259 <ul class="thumbnail_list"> 260 <ul class="thumbnail_list">
260 <% @page.assets.images.each do |asset| %> 261 <% @page.assets.images.each do |asset| %>
261 <li><%= link_to image_tag(asset.upload.url(:thumb)), asset_path(asset) %></li> 262 <li class="<%= "is_headline" if asset.id == headline_asset_id %>">
263 <%= link_to image_tag(asset.upload.url(:thumb)), asset_path(asset) %>
264 <% if asset.id == headline_asset_id %>
265 <span class="headline_indicator" title="This page's headline image">
266 <%= icon("star", library: "tabler", "aria-hidden": true) %>
267 </span>
268 <% end %>
269 </li>
262 <% end %> 270 <% end %>
263 </ul> 271 </ul>
264 </div> 272 </div>
diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css
index 086e73d..88c9c8b 100644
--- a/public/stylesheets/admin.css
+++ b/public/stylesheets/admin.css
@@ -1316,6 +1316,30 @@ div#image_browser ul li {
1316 border-radius: 4px; 1316 border-radius: 4px;
1317} 1317}
1318 1318
1319.thumbnail_list li {
1320 position: relative;
1321}
1322
1323.thumbnail_list li .headline_indicator {
1324 position: absolute;
1325 top: 4px;
1326 right: 4px;
1327 width: 1.4rem;
1328 height: 1.4rem;
1329 display: flex;
1330 align-items: center;
1331 justify-content: center;
1332 border-radius: 50%;
1333 background: rgba(255, 255, 255, 0.85);
1334 color: #f5b400;
1335}
1336
1337.thumbnail_list li .headline_indicator svg {
1338 width: 0.9rem;
1339 height: 0.9rem;
1340 fill: currentColor;
1341}
1342
1319.related_asset_handle { 1343.related_asset_handle {
1320 display: flex; 1344 display: flex;
1321 color: #969696; 1345 color: #969696;