feat: show profile photos instead of initials across the portal
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

Added avatar_path checks with photo display and initials fallback in:
- Forum reply authors
- Forum/announcement "seen by" avatars
- Navbar user avatar (desktop + mobile)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-04-09 22:41:38 +02:00
parent 9b94d56981
commit 32336c2488
3 changed files with 10 additions and 6 deletions

View File

@ -439,8 +439,8 @@
{% for read in readers[:20] %}
<div class="reader-avatar"
data-tooltip="{{ read.user.name or read.user.email.split('@')[0] }}{% if current_user.is_authenticated and read.user.id == current_user.id %} (Ty){% endif %}"
style="background: hsl({{ (read.user.id * 137) % 360 }}, 65%, 50%);">
{{ (read.user.name or read.user.email)[0]|upper }}
style="{% if not read.user.avatar_path %}background: hsl({{ (read.user.id * 137) % 360 }}, 65%, 50%);{% endif %}">
{% if read.user.avatar_path %}<img src="{{ url_for('static', filename=read.user.avatar_path) }}" alt="" style="width:100%;height:100%;border-radius:50%;object-fit:cover;">{% else %}{{ (read.user.name or read.user.email)[0]|upper }}{% endif %}
</div>
{% endfor %}
{% if readers_count > 20 %}

View File

@ -177,7 +177,7 @@
<!-- User Menu -->
<li class="user-dropdown">
<button class="user-trigger" onclick="toggleUserMenu(event)">
<span class="user-avatar">{{ current_user.name[:1].upper() }}</span>
<span class="user-avatar">{% if current_user.avatar_path %}<img src="{{ url_for('static', filename=current_user.avatar_path) }}" alt="" style="width:100%;height:100%;border-radius:50%;object-fit:cover;">{% else %}{{ current_user.name[:1].upper() }}{% endif %}</span>
<span class="user-name">{{ current_user.name.split()[0] }}</span>
<svg class="user-chevron" width="12" height="12" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/>
@ -207,7 +207,7 @@
<div class="user-menu" id="userMenu">
<div class="user-menu-handle"></div>
<div class="user-menu-mobile-header">
<span class="user-avatar">{{ current_user.name[:1].upper() }}</span>
<span class="user-avatar">{% if current_user.avatar_path %}<img src="{{ url_for('static', filename=current_user.avatar_path) }}" alt="" style="width:100%;height:100%;border-radius:50%;object-fit:cover;">{% else %}{{ current_user.name[:1].upper() }}{% endif %}</span>
<span class="user-menu-mobile-name">{{ current_user.name }}</span>
</div>
<a href="{{ url_for('dashboard') }}" class="user-menu-item">

View File

@ -1118,8 +1118,8 @@
{% for read in topic_readers[:20] %}
<div class="reader-avatar"
data-name="{{ read.user.name or read.user.email.split('@')[0] }}{% if current_user.is_authenticated and read.user.id == current_user.id %} (Ty){% endif %}"
style="background: hsl({{ (read.user.id * 137) % 360 }}, 65%, 50%);">
{{ (read.user.name or read.user.email)[0]|upper }}
style="{% if not read.user.avatar_path %}background: hsl({{ (read.user.id * 137) % 360 }}, 65%, 50%);{% endif %}">
{% if read.user.avatar_path %}<img src="{{ url_for('static', filename=read.user.avatar_path) }}" alt="" style="width:100%;height:100%;border-radius:50%;object-fit:cover;">{% else %}{{ (read.user.name or read.user.email)[0]|upper }}{% endif %}
</div>
{% endfor %}
{% if topic_readers|length > 20 %}
@ -1174,7 +1174,11 @@
<div class="reply-header">
<div class="reply-author">
<div class="reply-avatar">
{% if reply.author.avatar_path %}
<img src="{{ url_for('static', filename=reply.author.avatar_path) }}" alt="{{ reply.author.name }}" style="width:100%;height:100%;border-radius:50%;object-fit:cover;">
{% else %}
{{ (reply.author.name or reply.author.email)[0].upper() }}
{% endif %}
</div>
<span class="user-stats-trigger" data-user-id="{{ reply.author_id }}">
{{ reply.author.name or reply.author.email.split('@')[0] }}