fix(homepage): restore events filtering — add events-row class, limit=2
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

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-04-06 19:30:04 +02:00
parent 42ba74b205
commit f934df3bb4

View File

@ -1107,7 +1107,7 @@
<div class="homepage-grid" data-animate="fadeIn">
<!-- LEFT COLUMN: 2 Events -->
<div style="display: flex; flex-direction: column; gap: var(--spacing-md);">
<div class="events-row" style="display: flex; flex-direction: column; gap: var(--spacing-md);">
{% if upcoming_events %}
{% for ue in upcoming_events[:2] %}
{% set ev = ue.event %}
@ -1493,15 +1493,15 @@
document.querySelectorAll('.events-filter-btn').forEach(b => b.classList.remove('active'));
btn.classList.add('active');
fetch('/api/upcoming-events?filter=' + type + '&limit=6')
fetch('/api/upcoming-events?filter=' + type + '&limit=2')
.then(r => r.json())
.then(data => {
const row = document.querySelector('.events-row');
if (!data.events || data.events.length === 0) {
row.innerHTML = '<div style="grid-column:1/-1; text-align:center; padding:var(--spacing-xl); color:rgba(255,255,255,0.7);">Brak wydarzeń w tej kategorii</div>';
row.innerHTML = '<div style="text-align:center; padding:var(--spacing-xl); color:var(--text-muted);">Brak wydarzeń w tej kategorii</div>';
return;
}
row.innerHTML = data.events.map((ev, i) => {
row.innerHTML = data.events.slice(0, 2).map((ev, i) => {
let typeCls = ev.is_external ? 'external' : 'norda';
let sourceBadge = ev.is_external && ev.external_source
? '<span style="display:inline-block;background:rgba(255,255,255,0.2);color:#fff;font-size:10px;padding:2px 6px;border-radius:4px;font-weight:600;vertical-align:middle;margin-left:6px;">🌐 ' + ev.external_source + '</span>'