Add humanized "last seen X ago" and "registered X ago" text on profile

This commit is contained in:
Xevion
2022-03-27 03:13:48 -05:00
parent 3df856aa60
commit 677abe3d65
5 changed files with 50 additions and 3 deletions

View File

@@ -4,13 +4,19 @@
<div class="content-inner">
<div class="profile-title">
<span class="profile-username">{{ user.username }}</span>
<span class="profile-timestamp online">Online Now!</span>
{% with seen_text = user.get_last_seen() %}
{% if seen_text == 'Online now!' %}
<span class="profile-timestamp online">{{ seen_text }}</span>
{% else %}
<span class="profile-timestamp offline">{{ seen_text }}</span>
{% endif %}
{% endwith %}
</div>
<div class="profile-lower">
<div class="profile-left">
<img class="profile-picture" src="{{ url_for('static', filename='default_photo.png') }}" alt="{{ user.username }}'s Profile Picture">
<div class="profile-details">
Registered 33 days ago<br>
Registered {{ user.get_registration_delta() }} ago<br>
67 likes<br>
14 posts<br>
</div>