72 lines
4.6 KiB
HTML
72 lines
4.6 KiB
HTML
{% extends 'layout.html' %}
|
|
{% block nav_profile %} active {% endblock %}
|
|
{% block content %}
|
|
<div class="container">
|
|
<div class="jumbotron">
|
|
{% if user.profile.profile_pic %}
|
|
<img src="/files/{{ user.profile.profile_pic }}" class="rounded float-left mr-4" style="max-height: 100px;"/>
|
|
{% endif %}
|
|
<h1>{% if user.verified %} <i class="fas fa-shield-check" alt="Verified"></i> {% endif %}{{ user.displayname }} <small class="text-muted">on Tweeder</small></h1>
|
|
<h2>
|
|
{% if user.profile.bio %}
|
|
{{ user.profile.bio }}
|
|
{% else %}
|
|
Tweeder user since 1984
|
|
{% endif %}
|
|
</h2>
|
|
<div style="clear:both"></div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-4 col-xl-4 mb-3">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
{% if user.profile.profile_pic %}
|
|
<img src="/files/{{ user.profile.profile_pic }}" class="rounded mt-0 mr-1 img-fluid d-inline" style="max-height: 1.7rem;"/>
|
|
{% endif %}
|
|
<h4 style="display: inline">{{ user.displayname }}' Profile</h4>
|
|
{% if following %}<form action="/unfollow/{{ user.displayname }}" method="POST" style="display: inline; float: right;"><input type="submit" value="Unfollow" class="btn btn-outline-danger btn-sm"/></form> {% else %}<form action="/follow/{{ user.displayname }}" method="POST" style="display:inline; float: right;"><input type="submit" value="Follow" class="btn btn-outline-primary btn-sm"/></form>{% endif %}
|
|
</div>
|
|
<div class="card-body">
|
|
{{ posts|count }} Posts <br />
|
|
{{ user.following|count }} Following <br />
|
|
{{ followers|count }} Followers
|
|
<hr />
|
|
{% if user.profile.location %} <i class="far fa-fw fa-map-marker"></i> {{ user.profile.location }} <br>{% endif %}
|
|
{% if user.profile.gender %} <i class="far fa-fw fa-transgender-alt"></i> {{ user.profile.gender }} {% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-12 col-md-12 col-lg-8" style="float: right;">
|
|
{% if posts %}
|
|
{% for post in posts if not post.hidden %}
|
|
<div class="card" style="word-wrap: break-word; margin-bottom: 16px; width: 100%;">
|
|
<div class="card-header">
|
|
<b><a href="/profile/{{ post.poster }}">{{ post.poster }}</a></b> at {{ post.timePosted.strftime('%Y-%m-%d %-H:%M') }} {% if post.edited %}<i>(Edited)</i>{% endif %}
|
|
<span style="float: right">
|
|
{% if logged_in|lower in post.likes %}
|
|
<form style="display: inline;" method="POST" action="/unlike/{{ post._id }}"><button type="submit" class="btn btn-danger btn-sm"><i class="fas fa-heart"></i> {{ post.likes|count }}</button></form>
|
|
{% else %}
|
|
<form style="display: inline;" method="POST" action="/like/{{ post._id }}"><button type="submit" class="btn btn-outline-danger btn-sm"><i class="fas fa-heart"></i> {{ post.likes|count }}</button></form>
|
|
{% endif %}
|
|
<a href="/reply/{{ post._id }}" class="btn btn-primary btn-sm"><i class="far fa-reply"></i></a>
|
|
{% if logged_in|lower == post.poster|lower %}
|
|
<a href="/editpost/{{ post._id }}" class="btn btn-primary btn-sm"><i class="far fa-edit"></i></a>
|
|
{% endif %}
|
|
{% if logged_in|lower == post.poster|lower %}
|
|
<a href="/delete/{{ post._id }}" class="btn btn-danger btn-sm"><i class="far fa-trash-alt"></i></a>
|
|
{% endif %}
|
|
</span>
|
|
</div>
|
|
<div class="card-body">
|
|
{{ post.content }}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% else %}
|
|
<b>No posts found!</b>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|