feedless/web/views/desktop/profile.ejs

74 lines
2.5 KiB
Plaintext

<%- include('_header', { main_class: "screen-center" }) %>
<div class="columns">
<div class="wall" style="border-radius: 5px 0 0 5px">
<div class="columns">
<div>
<img class="profile-pic" src="<%= profileImageUrl(profile) %>" />
</div>
<div style="padding-left: 20px">
<div class="columns" style="align-items: center;">
<h1><%= profile.name %></h1>
<% if (friendshipStatus == "friends") { %>
<div style="margin-left: 14px">✅ Friends</div>
<% } %>
</div>
<div style="margin-bottom: 20px;"><%- escapeMarkdown(profile.description || "").substr(0, 70) %></div>
<% if (friendshipStatus == "request_received") { %>
<p><%= profile.name %> sent you a friendship request</p>
<% } else if (friendshipStatus == "request_rejected") { %>
<p>You rejected <%= profile.name %> friendship request</p>
<% } %>
<div class="columns profile-actions">
<%- include('../shared/_friendship_button') %>
<button class="button-yellow js-compose-secret-message" style="margin-left: 5px" data-url="<%= profileUrl(profile.id, "/publish_secret") %>">
🤫 Secret Message
</button>
<%- include('secrets/_compose_single') %>
</div>
</div>
</div>
<form action="<%= profileUrl(profile.id, "/publish") %>" method="POST">
<div class="letter-count js-letter-count">140</div>
<textarea name="message" class="compose-post" placeholder="Write something to <%= profile.name %>..."></textarea>
<div class="reverse-columns" style="margin-top: 10px">
<input type="submit" value="Publish" />
</div>
</form>
<h2 style="margin: 0"><%= profile.name %>'s Wall</h2>
<div style="padding-top: 15px;">
<% if (posts.length == 0) { %>
<div class="post">
No posts yet
</div>
<% } else { %>
<%- include('../shared/_posts', { posts }) %>
<% } %>
</div>
</div>
<div class="friends-communities">
<h2>Friends</h2>
<%- include('_friends', { friends: friends.friends }) %>
<% if (friends.friends.length == 0) { %>
<p>No friends</p>
<% } %>
<h2 style="margin-top: 30px">Communities</h2>
<% communities.map(community => { %>
<a href="/communities/<%= community %>" class="link-block">
#<%= community %>
</a>
<% }) %>
<% if (communities.length == 0) { %>
<p>No communities</p>
<% } %>
</div>
</div>
<%- include('_footer') %>