- Timestamp:
- 07/19/2026 11:58:47 PM (7 weeks ago)
- Branches:
- main
- Children:
- 162c7a7
- Parents:
- 8ed65a6
- File:
-
- 1 edited
-
src/views/pages/messages.ejs (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/views/pages/messages.ejs
r8ed65a6 r544e9c2 32 32 // replies; Conversations = every other (public) reply. 33 33 var _kind = _t === 'sent' ? 'sent' 34 : (_t === 'like' || _t === 'boost' || _t === 'follow' ) ? 'act'34 : (_t === 'like' || _t === 'boost' || _t === 'follow' || _t === 'poll_done') ? 'act' 35 35 : _t === 'report' ? 'mod' 36 36 : (_t === 'mention' || _priv0) ? 'msgs' … … 42 42 <span class="msg-av<%= _t === 'sent' ? ' msg-av-sent' : '' %>" aria-hidden="true"> 43 43 <% 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> 44 <% } else if (_t === 'poll_done') { %><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="20" x2="18" y2="10"/><line x1="12" y1="20" x2="12" y2="4"/><line x1="6" y1="20" x2="6" y2="14"/></svg> 44 45 <% } else if (n.icon) { %><img src="<%= avatar(n.icon, 96) %>" alt="" loading="lazy"> 45 46 <% } else { %><%= _init %><% } %> … … 51 52 <% } else if (_t === 'mention') { %><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"/><path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"/></svg> 52 53 <% } else if (_t === 'sent') { %><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 17 4 12 9 7"/><path d="M20 18v-2a4 4 0 0 0-4-4H4"/></svg> 54 <% } else if (_t === 'poll_done') { %><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="20" x2="18" y2="10"/><line x1="12" y1="20" x2="12" y2="4"/><line x1="6" y1="20" x2="6" y2="14"/></svg> 53 55 <% } else { %><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg><% } %> 54 56 </span> … … 78 80 <% } else if (_t === 'mention') { %><%= t('notif.mentioned') %> 79 81 <% } else if (_t === 'sent') { %><%= t('msg.sent_reply') %> 82 <% } else if (_t === 'poll_done') { %><strong><%= t('msg.poll_done') %></strong> 80 83 <% } else { %><%= t('notif.replied') %><% } %> 81 84 <% if (_priv) { %><span class="msg-priv" title="<%= t('msg.private_hint') %>">🔒 <%= t('msg.private') %></span><% } %> … … 86 89 87 90 <% if (_t === 'report' && n.content) { %><div class="msg-content"><%= n.content %></div> 88 <% } else if ((_t === 'reply' || _t === 'mention' || _t === 'sent') && n.content) { %><div class="msg-content"><%- n.content %></div><% } %> 91 <% } else if ((_t === 'reply' || _t === 'mention' || _t === 'sent') && n.content) { %><div class="msg-content"><%- n.content %></div> 92 <% } else if (_t === 'poll_done' && n.poll) { %> 93 <div class="msg-poll" role="group"> 94 <% n.poll.options.forEach(function (o) { %> 95 <div class="msg-poll-opt"> 96 <div class="msg-poll-top"><span class="msg-poll-name"><%= o.name %></span><span class="msg-poll-pct"><%= o.pct %>%</span></div> 97 <div class="msg-poll-bar"><span style="width:<%= o.pct %>%"></span></div> 98 </div> 99 <% }); %> 100 <div class="msg-poll-total"><%= t('msg.poll_total', { n: n.poll.voters }) %></div> 101 </div> 102 <% } %> 89 103 90 104 <% if (_t === 'sent' && n.outboxId) { %> … … 143 157 var body = li.querySelector('.msg-content'); 144 158 var post = li.querySelector('.msg-post'); 159 var poll = li.querySelector('.msg-poll'); 145 160 li._search = ((li.getAttribute('data-who') || '') + ' ' + 146 (body ? body.textContent : '') + ' ' + (post ? post.textContent : '')).toLowerCase(); 161 (body ? body.textContent : '') + ' ' + (post ? post.textContent : '') + ' ' + 162 (poll ? poll.textContent : '')).toLowerCase(); 147 163 }); 148 164 function apply() { … … 232 248 .msg-content p { margin: .2rem 0; } .msg-content p:first-child { margin-top: 0; } .msg-content p:last-child { margin-bottom: 0; } 233 249 250 .msg-poll { margin: .5rem 0 0; display: flex; flex-direction: column; gap: .4rem; } 251 .msg-poll-opt { display: flex; flex-direction: column; gap: .2rem; } 252 .msg-poll-top { display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; } 253 .msg-poll-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } 254 .msg-poll-pct { font-variant-numeric: tabular-nums; color: var(--ink-soft, #888); flex-shrink: 0; } 255 .msg-poll-bar { height: 7px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--ink, #000) 10%, transparent); } 256 .msg-poll-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent, #06c); } 257 .msg-poll-total { font-size: .78rem; color: var(--ink-soft, #888); margin-top: .1rem; } 258 234 259 .msg-actions { display: flex; gap: .7rem; align-items: center; margin-top: .45rem; } 235 260 .msg-edit summary { cursor: pointer; font-size: .8rem; color: var(--ink-soft, #888); font-weight: 600; }
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)