feedless/app/views/_posts.ejs

26 lines
869 B
Plaintext

<div style="padding-top: 15px;">
<% posts.map(post => { %>
<% if (!post.content.text) return %>
<div class="post">
<div>
<a href="<%= profileUrl(post.author) %>">
<img src="<%= profileImageUrl(post.authorProfile) %>" class="post-profile-pic" />
</a>
</div>
<div class="post-content">
<div class="content-header">
<a href="<%= profileUrl(post.author) %>" class="no-link-style">
<%= post.authorProfile.name %>
</a>
</div>
<div class="content-body">
<% let text = post.content.text.slice(0, 140) %>
<% if (post.content.text.length > 140) text += "..." %>
<% text.split("\n").map((line, index) => { %>
<%- index > 0 ? "<br />" : "" %><%= line %>
<% }) %>
</div>
</div>
</div>
<% }) %>
</div>