Files
cwsvJudo/homepage/participo/infoZettel.php
marko f28fa7b51b WIP: bring participo back - consistent use of bootstrap - formatting -
phpstan level 0 error free - fixes for kyu subpage - move mams into
participo framework - remove legacy `lib/db.php` usage - add attributer
admin function - add newsposter - fixing apiKey creation
2025-11-19 12:24:38 +01:00

125 lines
3.6 KiB
PHP

<?php
require_once "bootstrap.php";
require_once "participoLib/participo.php";
// @todo Legacy libs! Remove!
require_once "./lib/api.php";
require_once "parsedown/Parsedown.php";
require_once "spyc/Spyc.php";
participo::authentificate();
// get a list of all infoZettel
$fileList = glob(join("/", [$BASE_PATH, "infoZettel", "*.md"]));
rsort($fileList);
$years = [];
foreach ($fileList as $file) {
$years[] = (int) substr(basename($file), 0, 4);
}
$years = array_unique($years);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<?php readfile("./shared/imports.php"); ?>
<!-- adjustments to parsedowncards (smaller headings) -->
<link rel="stylesheet" href="css/parsedownCard.css">
<!-- inits for the materializeCss -->
<script>
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.sidenav');
var instances = M.Sidenav.init(elems, {
// specify options here
});
});
</script>
<title>InfoZettel</title>
<meta name="description" content="InfoZettel der Judoka des Chemnitzer WSV">
<link rel="icon" href="/ressourcen/graphiken/icons/cwsv.ico" />
<link rel="apple-touch-icon" href="/ressourcen/graphiken/logos/favIcons/apple-touch-icon.png">
</head>
<body>
<header>
<nav class="indigo darken-4">cwsvJudo InfoZettel<a class="right top-nav sidenav-trigger waves-effect waves-light hide-on-large-only" href="#" data-target="nav-mobile">
<i class="material-icons">menu</i>
</a></nav>
<ul class="sidenav sidenav-fixed sidenav-close" id="nav-mobile">
<li class="logo">
<a style="height:auto;" class="brand-logo" id="logo-container" href="/participo/">
<img style="max-width:100%;height:12vh;" class="responsive-img" src="/ressourcen/graphiken/logos/cwsvJudoLogoWappen.256w.png" />
</a>
</li>
<li><?php require_once "sidenav/loginStatus.php"; ?></li>
<li class="bold">
<a class="waves-effect waves-teal left-align" href="/participo">zurück</a>
</li>
<?php foreach ($years as $year) { ?>
<li class="bold">
<a class="waves-effect waves-teal right-align" href="#infoZettel-<?php echo $year; ?>"><?php echo $year; ?></a>
</li>
<?php } ?>
</ul>
</header>
<main>
<!-- List of Infos -->
<div class="row" id="infoList">
<?php
if (sizeof($fileList) > 0) {
$currentYear = (int) substr(basename($fileList[0]), 0, 4);
echo '<h2 id="infoZettel-' . $currentYear . '">' . $currentYear . "</h2>";
} else {
echo "<h2>Seltsam! Keine Infozettel gefunden...</h2>";
}
foreach ($fileList as $file) {
$thisYear = (int) substr(basename($file), 0, 4);
if ($thisYear != $currentYear) {
$currentYear = $thisYear;
echo '<h2 id="infoZettel-' .
$currentYear .
'">' .
$currentYear .
"</h2>";
}
// get a list of all infoZettel
$fileList = glob($basePath . "/infoZettel/*.md");
rsort($fileList);
foreach ($fileList as $file) {
$thisYear = (int) substr(basename($file), 0, 4);
if ($thisYear != $currentYear) {
$currentYear = $thisYear;
echo '<h2 id="infoZettel-' .
$currentYear .
'">' .
$currentYear .
"</h2>";
}
$infoZettel = loadMarkdownFile($file);
echo AppCard::fromArray([
"title" => $infoZettel["yaml"]["title"],
"description" => Parsedown::instance()->text($infoZettel["mdText"]),
])->htmlCode(["extraClass" => "parsedownCard"]);
}
?>
</div><!-- End of Infos -->
</main>
<?php
}
?>
</body>
</html>