Add profile picture to nav bar

This commit is contained in:
Michał Gdula 2023-04-21 16:20:40 +00:00
parent 2673026880
commit 4982914aa8
2 changed files with 25 additions and 3 deletions

View file

@ -88,7 +88,18 @@
{% if current_user.is_authenticated %}
<a href="{{ url_for('profile.profile') }}" class="navigation-item {% block nav_profile %}{% endblock %}">
<i class="ph-fill ph-folder-simple-user"></i>
{% if current_user.picture %}
<span class="nav-pfp">
<img
src="{{ url_for('api.media', path='pfp/' + current_user.picture) }}?r=icon"
alt="Profile picture"
onload="imgFade(this)"
style="opacity:0;"
/>
</span>
{% else %}
<i class="ph-fill ph-folder-simple-user"></i>
{% endif %}
<span class="tool-tip">Profile<i class="ph-fill ph-caret-left"></i></span>
</a>