feat: add "Co nowego" release notes banner on homepage
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
Shows latest version, date, one highlight feature, and count of other changes. Links to /release-notes. Extracted _get_releases() helper for reuse between index and release_notes routes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
822590cd23
commit
77b619e0ec
@ -147,6 +147,10 @@ def index():
|
||||
MembershipApplication.status.in_(['draft', 'submitted', 'under_review', 'pending_user_approval', 'changes_requested'])
|
||||
).first()
|
||||
|
||||
# Latest release for "Co nowego" banner
|
||||
all_releases = _get_releases()
|
||||
latest_release = all_releases[0] if all_releases else None
|
||||
|
||||
return render_template(
|
||||
'index.html',
|
||||
companies=companies,
|
||||
@ -157,7 +161,8 @@ def index():
|
||||
next_event=next_event,
|
||||
upcoming_events=upcoming_events,
|
||||
pending_application=pending_application,
|
||||
zopk_facts=zopk_facts
|
||||
zopk_facts=zopk_facts,
|
||||
latest_release=latest_release
|
||||
)
|
||||
finally:
|
||||
db.close()
|
||||
@ -827,10 +832,9 @@ def dashboard():
|
||||
db.close()
|
||||
|
||||
|
||||
@bp.route('/release-notes')
|
||||
def release_notes():
|
||||
"""Historia zmian platformy."""
|
||||
releases = [
|
||||
def _get_releases():
|
||||
"""Return list of all release notes entries."""
|
||||
return [
|
||||
{
|
||||
'version': 'v1.40.0',
|
||||
'date': '7 marca 2026',
|
||||
@ -1613,6 +1617,12 @@ def release_notes():
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
@bp.route('/release-notes')
|
||||
def release_notes():
|
||||
"""Historia zmian platformy."""
|
||||
releases = _get_releases()
|
||||
|
||||
# Statystyki (używa globalnej stałej COMPANY_COUNT_MARKETING)
|
||||
db = SessionLocal()
|
||||
try:
|
||||
|
||||
@ -902,6 +902,28 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Co nowego na platformie -->
|
||||
{% if latest_release %}
|
||||
<a href="{{ url_for('release_notes') }}" style="display: flex; align-items: center; gap: var(--spacing-md); background: var(--surface); border: 1px solid var(--border-color, #e5e7eb); border-left: 4px solid var(--primary); border-radius: var(--radius-lg); padding: var(--spacing-md) var(--spacing-lg); margin-bottom: var(--spacing-lg); text-decoration: none; color: inherit; transition: var(--transition);" onmouseover="this.style.borderLeftColor='#22c55e'; this.style.boxShadow='var(--shadow-md)'" onmouseout="this.style.borderLeftColor='var(--primary)'; this.style.boxShadow='none'">
|
||||
<div style="font-size: 1.5rem; flex-shrink: 0;">✨</div>
|
||||
<div style="flex: 1; min-width: 0;">
|
||||
<div style="display: flex; align-items: baseline; gap: var(--spacing-sm); flex-wrap: wrap;">
|
||||
<span style="font-weight: 600; color: var(--text-primary);">Co nowego na platformie?</span>
|
||||
<span style="font-size: var(--font-size-xs); color: var(--text-secondary);">{{ latest_release.version }} · {{ latest_release.date }}</span>
|
||||
</div>
|
||||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
|
||||
{% set highlight = (latest_release.new[0] if latest_release.new else (latest_release.improve[0] if latest_release.improve else ''))|striptags %}
|
||||
{{ highlight }}
|
||||
{% set total_changes = (latest_release.new|length if latest_release.new else 0) + (latest_release.improve|length if latest_release.improve else 0) + (latest_release.fix|length if latest_release.fix else 0) %}
|
||||
{% if total_changes > 1 %}
|
||||
<span style="color: var(--primary); font-weight: 500;"> · i {{ total_changes - 1 }} {{ 'inna zmiana' if total_changes - 1 == 1 else ('inne zmiany' if total_changes - 1 < 5 else 'innych zmian') }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<span style="color: var(--primary); font-weight: 500; font-size: var(--font-size-sm); white-space: nowrap; flex-shrink: 0;">Zobacz wszystko →</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- Event Banners - Najbliższe wydarzenia -->
|
||||
{% if upcoming_events %}
|
||||
<div class="events-row" data-animate="fadeIn">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user