/
TorX
/
rasp
Обзор
Документация
Войти
/
TorX
/
rasp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
index.php
77 строк
3 KB
tormovies
Put export filters and copy/download actions on one adaptive toolbar row.
07 авг 2026, 17:56
07 авг 2026, 17:56
efe5f2f
Код
Авторство
О чём код?
<?php declare(strict_types=1); require_once __DIR__ . '/includes/queries.php'; require_once __DIR__ . '/includes/layout.php'; $now = new DateTime('today'); $year = isset($_GET['year']) ? (int) $_GET['year'] : (int) $now->format('Y'); $month = isset($_GET['month']) ? (int) $_GET['month'] : (int) $now->format('n'); if ($month < 1) { $month = 12; $year--; } if ($month > 12) { $month = 1; $year++; } $prevMonth = $month === 1 ? 12 : $month - 1; $prevYear = $month === 1 ? $year - 1 : $year; $nextMonth = $month === 12 ? 1 : $month + 1; $nextYear = $month === 12 ? $year + 1 : $year; $pitch = $_GET['pitch'] ?? 'all'; if (!in_array($pitch, ['all', 'with', 'without'], true)) { $pitch = 'all'; } $releases = get_month_releases($year, $month); $upcoming = list_upcoming(); $exportText = export_text(list_upcoming($pitch)); render_header('Расписание релизов'); ?> <div class="row"> <div> <p class="eyebrow">Публичный календарь</p> <h1><a href="/" style="text-decoration:none">Расписание релизов</a></h1> <p class="muted">Релизы по датам. Галочка — есть питчинг.</p> </div> <a class="btn btn-secondary" href="/admin/">Админка</a> </div> <div class="stack"> <?php render_calendar( $year, $month, $releases, '/?year=' . $prevYear . '&month=' . $prevMonth, '/?year=' . $nextYear . '&month=' . $nextMonth, format_month_title($year, $month) ); ?> <section> <h2>Предстоящие релизы</h2> <?php render_release_list($upcoming, false, 'Нет релизов от сегодня и дальше'); ?> </section> <section class="stack" style="border-top:1px solid var(--line);padding-top:1.5rem"> <div> <h2>Экспорт предстоящих релизов</h2> <p class="muted">От сегодня и дальше · формат как в админке</p> </div> <div class="export-toolbar" id="export"> <div class="filters"> <a class="<?= $pitch === 'all' ? 'active' : '' ?>" href="/?year=<?= $year ?>&month=<?= $month ?>&pitch=all#export">Все</a> <a class="<?= $pitch === 'with' ? 'active' : '' ?>" href="/?year=<?= $year ?>&month=<?= $month ?>&pitch=with#export">С питчингом</a> <a class="<?= $pitch === 'without' ? 'active' : '' ?>" href="/?year=<?= $year ?>&month=<?= $month ?>&pitch=without#export">Без питчинга</a> </div> <div class="actions"> <button class="btn btn-primary" type="button" onclick="navigator.clipboard.writeText(document.getElementById('export-text').innerText)">Копировать</button> <a class="btn btn-secondary" href="/export.php?pitch=<?= e($pitch) ?>">Скачать .txt</a> </div> </div> <div class="panel"> <pre class="export" id="export-text"><?= $exportText !== '' ? e($exportText) : 'Нет релизов для выбранного фильтра.' ?></pre> </div> </section> </div> <?php render_footer();