start user page and stub more endpoints
This commit is contained in:
97
app/templates/users/user_page.html
Normal file
97
app/templates/users/user_page.html
Normal file
@@ -0,0 +1,97 @@
|
||||
{%- from 'common/macros.html' import subheader, timestamp, pager -%}
|
||||
{%- extends 'base.html' -%}
|
||||
{%- block title -%}{{ target_user.get_readable_name() }}'s profile{%- endblock -%}
|
||||
{%- set stats = target_user.get_post_stats() -%}
|
||||
{%- block content -%}
|
||||
{%- call() subheader("%s's profile" % target_user.get_readable_name()) -%}
|
||||
{%- if is_logged_in() -%}
|
||||
|
||||
{%- if target_user.id == get_active_user().id -%}
|
||||
<fieldset class="plank even no-shadow minimal thread-actions">
|
||||
<legend>Actions</legend>
|
||||
<form action="{{url_for('users.log_out', username=target_user.username)}}" method="POST">
|
||||
<input type="submit" class="warn" value="Log out">
|
||||
</form>
|
||||
</fieldset>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if get_active_user().is_mod() and target_user.id != get_active_user().id -%}
|
||||
<fieldset class="plank even no-shadow minimal thread-actions">
|
||||
<legend>Moderation actions</legend>
|
||||
<form method="POST">
|
||||
{%- if target_user.is_guest() -%}
|
||||
<input class="warn" type="submit" value="Approve user" formaction="{{url_for('mod.make_user_regular', user_id=target_user.id)}}">
|
||||
{%- else -%}
|
||||
<input class="warn" type="submit" value="Demote to guest (soft ban)" formaction="{{url_for('mod.make_user_guest', user_id=target_user.id)}}">
|
||||
{%- if get_active_user().is_admin() -%}
|
||||
{%- if not target_user.is_mod_only() -%}
|
||||
<input class="warn" type="submit" value="Promote to moderator" formaction="{{url_for('mod.make_user_mod', user_id=target_user.id)}}">
|
||||
{%- else -%}
|
||||
<input class="warn" type="submit" value="Demote from moderator" formaction="{{url_for('mod.make_user_regular', user_id=target_user.id)}}">
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
</form>
|
||||
</fieldset>
|
||||
{%- endif -%}
|
||||
|
||||
{%- endif -%}
|
||||
{%- endcall -%}
|
||||
<div class="userpage-usercard">
|
||||
<div class="usercard plank even contrast-bg minimal no-shadow">
|
||||
<div class="usercard-inner">
|
||||
<img src="{{target_user.get_avatar_url()}}" class="avatar">
|
||||
</div>
|
||||
</div>
|
||||
<div class="plank even minimal no-shadow user-stats">
|
||||
<h3 class="info">{{target_user.get_readable_name()}}</h3>
|
||||
<span>Display name: {{target_user.get_readable_name()}}</span>
|
||||
<span>Mention: @{{target_user.username}}</span>
|
||||
<span>Status: <em>{{target_user.status}}</em></span>
|
||||
<span>Rank: {{target_user.permission | permission_string}}</span>
|
||||
{%- set time = target_user.created_at -%}
|
||||
{%- if target_user.approved_at -%}
|
||||
{%- set time = target_user.approved_at -%}
|
||||
{%- endif -%}
|
||||
<span>Joined: {{timestamp(target_user.created_at)}}</span>
|
||||
{%- if not target_user.is_guest() -%}
|
||||
<span>Posts: <a href="{{url_for('users.posts', username=target_user.username)}}">{{stats.post_count}}</a></span>
|
||||
<span>Threads started: <a href="{{url_for('users.threads', username=target_user.username)}}">{{stats.thread_count}}</a></span>
|
||||
{%- set badges = target_user.get_badges() -%}
|
||||
|
||||
{%- if badges -%}
|
||||
<div class="badges-container nocenter">
|
||||
Badges:
|
||||
{%- for badge in badges -%}
|
||||
{%- if badge.link -%}<a href="{{badge.link}}">{%- endif -%}
|
||||
<img src="{{badge.get_image_url()}}" alt="{{badge.label}}" title="{{badge.label}}" class="badge-button">
|
||||
{%- if badge.link -%}</a>{%- endif -%}
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
{%- endif -%}
|
||||
<fieldset class="plank secondary-bg minimal even no-shadow">
|
||||
<legend>About me</legend>
|
||||
<p>stub</p>
|
||||
</fieldset>
|
||||
{%- if target_user.signature_rendered -%}
|
||||
<fieldset class="plank secondary-bg minimal even no-shadow">
|
||||
<legend>Signature</legend>
|
||||
{{target_user.signature_rendered | safe}}
|
||||
</fieldset>
|
||||
{%- endif -%}
|
||||
{#
|
||||
<fieldset class="plank secondary-bg minimal even no-shadow">
|
||||
<legend>Profile comments</legend>
|
||||
<fieldset class="plank minimal even no-shadow">
|
||||
<legend>Page</legend>
|
||||
{{pager(0, 3, url=url_for('users.log_in'))}}
|
||||
</fieldset>
|
||||
<div class="post plank">
|
||||
<p>stub</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
#}
|
||||
{%- endif -%}
|
||||
</div>
|
||||
</div>
|
||||
{%- endblock -%}
|
||||
Reference in New Issue
Block a user