91 lines
4.0 KiB
Plaintext
91 lines
4.0 KiB
Plaintext
<% if infobox then %>
|
|
<% render("views.common.infobox", infobox) %>
|
|
<% end %>
|
|
<div class="darkbg">
|
|
<h1 class="thread-title"><i><%= user.username %></i>'s profile</h1>
|
|
<% if user_is_me then -%>
|
|
<div class="user-actions">
|
|
<a class="linkbutton" href="<%= url_for("user_settings", {username = user.username}) %>">Settings</a>
|
|
<form method="post" action="<%= url_for("user_logout", {user_id = me.id}) %>">
|
|
<input class="warn" type="submit" value="Log out">
|
|
</form>
|
|
</div>
|
|
<% if user:is_guest() then %>
|
|
<h2>You are a guest. A Moderator needs to approve your account before you will be able to post.</h2>
|
|
<% end %>
|
|
<% end %>
|
|
<% if me:is_mod() and not user:is_system() then %>
|
|
<h1 class="thread-title">Moderator controls</h1>
|
|
<% if user:is_guest() then %>
|
|
<p>This user is a guest. They signed up on <% render("views.common.timestamp", {timestamp = user.created_at}) -%>.</p>
|
|
<form class="modform" method="post" action="<%= url_for("confirm_user", {user_id = user.id}) %>">
|
|
<input type="submit" value="Confirm user">
|
|
</form>
|
|
<% else %> <% --[[ user is not guest ]] %>
|
|
<p>This user signed up on <% render("views.common.timestamp", {timestamp = user.created_at}) -%> and was confirmed on <% render("views.common.timestamp", {timestamp = user.confirmed_on}) %>.</p>
|
|
<% if user.permission < me.permission then %>
|
|
<form class="modform" method="post" action="<%= url_for("guest_user", {user_id = user.id}) %>">
|
|
<input class="warn" type="submit" value="Demote user to guest (soft ban)">
|
|
</form>
|
|
<% end %>
|
|
<% if me:is_admin() and not user:is_mod() then %>
|
|
<form class="modform" method="post" action="<%= url_for("mod_user", {user_id = user.id}) %>">
|
|
<input class="warn" type="submit" value="Promote user to moderator">
|
|
</form>
|
|
<% elseif user:is_mod() and user.permission < me.permission then %>
|
|
<form class="modform" method="post" action="<%= url_for("demod_user", {user_id = user.id}) %>">
|
|
<input class="critical" type="submit" value="Demote user to regular user">
|
|
</form>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="user-info">
|
|
<div class="user-page-usercard">
|
|
<div class="usercard-inner">
|
|
<img class="avatar" src="<%= avatar_url(user) %>">
|
|
<strong class="big"><%= user.username %></strong>
|
|
<% if user.status ~= "" then %>
|
|
<em class="user-status"><%= user.status %></em>
|
|
<% end %>
|
|
<% if user.signature_rendered ~= "" then %>
|
|
Signature:
|
|
<div>
|
|
<%- user.signature_rendered %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<div class="user-page-stats">
|
|
<ul class="user-stats-list">
|
|
<li>Permission: <%= PermissionLevelString[user.permission] %></li>
|
|
<li>Posts created: <%= stats.post_count %></li>
|
|
<li>Threads started: <%= stats.thread_count %></li>
|
|
<% if stats.latest_thread_title then %>
|
|
<li>Latest started thread: <a href="<%= url_for("thread", {slug = stats.latest_thread_slug}) %>"><%= stats.latest_thread_title %></a></li>
|
|
<% end %>
|
|
</ul>
|
|
Latest posts:
|
|
<div class="user-page-posts">
|
|
<% for _, post in ipairs(latest_posts) do %>
|
|
<div class="post-content-container">
|
|
<div class="post-info">
|
|
<% local post_url = get_post_url(post.id) %>
|
|
<a href="<%= post_url %>" title="Permalink"><i>
|
|
<% if tonumber(post.edited_at) > tonumber(post.created_at) then -%>
|
|
Edited at <% render("views.common.timestamp", {timestamp = post.edited_at}) -%> in <%= post.thread_title %>
|
|
<% else -%>
|
|
Posted on <% render("views.common.timestamp", {timestamp = post.created_at}) -%> in <%= post.thread_title %>
|
|
<% end -%>
|
|
</i></a>
|
|
</div>
|
|
<div class="post-content wider user-page-post-preview">
|
|
<div class="post-inner"><%- post.content %></div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|