Changeset 7875a80 in Klonkt for src/views/partials/msg-item.ejs
- Timestamp:
- 08/06/2026 01:56:08 AM (5 weeks ago)
- Branches:
- main
- Children:
- 0448e34
- Parents:
- 04aca12
- git-author:
- Robin <roboburr@…> (08/06/2026 01:55:53 AM)
- git-committer:
- Claude (agent) <aiclaude@…> (08/06/2026 01:56:08 AM)
- File:
-
- 1 edited
-
src/views/partials/msg-item.ejs (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/views/partials/msg-item.ejs
r04aca12 r7875a80 1 <% if (n.type === 'thread') { %> 2 <% 3 var _tseen = (typeof seen !== 'undefined' && seen) ? seen : 0; 4 // Een draad is nieuw zodra EEN bericht erin nieuw is. 5 var _tnew = !!_tseen && (n.messages || []).some(function (m) { 6 return m.created_at && Date.parse(m.created_at) > _tseen; 7 }); 8 var _tpeople = (n.people || []).map(function (p) { return p.name || p.handle || '?'; }); 9 // Alleen jij aan het woord: dan is de tegenpartij het adres waaraan 10 // je schreef, niet een lege naam. 11 var _tto = ((n.messages || []).find(function (m) { return m.to_handle; }) || {}).to_handle; 12 var _tlabel = _tpeople.length ? _tpeople.join(', ') : (_tto || t('msg.you')); 13 %> 14 <li class="msg-item msg-thread<%= _tnew ? ' is-new' : '' %>" data-kind="conv" data-who="<%= (_tpeople.join(' ') + ' ' + (_tto || '')).toLowerCase() %>"> 15 <div class="msg-thread-head"> 16 <span class="msg-thread-who"><%= _tlabel %></span> 17 <% if (n.count > 1) { %><span class="msg-thread-count"><%= n.count %></span><% } %> 18 <% if (_tnew) { %><span class="msg-new" title="<%= t('msg.new') %>"></span><% } %> 19 <%# De context bij de draad: waar gaat dit gesprek over? Zonder deze 20 link is een antwoord in een lijst niet te plaatsen. %> 21 <% if (n.post) { %> 22 <a class="msg-thread-post" href="/<%= n.post.slug %>"> 23 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg> 24 <%= n.post.title || n.post.slug %> 25 </a> 26 <% } %> 27 </div> 28 <ul class="msg-thread-msgs"> 29 <% (n.messages || []).forEach(function (m) { %><%- include('msg-item', { n: m, seen: _tseen, inThread: true }) %><% }); %> 30 </ul> 31 </li> 32 <% } else { %> 1 33 <% 2 34 var _seen = (typeof seen !== 'undefined' && seen) ? seen : 0; … … 13 45 : (_t === 'mention' || _priv0) ? 'msgs' 14 46 : 'conv'; 47 // Binnen een draad is dit geen zelfstandige regel: de chip filtert op 48 // de draad, niet op de losse zinnen erin. 49 var _sub = (typeof inThread !== 'undefined' && inThread); 15 50 var _init = String(_who || '?').replace(/^@/, '').charAt(0).toUpperCase(); 16 51 var _priv = (n.visibility === 'followers' || n.visibility === 'direct'); 17 52 %> 18 <li class=" msg-item msg-<%= _t %><%= _new ? ' is-new' : '' %>" data-kind="<%= _kind %>"data-who="<%= String(_who).toLowerCase() %>">53 <li class="<%= _sub ? 'msg-sub' : 'msg-item' %> msg-<%= _t %><%= _new ? ' is-new' : '' %>"<% if (!_sub) { %> data-kind="<%= _kind %>"<% } %> data-who="<%= String(_who).toLowerCase() %>"> 19 54 <span class="msg-av<%= _t === 'sent' ? ' msg-av-sent' : '' %>" aria-hidden="true"> 20 55 <% if (_t === 'sent') { %><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg> … … 65 100 <% } else { %><%= t('notif.replied') %><% } %> 66 101 <% if (_priv) { %><span class="msg-priv" title="<%= t('msg.private_hint') %>">🔒 <%= t('msg.private') %></span><% } %> 67 <% if (n.post_slug ) { %><a class="msg-post" href="/<%= n.post_slug %>"><%= n.post_title || n.post_slug %></a><% } %>102 <% if (n.post_slug && !_sub) { %><a class="msg-post" href="/<%= n.post_slug %>"><%= n.post_title || n.post_slug %></a><% } %> 68 103 <% if (_t === 'mention' && n.note_url) { %><a class="msg-post" href="<%= n.note_url %>" target="_blank" rel="nofollow noopener"><%= t('tl.view_original') %></a><% } %> 69 104 <% if (_t === 'sent' && n.in_reply_to) { %><a class="msg-post" href="<%= n.in_reply_to %>" target="_blank" rel="nofollow noopener"><%= t('tl.view_original') %></a><% } %> … … 116 151 </div> 117 152 </li> 153 <% } %>
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)