feat: company dropdown on user profile for multi-company users
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

- "Profil firmy" button becomes a dropdown listing all companies
- Subtitle under name shows all companies separated by dots
- Single-company users see no changes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-04-10 14:25:29 +02:00
parent 975087c52e
commit 51bd9f25dc

View File

@ -230,7 +230,9 @@
{% endif %}
</h1>
<p class="profile-subtitle">
{% if profile_user.company %}
{% if user_companies and user_companies|length > 1 %}
{{ user_companies|map(attribute='company')|selectattr('name')|map(attribute='name')|join(' · ') }}
{% elif profile_user.company %}
{{ profile_user.company.name }}
{% else %}
Członek portalu Norda Biznes
@ -248,7 +250,25 @@
</svg>
Wyślij wiadomość prywatną na portalu
</a>
{% if profile_user.company %}
{% if user_companies and user_companies|length > 1 %}
<div style="position:relative;display:inline-block;">
<button class="contact-btn secondary" onclick="this.nextElementSibling.style.display = this.nextElementSibling.style.display === 'block' ? 'none' : 'block';" type="button">
<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
<path d="M19 21V5a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v5m-4 0h4"/>
</svg>
Profil firmy ▾
</button>
<div style="display:none;position:absolute;top:100%;left:0;margin-top:4px;background:var(--bg-primary);border:1px solid var(--border);border-radius:var(--radius);box-shadow:0 4px 12px rgba(0,0,0,0.15);min-width:220px;z-index:100;overflow:hidden;">
{% for uc in user_companies %}
{% if uc.company %}
<a href="{{ url_for('company_detail_by_slug', slug=uc.company.slug) }}" style="display:block;padding:10px 14px;color:var(--text-primary);text-decoration:none;font-size:14px;border-bottom:1px solid var(--border-light);">
{{ uc.company.name }}
</a>
{% endif %}
{% endfor %}
</div>
</div>
{% elif profile_user.company %}
<a href="{{ url_for('company_detail_by_slug', slug=profile_user.company.slug) }}" class="contact-btn secondary">
<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
<path d="M19 21V5a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v5m-4 0h4"/>