<%- include('../partials/fedi-tabs', { active: 'feed' }) %>

<%= t('tl.title') %>

<%= t('tl.lead') %>

<% if (typeof success !== 'undefined' && success) { %>
<%= success %>
<% } %> <% if (typeof error !== 'undefined' && error) { %>
<%= error %>
<% } %> <% if (!timeline || !timeline.length) { %>

<%= t('tl.empty') %>

<% } else { %>
    <% timeline.forEach(function(p){ %>
  1. <% if (p.reblog_name) { %>
    <%= p.reblog_name %> <%= t('tl.boosted') %>
    <% } %>
    <% if (p.author_icon) { %><% } else { %><%= (p.author_name || '?').charAt(0).toUpperCase() %><% } %> <%= p.author_name %> <%= p.author_handle %> <% if (p.published || p.created_at) { %><% } %>
    <% var media = []; try { media = JSON.parse(p.media_json || '[]'); } catch (e) { media = []; } var imgs = media.filter(function(m){ return m && m.url && (!m.type || /^image\//.test(m.type)); }); var vids = media.filter(function(m){ return m && m.url && m.type && /^video\//.test(m.type); }); var auds = media.filter(function(m){ return m && m.url && m.type && /^audio\//.test(m.type); }); var _nsfwVisual = !!p.nsfw && (imgs.length || vids.length || auds.length); var _nsfwText = !!p.nsfw && !(imgs.length || vids.length || auds.length); %> <% if (_nsfwText) { %>
    🔞 <%= p.cw || t('post.nsfw_warning') %><%= t('post.nsfw_show') %><%- p.content %>
    <% } else { %>
    <%- p.content %>
    <% } %> <% if (_nsfwVisual) { %>
    <% } %> <% if (imgs.length) { %>
    <% imgs.forEach(function(m){ %> <% }); %>
    <% } %> <% vids.forEach(function(m){ %><% }); %> <% /* A Klonkt audio post carries an embed player (embedHtml/embedUrl) that already covers these tracks, so don't ALSO render the raw Audio attachments as bare players here. Posts without a Klonkt embed (e.g. a plain remote audio) keep them. */ %> <% if (!p.embedHtml && !p.embedUrl) { auds.forEach(function(m){ %><% }); } %> <% if (_nsfwVisual) { %>
    🔞 <%= p.cw || t('post.nsfw_warning') %><%= t('post.nsfw_show') %>
    <% } %> <% if (p.embedHtml) { %>
    <%- p.embedHtml %>
    <% } %> <% if (p.embedUrl) { %>â–¶ <%= t('tl.open_player') %><% } %> <% if (p.url) { %><%= t('tl.view_original') %><% } %>
  2. <% }); %>
<% } %>