Files
2026-07-09 15:03:21 +02:00

135 lines
3.9 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
require_once __DIR__ . '/../src/Services/LogoService.php';
$isFavoritesView = ($view ?? '') === 'favorites';
?>
<section class="page-heading">
<h2><?= $isFavoritesView ? 'Favoriten' : 'Jetzt läuft' ?></h2>
<p>
<?= $isFavoritesView
? 'Aktuelle Sendungen auf deinen Favoriten-Sendern.'
: 'Aktuelle Sendungen auf deinen aktivierten Sendern.' ?>
</p>
</section>
<?php if (!$currentProgrammes): ?>
<div class="empty">
<?= $isFavoritesView
? 'Aktuell läuft auf deinen Favoriten keine Sendung.'
: 'Aktuell wurden keine laufenden Sendungen gefunden.' ?>
</div>
<?php endif; ?>
<div class="now-grid now-grid-enhanced" <?= !$isFavoritesView ? 'data-live-now-grid' : '' ?>>
<?php foreach ($currentProgrammes as $item): ?>
<?php
$logoUrl = LogoService::getLogoUrl($item['channel_id']);
$badges = [];
if (!empty($item['category'])) {
$badges[] = ($item['genre_icon'] ?? '▶') . ' ' . $item['category'];
}
if (!empty($item['year'])) {
$badges[] = $item['year'];
}
if (!empty($item['rating'])) {
$badges[] = 'FSK ' . $item['rating'];
}
if (!empty($item['quality'])) {
$badges[] = $item['quality'];
}
?>
<article class="now-card now-card-enhanced">
<div class="now-card-top">
<div class="now-channel-logo-wrap">
<img class="now-channel-logo"
src=" <?= htmlspecialchars($logoUrl) ?>"
alt="">
</div>
<div class="now-channel-info">
<div class="now-channel-name">
<?= htmlspecialchars($item['channel_name']) ?>
<?php if ($item['favorite']): ?>
<span class="favorite-star">⭐ </span>
<?php endif; ?>
</div>
<div class="now-channel-number">
Kanal <?= (int)$item['channel_number'] ?>
</div>
<div class="now-time">
<?= date('H:i', $item['start']) ?>
<?= date('H:i', $item['stop']) ?>
</div>
</div>
</div>
<h3><?= htmlspecialchars($item['title']) ?></h3>
<?php if ($item['subtitle']): ?>
<div class="now-subtitle"><?= htmlspecialchars($item['subtitle']) ?></div>
<?php endif; ?>
<?php if ($badges): ?>
<div class="now-badges">
<?php foreach ($badges as $badge): ?>
<span class="now-badge"><?= htmlspecialchars($badge) ?></span>
<?php endforeach; ?>
</div>
<?php endif; ?>
<div class="progress-wrap">
<div class="progress-meta">
<span><?= (int)$item['percent'] ?>%</span>
<span>noch <?= (int)$item['remaining_minutes'] ?> Minuten</span>
</div>
<div class="progress-bar">
<div class="progress-fill" style="width: <?= (int)$item['percent'] ?>%"></div>
</div>
</div>
<?php if (!empty($item['next_title'])): ?>
<div class="now-next">
<div class="now-next-label">Danach</div>
<div class="now-next-programme">
<div class="now-next-time">
<?= !empty($item['next_start']) ? date('H:i', $item['next_start']) : '' ?>
</div>
<div class="now-next-info">
<strong><?= htmlspecialchars($item['next_title']) ?></strong>
<?php if (!empty($item['next_subtitle'])): ?>
<div class="now-next-subtitle">
<?= htmlspecialchars($item['next_subtitle']) ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php if ($item['description']): ?>
<p class="now-desc"><?= htmlspecialchars($item['description']) ?></p>
<?php endif; ?>
</article>
<?php endforeach; ?>
</div>