| [7d932ce] | 1 | <%# Renders one fediverse thread node (n). Expects: n, t, canManageSite, _base, siteAvatar, formatDateTime %>
|
|---|
| 2 | <div class="comment-avatar">
|
|---|
| [c73ac64] | 3 | <% if (n.actor_icon) { %><img src="<%= n.actor_icon %>" alt="" loading="lazy">
|
|---|
| [7d932ce] | 4 | <% } else { %><span><%= (n.actor_name || '?').charAt(0).toUpperCase() %></span><% } %>
|
|---|
| 5 | </div>
|
|---|
| 6 | <div class="comment-body">
|
|---|
| 7 | <div class="comment-meta">
|
|---|
| [c73ac64] | 8 | <% if (n.actor_url) { %><a class="comment-author" href="<%= n.actor_url %>" rel="nofollow noopener" target="_blank"><%= n.actor_name %></a>
|
|---|
| 9 | <% } else { %><span class="comment-author"><%= n.actor_name %></span><% } %>
|
|---|
| 10 | <% if (n.actor_handle) { %><span class="fedi-handle"><%= n.actor_handle %></span><% } %>
|
|---|
| [7d932ce] | 11 | <% if (n.created_at) { %><span class="comment-time"><%= formatDateTime(n.created_at) %></span><% } %>
|
|---|
| 12 | </div>
|
|---|
| 13 | <div class="comment-content"><%- n.content %></div>
|
|---|
| 14 | <div class="comment-actions">
|
|---|
| 15 | <% if (n.mine && typeof canManageSite !== 'undefined' && canManageSite && n.outboxId) { %>
|
|---|
| 16 | <form method="post" action="<%= _base %>/fediverse/<%= n.outboxId %>/delete" onsubmit="return confirm('<%= t('fedi.delete_confirm') %>')">
|
|---|
| 17 | <button type="submit" class="comment-delete-btn"><%= t('comments.delete') %></button>
|
|---|
| 18 | </form>
|
|---|
| 19 | <% } else if (!n.mine && n.noteId) { %>
|
|---|
| 20 | <button type="button" class="comment-reply-btn fedi-remote-reply-btn" data-fedi-uri="<%= n.noteId %>" data-fedi-prompt="<%= t('fedi.remote_prompt') %>">
|
|---|
| 21 | <svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 17 4 12 9 7"/><path d="M20 18v-2a4 4 0 0 0-4-4H4"/></svg>
|
|---|
| 22 | <%= t('fedi.remote_reply_short') %>
|
|---|
| 23 | </button>
|
|---|
| 24 | <% } %>
|
|---|
| 25 | </div>
|
|---|
| 26 | <% if (n.children && n.children.length) { %>
|
|---|
| 27 | <ol class="comment-replies">
|
|---|
| 28 | <% n.children.forEach(function(c){ %>
|
|---|
| [a885afc] | 29 | <li class="comment comment-reply"><%- include('../partials/fedi-node', { n: c, t: t, canManageSite: (typeof canManageSite !== 'undefined' ? canManageSite : false), _base: _base, siteAvatar: (typeof siteAvatar !== 'undefined' ? siteAvatar : null), formatDateTime: formatDateTime }) %></li>
|
|---|
| [7d932ce] | 30 | <% }); %>
|
|---|
| 31 | </ol>
|
|---|
| 32 | <% } %>
|
|---|
| 33 | </div>
|
|---|