feedless/app/views/home.ejs

80 lines
2.6 KiB
Plaintext

<%- include('_header') %>
<div class="columns">
<div class="about">
<img class="profile-pic" src="<%= profileImageUrl(profile) %>" />
<h1><%= profile.name %></h1>
<%= profile.description %>
<h2>Friends</h2>
<ul>
<% friends.friends.map(friend => { %>
<li>
<a href="<%= profileUrl(friend.id) %>">
<%= friend.name %> (<%= friend.id.slice(0, 8) %>)
</a>
</li>
<% }) %>
</ul>
</div>
<div class="wall">
<% if (vanishingMessages.length > 0) { %>
<div class="js-vanishing-messages" style="padding-bottom: 20px">
<h2>Vanishing Messages</h2>
<div class="notifications">
<% vanishingMessages.reverse().map(message => { %>
<span>
<button class="notification-box js-vanishing-message" data-key="<%= message.key %>">
<div><img src="<%= profileImageUrl(message.value.authorProfile) %>" class="post-profile-pic" /></div>
<div><%= message.value.authorProfile.name %></div>
</button>
<div class="overlay"></div>
<div class="modal">
<a href="<%= profileUrl(message.value.authorProfile.id) %>" class="modal-header">
<img src="<%= profileImageUrl(message.value.authorProfile) %>" class="post-profile-pic" style="padding-right: 10px" />
<%= message.value.authorProfile.name %>
</a>
<div class="modal-body">
<%= message.value.content.text %>
</div>
<div class="modal-footer">
after you close this box the message will be gone forever
<button class="modal-close">Close</button>
</div>
</div>
</span>
<% }) %>
</div>
</div>
<% } %>
<% if (friends.requests_received) { %>
<h2>Friend Requests</h2>
<div class="notifications" style="padding-bottom: 20px">
<% friends.requests_received.map(friend => { %>
<a href="<%= profileUrl(friend.id) %>" class="notification-box">
<div><img src="<%= profileImageUrl(friend) %>" class="post-profile-pic" /></div>
<div><%= friend.name %></div>
</a>
<% }) %>
</div>
<% } %>
<h2>Your Wall</h2>
<form action="/publish" method="POST">
<textarea name="message"></textarea>
<input type="submit" value="Send" />
</form>
<% posts.map(post => { %>
<%- include('_post', { post }) %>
<% }) %>
</div>
</div>
<%- include('_footer') %>