| [8878814] | 1 | <div class="tl-wrap">
|
|---|
| 2 | <%- include('../partials/fedi-tabs', { active: 'followers' }) %>
|
|---|
| 3 | <h1 class="tl-title"><%= t('tl.followers') %><% if (followers && followers.length) { %> (<%= followers.length %>)<% } %></h1>
|
|---|
| 4 | <% if (typeof success !== 'undefined' && success) { %><div class="alert alert-success"><%= success %></div><% } %>
|
|---|
| 5 | <% if (typeof error !== 'undefined' && error) { %><div class="alert alert-error"><%= error %></div><% } %>
|
|---|
| 6 |
|
|---|
| 7 | <p class="tl-lead"><%= t('tl.followers_lead') %></p>
|
|---|
| 8 |
|
|---|
| 9 | <% if (followers && followers.length) { %>
|
|---|
| 10 | <ul class="tl-foll-list">
|
|---|
| 11 | <% followers.forEach(function(f){
|
|---|
| 12 | var host='', user='';
|
|---|
| 13 | try { var u = new URL(f.actor_uri); host = u.hostname; user = (u.pathname.split('/').filter(Boolean).pop() || ''); } catch (e) {}
|
|---|
| 14 | var handle = user ? ('@' + user + '@' + host) : f.actor_uri;
|
|---|
| 15 | var stale = !f.last_delivery_at || (f.last_error_at && (!f.last_delivery_at || f.last_error_at > f.last_delivery_at));
|
|---|
| 16 | %>
|
|---|
| 17 | <li class="tl-foll<%= stale ? ' is-stale' : '' %>">
|
|---|
| 18 | <span class="tl-foll-av"><%= (user || host || '?').charAt(0).toUpperCase() %></span>
|
|---|
| 19 | <span class="tl-foll-meta">
|
|---|
| 20 | <a href="<%= f.actor_uri %>" target="_blank" rel="nofollow noopener"><%= handle %></a>
|
|---|
| 21 | <span class="tl-foll-deliv">
|
|---|
| 22 | <% if (f.last_delivery_at) { %>
|
|---|
| 23 | <%= t('tl.last_delivery') %>: <%= formatDateTime(f.last_delivery_at) %>
|
|---|
| 24 | <% } else { %>
|
|---|
| 25 | <span class="tl-foll-never"><%= t('tl.never_delivered') %></span>
|
|---|
| 26 | <% } %>
|
|---|
| 27 | <% if (f.last_error_at) { %><span class="tl-foll-err">· <%= t('tl.delivery_failed') %>: <%= formatDateTime(f.last_error_at) %></span><% } %>
|
|---|
| 28 | </span>
|
|---|
| 29 | </span>
|
|---|
| 30 | <form method="post" action="/followers/<%= f.id %>/remove" onsubmit="return confirm('<%= t('tl.remove_confirm') %>')">
|
|---|
| 31 | <button type="submit" class="tl-unfollow"><%= t('tl.remove_follower') %></button>
|
|---|
| 32 | </form>
|
|---|
| 33 | </li>
|
|---|
| 34 | <% }); %>
|
|---|
| 35 | </ul>
|
|---|
| 36 | <% } else { %>
|
|---|
| 37 | <p class="tl-empty"><%= t('tl.empty_followers') %></p>
|
|---|
| 38 | <% } %>
|
|---|
| 39 | </div>
|
|---|
| 40 |
|
|---|
| 41 | <style>
|
|---|
| 42 | .tl-wrap { max-width: 640px; margin: 1rem auto; padding: 0 1rem; }
|
|---|
| 43 | .tl-title { margin: 0 0 .25rem; }
|
|---|
| 44 | .tl-lead { color: var(--ink-soft, #888); margin: 0 0 1.25rem; font-size: .9rem; line-height: 1.5; }
|
|---|
| 45 | .tl-foll-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
|
|---|
| 46 | .tl-foll { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: 12px; background: color-mix(in srgb, var(--ink, #000) 4%, transparent); }
|
|---|
| 47 | .tl-foll.is-stale { background: color-mix(in srgb, #c0392b 10%, transparent); }
|
|---|
| 48 | .tl-foll-av { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: color-mix(in srgb, var(--accent, #888) 20%, transparent); color: var(--accent, #555); }
|
|---|
| 49 | .tl-foll-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
|
|---|
| 50 | .tl-foll-meta a { color: var(--ink, inherit); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|---|
| 51 | .tl-foll-meta a:hover { text-decoration: underline; }
|
|---|
| 52 | .tl-foll-deliv { color: var(--ink-soft, #888); font-size: .78rem; }
|
|---|
| 53 | .tl-foll-never { color: #c0392b; font-weight: 600; }
|
|---|
| 54 | .tl-foll-err { color: #c0392b; }
|
|---|
| 55 | .tl-unfollow { background: none; border: 1px solid color-mix(in srgb, var(--ink, #000) 18%, transparent); border-radius: 8px; padding: .25rem .6rem; font-size: .8rem; color: var(--ink-soft, #888); cursor: pointer; white-space: nowrap; }
|
|---|
| 56 | .tl-unfollow:hover { color: #c0392b; border-color: #c0392b; }
|
|---|
| 57 | .tl-empty { color: var(--ink-soft, #888); }
|
|---|
| 58 | </style>
|
|---|