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
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:
parent
42ba74b205
commit
f934df3bb4
@ -1107,7 +1107,7 @@
|
|||||||
<div class="homepage-grid" data-animate="fadeIn">
|
<div class="homepage-grid" data-animate="fadeIn">
|
||||||
|
|
||||||
<!-- LEFT COLUMN: 2 Events -->
|
<!-- 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 %}
|
{% if upcoming_events %}
|
||||||
{% for ue in upcoming_events[:2] %}
|
{% for ue in upcoming_events[:2] %}
|
||||||
{% set ev = ue.event %}
|
{% set ev = ue.event %}
|
||||||
@ -1493,15 +1493,15 @@
|
|||||||
document.querySelectorAll('.events-filter-btn').forEach(b => b.classList.remove('active'));
|
document.querySelectorAll('.events-filter-btn').forEach(b => b.classList.remove('active'));
|
||||||
btn.classList.add('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(r => r.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
const row = document.querySelector('.events-row');
|
const row = document.querySelector('.events-row');
|
||||||
if (!data.events || data.events.length === 0) {
|
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;
|
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 typeCls = ev.is_external ? 'external' : 'norda';
|
||||||
let sourceBadge = ev.is_external && ev.external_source
|
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>'
|
? '<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>'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user