feat: Restrict company details to NORDA members only
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
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
- Block company detail access for non-members (redirect to membership form) - Show membership CTA header instead of catalog header for non-members - Add info banner explaining access restriction - Non-members can still see company list on homepage Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4c7573a2b9
commit
8c9597d3e9
@ -124,7 +124,17 @@ def index():
|
||||
|
||||
@bp.route('/company/<int:company_id>')
|
||||
def company_detail(company_id):
|
||||
"""Company detail page - requires login"""
|
||||
"""Company detail page - requires login and NORDA membership"""
|
||||
# Sprawdź czy użytkownik jest zalogowany
|
||||
if not current_user.is_authenticated:
|
||||
flash('Zaloguj się, aby zobaczyć szczegóły firmy.', 'warning')
|
||||
return redirect(url_for('auth.login'))
|
||||
|
||||
# Sprawdź czy użytkownik jest członkiem NORDA (ma firmę lub flagę is_norda_member)
|
||||
if not current_user.is_norda_member and not current_user.company_id:
|
||||
flash('Dostęp do katalog firm jest dostępny tylko dla członków Izby NORDA. Złóż deklarację członkowską, aby uzyskać pełny dostęp.', 'info')
|
||||
return redirect(url_for('membership.membership_apply'))
|
||||
|
||||
db = SessionLocal()
|
||||
try:
|
||||
company = db.query(Company).filter_by(id=company_id).first()
|
||||
|
||||
@ -800,7 +800,29 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<!-- Header -->
|
||||
<!-- Header - różny dla członków i nie-członków -->
|
||||
{% if current_user.is_authenticated and not current_user.is_norda_member and not current_user.company_id %}
|
||||
<!-- Banner CTA dla nie-członków NORDA -->
|
||||
<a href="{{ url_for('membership.membership_apply') }}" class="membership-header" data-animate="fadeIn" style="display: flex; align-items: center; gap: var(--spacing-xl); padding: var(--spacing-xl); background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); border-radius: var(--radius-lg); margin-bottom: var(--spacing-xl); text-decoration: none; color: white;">
|
||||
<div style="font-size: 3rem;">🤝</div>
|
||||
<div style="flex: 1;">
|
||||
<h1 style="font-size: var(--font-size-2xl); margin-bottom: var(--spacing-xs); font-weight: 700;">
|
||||
Dołącz do Izby Przedsiębiorców NORDA
|
||||
</h1>
|
||||
<p style="font-size: var(--font-size-md); opacity: 0.9; margin: 0;">
|
||||
Złóż deklarację członkowską i zyskaj pełny dostęp do katalog {{ total_companies }} firm, wydarzeń i funkcji portalu
|
||||
</p>
|
||||
</div>
|
||||
<div style="background: white; color: #16a34a; padding: var(--spacing-md) var(--spacing-xl); border-radius: var(--radius); font-weight: 700; font-size: var(--font-size-lg); white-space: nowrap;">
|
||||
Złóż deklarację →
|
||||
</div>
|
||||
</a>
|
||||
<div style="background: #fef3c7; border: 1px solid #fde68a; padding: var(--spacing-md); border-radius: var(--radius); margin-bottom: var(--spacing-xl); display: flex; align-items: center; gap: var(--spacing-sm);">
|
||||
<span style="font-size: 1.2rem;">🔒</span>
|
||||
<span style="color: #92400e;">Przeglądasz listę firm Izby NORDA. Aby zobaczyć szczegóły każdej firmy, złóż deklarację członkowską.</span>
|
||||
</div>
|
||||
{% else %}
|
||||
<!-- Standardowy nagłówek dla członków -->
|
||||
<div style="background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; padding: var(--spacing-xl); border-radius: var(--radius-lg); margin-bottom: var(--spacing-xl); text-align: center;">
|
||||
<h1 style="font-size: var(--font-size-3xl); margin-bottom: var(--spacing-sm); font-weight: 700;">
|
||||
Katalog firm Norda Biznes
|
||||
@ -809,6 +831,7 @@
|
||||
{{ COMPANY_COUNT }} podmiotów gospodarczych • 4 kategorie • 17 podkategorii
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Event Banner - Ankieta "Kto weźmie udział?" -->
|
||||
{% if next_event %}
|
||||
@ -842,19 +865,6 @@
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- Banner "Złóż deklarację" dla nie-członków NORDA -->
|
||||
{% if current_user.is_authenticated and not current_user.is_norda_member %}
|
||||
<a href="{{ url_for('membership.membership_apply') }}" class="membership-banner" data-animate="fadeIn" style="display: flex; align-items: center; gap: var(--spacing-lg); padding: var(--spacing-lg); background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); border-radius: var(--radius-lg); margin-bottom: var(--spacing-xl); text-decoration: none; border: 1px solid #86efac;">
|
||||
<div style="font-size: 2rem;">🤝</div>
|
||||
<div style="flex: 1;">
|
||||
<div style="font-weight: 600; color: #166534; font-size: var(--font-size-lg);">Dołącz do Izby Przedsiębiorców NORDA</div>
|
||||
<div style="color: #15803d; font-size: var(--font-size-sm);">Złóż deklarację członkowską i zyskaj dostęp do wszystkich funkcji portalu</div>
|
||||
</div>
|
||||
<div style="background: #22c55e; color: white; padding: var(--spacing-sm) var(--spacing-lg); border-radius: var(--radius); font-weight: 600;">
|
||||
Złóż deklarację →
|
||||
</div>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- NordaGPT Chat Banner -->
|
||||
{% if current_user.is_authenticated %}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user