- Timestamp:
- 09/30/2026 07:27:05 AM (4 hours ago)
- Branches:
- main
- Children:
- 19e28ce
- Parents:
- 86cfa1a
- Location:
- src/views
- Files:
-
- 3 added
- 1 deleted
- 4 edited
-
pages/search.ejs (modified) (1 diff)
-
partials/fedi-interact-styles.ejs (modified) (1 diff)
-
partials/remote-preview.ejs (deleted)
-
partials/search-results.ejs (added)
-
partials/search-styles.ejs (added)
-
partials/search-surface.ejs (added)
-
partials/topnav.ejs (modified) (2 diffs)
-
shell.ejs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/views/pages/search.ejs
r86cfa1a rfd8faf5 1 <% const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : ''; %> 2 <% const _tracks = (typeof tracks !== 'undefined' && tracks) ? tracks : []; %> 3 <% const _events = (typeof events !== 'undefined' && events) ? events : []; %> 4 <% const _pages = (typeof pages !== 'undefined' && pages) ? pages : []; %> 5 <div class="container search-page"> 6 <h1><%= t('nav.search') %></h1> 1 <%# 2 /search?q=... is geen eigen pagina meer met een eigen uiterlijk (Robins 3 ontwerp, 30-9): het is het zoekvlak, open, met de resultaten al op de server 4 gerenderd. Een gedeelde link en Enter zonder JavaScript komen zo op precies 5 hetzelfde beeld uit als de zoekbalk op elke andere pagina. 7 6 8 <form method="get" action="<%= _base %>/search" class="search-page-form"> 9 <input 10 type="search" 11 name="q" 12 value="<%= query %>" 13 placeholder="<%= t('search.placeholder') %>" 14 autocomplete="off" 15 autofocus 16 aria-label="<%= t('nav.search') %>"> 17 <button type="submit" class="btn btn-primary"><%= t('search.button') %></button> 18 </form> 19 20 <% if (queryError) { %> 21 <p class="search-error"><%= t('search.error') %></p> 22 <% } %> 23 24 <% if (query && !queryError) { %> 25 <p class="search-meta"> 26 <%= t(total === 1 ? 'search.results_one' : 'search.results_other', { n: total, q: query }) %> 27 </p> 28 <% } %> 29 30 <%# Een geplakt adres is geen zoekterm maar een aanwijzing (shaer-utpi): het 31 object van de andere server staat bovenaan, met dezelfde knoppen als op 32 /authorize_interaction -- dezelfde partial, dus één render en één plek 33 waar een poort of een sanitizer kan wonen. %> 34 <% if (typeof remoteUri !== 'undefined' && remoteUri) { %> 35 <h2 class="search-section-title"><%= t('search.section_fediverse') %></h2> 36 <div class="auth-interact search-remote"> 37 <% if (!mayLookup) { %> 38 <%# Ophalen is een uitgaand verzoek namens deze server; dat doen we niet 39 op verzoek van een willekeurige bezoeker. %> 40 <p class="auth-interact-note"><%= t('search.fedi_signin') %></p> 41 <% } else if (remote && remoteKind === 'note') { %> 42 <%- include('../partials/remote-object', { target: remote, uri: remoteUri, reacted: remoteReacted, siteTitle: siteTitle, cancelUrl: _base + '/search?q=' + encodeURIComponent(query) }) %> 43 <% } else if (remote && remoteKind === 'actor') { %> 44 <%- include('../partials/remote-actor', { actor: remote, siteTitle: siteTitle }) %> 45 <% } else { %> 46 <p class="auth-interact-note"><%= t('fedi.remote_notfound') %></p> 47 <% } %> 48 </div> 49 <%- include('../partials/fedi-interact-styles') %> 50 <% } %> 51 52 <% if (_tracks.length) { %> 53 <h2 class="search-section-title"><%= t('search.section_tracks') %></h2> 54 <% var _inPost = t('search.in_post'); /* t() vóór de loop ophalen: function(t) overschaduwt 'm */ %> 55 <div class="search-tracks"> 56 <% _tracks.forEach(function(t) { 57 const tj = JSON.stringify({ id: t.id, url: t.url, title: t.title, artist: t.artist || '', cover: t.cover || '' }) 58 .replace(/&/g, '&').replace(/'/g, ''').replace(/</g, '<'); %> 59 <div class="post-audio-track search-track" id="track-<%= t.id %>" 60 data-pcms-track-id="<%= t.id %>" data-pcms-track-url="<%= t.url %>" 61 data-pcms-track='<%- tj %>'> 62 <button type="button" class="pat-play" aria-label="Speel <%= t.title %>"> 63 <svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M8 4l12 8-12 8z"/></svg> 64 </button> 65 <% if (t.cover) { %> 66 <span class="search-track-cover" style="background-image:url('<%= t.cover %>')" aria-hidden="true"></span> 67 <% } %> 68 <div class="pat-info"> 69 <div class="pat-title"><%= t.title %></div> 70 <% if (t.artist || t.album) { %> 71 <div class="pat-artist"> 72 <%= t.artist %><% if (t.artist && t.album) { %> · <% } %><%= t.album %> 73 </div> 74 <% } %> 75 </div> 76 <% if (t.postUrl) { %> 77 <a class="search-track-link" 78 href="<%= t.postUrl %>" 79 hx-get="<%= t.postUrl %>?partial=1" 80 hx-target="#pcms-main" 81 hx-swap="innerHTML" 82 hx-push-url="<%= t.postUrl %>" 83 aria-label="<%= _inPost %>"><%= _inPost %></a> 84 <% } %> 85 </div> 86 <% }); %> 87 </div> 88 <% } %> 89 90 <% if (results && results.length) { %> 91 <% if (_tracks.length) { %><h2 class="search-section-title"><%= t('search.section_posts') %></h2><% } %> 92 <ol class="search-results"> 93 <% results.forEach(function(r) { %> 94 <li class="search-result"> 95 <h3 class="search-result-title"> 96 <a href="<%= _base %>/<%= r.slug %>" 97 hx-get="<%= _base %>/<%= r.slug %>?partial=1" 98 hx-target="#pcms-main" 99 hx-swap="innerHTML" 100 hx-push-url="<%= _base %>/<%= r.slug %>" 101 hx-indicator="#pcms-loading"> 102 <%= r.title || '(zonder titel)' %> 103 </a> 104 </h3> 105 <p class="search-result-meta"> 106 <%= r.author_username %> 107 <% if (r.published_at) { %> · <%= formatDate(r.published_at) %><% } %> 108 </p> 109 <p class="search-result-snippet"><%- r.snippet %></p> 110 </li> 111 <% }); %> 112 </ol> 113 <% } %> 114 115 <% if (_events.length) { %> 116 <h2 class="search-section-title"><%= t('search.section_events') %></h2> 117 <ol class="search-results"> 118 <% _events.forEach(function(ev) { %> 119 <li class="search-result"> 120 <h3 class="search-result-title"><a href="<%= ev.url %>"><%= ev.where || '—' %></a></h3> 121 <p class="search-result-meta"><%= [ev.date, ev.time].filter(Boolean).join(' ') %></p> 122 </li> 123 <% }); %> 124 </ol> 125 <% } %> 126 127 <% if (_pages.length) { %> 128 <h2 class="search-section-title"><%= t('search.section_pages') %></h2> 129 <ul class="search-pages"> 130 <% _pages.forEach(function(pg) { %> 131 <li><a class="search-page-link" href="<%= pg.url %>"><%= pg.label %> <span aria-hidden="true">→</span></a></li> 132 <% }); %> 133 </ul> 134 <% } %> 135 136 <% if (query && !queryError && !results.length && !_tracks.length && !_events.length && !_pages.length) { %> 137 <p class="search-empty"><%= t('search.empty') %></p> 138 <% } %> 139 </div> 140 141 <style> 142 .search-page { max-width: 720px; margin: 3rem auto; padding: 0 1rem; } 143 .search-page h1 { font-family: var(--font-display, serif); font-size: 2rem; margin: 0 0 1.5rem; } 144 145 .search-page-form { 146 display: flex; 147 gap: 0.5rem; 148 margin-bottom: 1.5rem; 149 } 150 .search-page-form input { 151 flex: 1; 152 padding: 0.6rem 0.9rem; 153 border: 1px solid var(--rule); 154 border-radius: 5px; 155 background: var(--paper-2); 156 color: var(--ink); 157 font-size: 1rem; 158 } 159 .search-page-form input:focus { 160 outline: none; 161 border-color: var(--accent); 162 } 163 164 .search-meta { 165 color: var(--ink-muted, var(--ink-soft)); 166 font-size: 0.9rem; 167 margin: 0 0 1rem; 168 } 169 .search-section-title { 170 font-family: var(--font-display, serif); 171 font-size: 1.1rem; 172 margin: 1.75rem 0 0.75rem; 173 color: var(--ink-soft); 174 text-transform: uppercase; 175 letter-spacing: 0.05em; 176 } 177 .search-error { 178 background: rgba(200, 60, 60, 0.15); 179 color: #c33; 180 padding: 0.75rem 1rem; 181 border-radius: 6px; 182 border: 1px solid rgba(200, 60, 60, 0.3); 183 } 184 .search-empty { 185 color: var(--ink-muted, var(--ink-soft)); 186 text-align: center; 187 margin: 3rem 0; 188 } 189 190 /* Nummer-resultaten */ 191 .search-tracks { display: flex; flex-direction: column; gap: 0.25rem; } 192 .search-track.post-audio-track { 193 display: flex; 194 align-items: center; 195 gap: 0.75rem; 196 padding: 0.5rem 0.6rem; 197 border-radius: 8px; 198 } 199 .search-track .search-track-cover { 200 width: 38px; height: 38px; 201 flex: 0 0 38px; 202 border-radius: 5px; 203 background-size: cover; 204 background-position: center; 205 background-color: var(--paper-2); 206 } 207 .search-track .pat-info { flex: 1; min-width: 0; } 208 .search-track .pat-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } 209 .search-track .pat-artist { font-size: 0.82rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } 210 .search-track-link { 211 flex: 0 0 auto; 212 font-size: 0.82rem; 213 color: var(--accent); 214 text-decoration: none; 215 white-space: nowrap; 216 } 217 .search-track-link:hover { text-decoration: underline; } 218 219 .search-results { 220 list-style: none; 221 margin: 0; 222 padding: 0; 223 } 224 .search-result { 225 padding: 1rem 0; 226 border-bottom: 1px solid var(--rule); 227 } 228 .search-result:last-child { border-bottom: 0; } 229 230 .search-result-title { 231 font-family: var(--font-display, serif); 232 font-size: 1.25rem; 233 margin: 0 0 0.25rem; 234 } 235 .search-result-title a { 236 color: var(--ink); 237 text-decoration: none; 238 } 239 .search-result-title a:hover { color: var(--accent); } 240 241 .search-result-meta { 242 margin: 0 0 0.5rem; 243 color: var(--ink-muted, var(--ink-soft)); 244 font-size: 0.85rem; 245 } 246 247 .search-result-snippet { 248 margin: 0; 249 color: var(--ink-soft); 250 line-height: 1.5; 251 } 252 .search-result-snippet mark { 253 background: var(--accent); 254 color: white; 255 padding: 0.05em 0.25em; 256 border-radius: 3px; 257 } 258 .search-pages { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; } 259 .search-page-link { 260 display: inline-flex; align-items: center; gap: 0.3rem; 261 padding: 0.45rem 0.8rem; border: 1px solid var(--rule); border-radius: 999px; 262 color: var(--ink); text-decoration: none; font-size: 0.9rem; background: var(--paper-2); 263 } 264 .search-page-link:hover { border-color: var(--accent); color: var(--accent); } 265 </style> 7 De opmaak staat in partials/search-styles.ejs, die de topnav al meebrengt. 8 %> 9 <%- include('../partials/search-surface', Object.assign({}, locals, { mode: 'page' })) %> -
src/views/partials/fedi-interact-styles.ejs
r86cfa1a rfd8faf5 159 159 border: 1px solid color-mix(in srgb, var(--ink, #000) 18%, transparent); background: var(--paper, #fff); color: var(--ink, #000); } 160 160 161 /* De live-preview: open-link onder de kaart, en de kaart zonder rand-marge. */161 /* De compacte kaart in het zoekvak: de link naar de volle pagina eronder. */ 162 162 .rp-open { display: block; padding: 10px 4px 2px; text-align: right; font-weight: 600; font-size: .88rem; 163 163 color: var(--accent, #06c); text-decoration: none; } 164 164 .rp-open:hover { text-decoration: underline; } 165 .ss-remote { padding: 4px 0 6px; }166 .ss-remote-note { padding: .8rem .6rem; color: var(--ink-soft, var(--ink-muted)); font-size: .9rem; }167 .ss-remote-loading { display: flex; align-items: center; gap: 10px; padding: .9rem .6rem; color: var(--ink-soft, var(--ink-muted)); font-size: .9rem; }168 .ss-remote-loading::before { content: ''; width: 16px; height: 16px; border-radius: 50%; flex: 0 0 16px;169 border: 2px solid color-mix(in srgb, var(--accent, #06c) 30%, transparent); border-top-color: var(--accent, #06c);170 animation: ss-spin .8s linear infinite; }171 @keyframes ss-spin { to { transform: rotate(360deg); } }172 @media (prefers-reduced-motion: reduce) { .ss-remote-loading::before { animation: none; } }173 165 174 166 /* Smal scherm: alleen de tekens, gelijk verdeeld over de breedte. De woorden -
src/views/partials/topnav.ejs
r86cfa1a rfd8faf5 175 175 </header> 176 176 177 <!-- Search overlay (shared by mobile bottom-tab + desktop top-nav) --> 178 <%# De teksten staan op het element dat ze gebruikt, niet in het script: een 179 module is een statisch bestand en kan geen vertaling interpoleren. %> 180 <div id="search-overlay" class="search-overlay" hidden data-suggest="<%= _siteUrlBase %>/search/suggest" data-remote="<%= _siteUrlBase %>/search/remote" data-action="<%= _siteUrlBase %>/search" 181 data-i18n="<%= JSON.stringify({ posts: t('search.section_posts'), tracks: t('search.section_tracks'), events: t('search.section_events'), pages: t('search.section_pages'), all: t('search.suggest_all'), none: t('search.suggest_empty'), looking: t('search.fedi_looking') }) %>"> 182 <div class="container"> 183 <form class="search-overlay-form" method="get" action="<%= _siteUrlBase %>/search"> 184 <input type="search" name="q" placeholder="<%= t('search.placeholder') %>" autocomplete="off"> 185 <button type="submit" class="nav-btn" aria-label="<%= t('search.button') %>"> 186 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg> 187 </button> 188 <button type="button" class="nav-btn" id="search-close" aria-label="<%= t('imed.cancel') %>"> 189 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg> 190 </button> 191 </form> 192 <div id="search-suggest" class="search-suggest" data-lenis-prevent></div> 193 </div> 194 </div> 177 <!-- Het zoeken (gedeeld door de tabbalk op mobiel en de topnav op desktop) --> 178 <%# Balk + vak, dezelfde partial als de pagina /search: zie search-surface.ejs. %> 179 <%- include('./search-surface', { mode: 'overlay', t: t, siteUrlBase: _siteUrlBase }) %> 180 <%- include('./search-styles') %> 195 181 196 182 <%# Het script van de topnav staat in assets/js/mod/chrome.js (shaer-bqr). %> … … 441 427 } 442 428 443 /* ── Search overlay ── */ 444 .search-overlay { 445 position: fixed; top: 0; left: 0; right: 0; 446 background: color-mix(in srgb, var(--paper) 96%, transparent); 447 backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); 448 border-bottom: 1px solid var(--rule); 449 padding: 1rem 0; z-index: 200; 450 padding-top: calc(1rem + env(safe-area-inset-top, 0)); 451 box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 8%, transparent); 452 } 453 .search-overlay-form { display: flex; gap: .5rem; align-items: center; } 454 .search-overlay-form input { 455 flex: 1; padding: .85rem 1rem; 456 min-height: 44px; 457 border: 1px solid var(--rule); border-radius: 8px; 458 font-family: var(--font-ui); font-size: 1rem; 459 background: var(--paper); color: var(--ink); 460 } 461 .search-overlay-form input:focus { 462 outline: 2px solid var(--accent); outline-offset: 0; 463 } 464 .search-overlay-form .nav-btn { 465 width: 44px; height: 44px; 466 display: inline-flex; align-items: center; justify-content: center; 467 } 468 /* Live-resultaten dropdown */ 469 .search-suggest { margin-top: .6rem; max-height: 60vh; max-height: 70dvh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: .25rem; } 470 .search-suggest:empty { display: none; } 471 .ss-group { padding: .25rem 0; } 472 .ss-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft, var(--ink-muted)); padding: .35rem .25rem .2rem; } 473 .ss-item { display: block; padding: .55rem .6rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .95rem; } 474 .ss-item:hover { background: var(--paper-2); color: var(--accent); } 475 .ss-item.ss-noclick { opacity: .7; cursor: default; } 476 .ss-sub { color: var(--ink-soft, var(--ink-muted)); font-size: .85em; } 477 .ss-empty { padding: .8rem .6rem; color: var(--ink-soft, var(--ink-muted)); font-size: .9rem; } 478 .ss-all { display: block; margin-top: .35rem; padding: .55rem .6rem; border-top: 1px solid var(--rule); color: var(--accent); font-weight: 600; text-decoration: none; font-size: .9rem; } 479 .ss-all:hover { text-decoration: underline; } 429 /* Het zoeken heeft zijn opmaak in partials/search-styles.ejs. */ 480 430 /* Notification bell + unread badge */ 481 431 .nav-notif { position: relative; } -
src/views/shell.ejs
r86cfa1a rfd8faf5 130 130 // ontwikkeling een jaar gecachet, dus zonder bump bereikt een reparatie 131 131 // iedereen behalve wie de fout al heeft. 132 const MOD_V = 6 5;132 const MOD_V = 66; 133 133 %><!DOCTYPE html> 134 134 <html lang="<%- _e(lang) %>" data-palette="<%- _e((typeof palette !== 'undefined' && palette) ? palette : (safeSite.palette || 'klonkt')) %>">
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)