fix: show newest ZOPK facts in homepage widget with Polish labels
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
- Change from random() to published_at DESC — show newest, most relevant facts instead of random old ones - Translate fact type labels to Polish (investment→inwestycja, decision→decyzja, event→wydarzenie, etc.) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
09f176cf1a
commit
f414da2423
@ -128,14 +128,15 @@ def index():
|
||||
# Backward compat — next_event used by other parts
|
||||
next_event = upcoming_events[0]['event'] if upcoming_events else None
|
||||
|
||||
# ZOPK Knowledge facts — widget dla zalogowanych
|
||||
# ZOPK Knowledge facts — widget dla zalogowanych (najnowsze i najistotniejsze)
|
||||
zopk_facts = []
|
||||
if current_user.is_authenticated:
|
||||
try:
|
||||
from database import ZOPKKnowledgeFact, ZOPKNews
|
||||
zopk_facts = db.query(ZOPKKnowledgeFact).join(ZOPKNews).filter(
|
||||
ZOPKKnowledgeFact.confidence_score >= 0.5
|
||||
).order_by(func.random()).limit(3).all()
|
||||
ZOPKKnowledgeFact.confidence_score >= 0.5,
|
||||
ZOPKNews.published_at.isnot(None)
|
||||
).order_by(ZOPKNews.published_at.desc()).limit(3).all()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
@ -1068,7 +1068,7 @@
|
||||
{% elif fact.fact_type == 'decision' %}background: rgba(245,158,11,0.3);
|
||||
{% elif fact.fact_type == 'milestone' %}background: rgba(139,92,246,0.3);
|
||||
{% else %}background: rgba(255,255,255,0.2);{% endif %}">
|
||||
{{ fact.fact_type or 'fakt' }}
|
||||
{% if fact.fact_type == 'investment' %}inwestycja{% elif fact.fact_type == 'decision' %}decyzja{% elif fact.fact_type == 'event' %}wydarzenie{% elif fact.fact_type == 'milestone' %}kamień milowy{% elif fact.fact_type == 'statistic' %}dane{% elif fact.fact_type == 'partnership' %}współpraca{% elif fact.fact_type == 'project' %}projekt{% else %}fakt{% endif %}
|
||||
</span>
|
||||
<p style="font-size: var(--font-size-sm); line-height: 1.5; margin: 0; opacity: 0.95;">
|
||||
{{ fact.full_text[:200] }}{% if fact.full_text|length > 200 %}...{% endif %}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user