| 1 | <%
|
|---|
| 2 | // Square Instagram-style tile for the .feed-grid view (v9 pattern).
|
|---|
| 3 | // - With cover → background-image, dark gradient overlay reveals title on hover/touch
|
|---|
| 4 | // - No cover → .grid-tile-gradient with the title centered (random hue per tile)
|
|---|
| 5 | const _tileHue = ((post.id || post.slug || '0').charCodeAt(0) * 7) % 360;
|
|---|
| 6 | const _isPinned = !!post.pinned;
|
|---|
| 7 | const _hasCover = !!post.cover_image_url;
|
|---|
| 8 | const _typeLabel = (post.type && post.type !== 'post') ? post.type : '';
|
|---|
| 9 | const _src = post.source_name || ''; // bron-site (cirkel-feed: van welke site komt deze post)
|
|---|
| 10 | const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
|
|---|
| 11 | const _external = post.external_url || null;
|
|---|
| 12 | const _href = _external || (_base + '/' + post.slug);
|
|---|
| 13 | const _ext = !!_external;
|
|---|
| 14 | %>
|
|---|
| 15 | <a class="grid-tile<%= _hasCover ? '' : ' grid-tile-gradient' %><%= _isPinned ? ' is-pinned' : '' %>"
|
|---|
| 16 | href="<%= _href %>"
|
|---|
| 17 | <% if (_hasCover) { %>style="background-image: url('<%= post.cover_image_url %>'); --tile-hue: <%= _tileHue %>;"<% } else { %>style="--tile-hue: <%= _tileHue %>;"<% } %>
|
|---|
| 18 | <% if (_ext) { %>target="_blank" rel="noopener"<% } else { %>hx-get="<%= _href %>?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="<%= _href %>" hx-indicator="#pcms-loading"<% } %>>
|
|---|
| 19 |
|
|---|
| 20 | <% if (_typeLabel) { %>
|
|---|
| 21 | <span class="grid-tile-type"><%= _typeLabel %></span>
|
|---|
| 22 | <% } %>
|
|---|
| 23 | <% if (_isPinned) { %>
|
|---|
| 24 | <span class="grid-tile-pin">Pinned</span>
|
|---|
| 25 | <% } %>
|
|---|
| 26 |
|
|---|
| 27 | <% if (_hasCover) { %>
|
|---|
| 28 | <div class="grid-tile-overlay">
|
|---|
| 29 | <strong><%= post.title || '(untitled)' %></strong>
|
|---|
| 30 | <% if (_src) { %><span class="grid-tile-overlay-src">van <%= _src %></span><% } %>
|
|---|
| 31 | </div>
|
|---|
| 32 | <% } else { %>
|
|---|
| 33 | <span class="grid-tile-title"><%= post.title || '(untitled)' %></span>
|
|---|
| 34 | <% if (_src) { %><span class="grid-tile-gradient-src">van <%= _src %></span><% } %>
|
|---|
| 35 | <% } %>
|
|---|
| 36 | </a>
|
|---|