added 404 page, added title+description to pages

This commit is contained in:
marko
2025-08-04 16:47:14 +02:00
parent 587685c0b3
commit 8d42144107
18 changed files with 1083 additions and 1216 deletions

View File

@@ -20,14 +20,9 @@ all: build/css/cwsvJudo.css images
make -j graphiken
make build/css/cwsvJudo.css
# minimizing wallpaper sizes
build/graphiken/wallpapers/%.jpg: graphiken/wallpapers/%.jpg
mkdir -p build/graphiken/wallpapers
# guetzli $^ $@
$(LN) $^ $@
build/graphiken/wallpapers/%.svg: graphiken/wallpapers/%.svg
mkdir -p build/graphiken/wallpapers
$(LN) $^ $@
.PHONY: wallpapers
wallpapers:
find graphiken/wallpapers/ -name *.jpg -exec ./scripts/mk-wallpaper {} \;
.PHONY: images
images: $(wallpapers)
@@ -148,7 +143,7 @@ dist: all
find ./build/graphiken/cwsvJudoLogoWappen -type f -exec $(LN) {} $(distDir)/httpdocs/ressourcen/graphiken/logos \;
# - wallpapers
mkdir -p $(distDir)/httpdocs/ressourcen/graphiken/wallpapers
find ./build/graphiken/wallpapers -type f -exec $(LN) {} $(distDir)/httpdocs/ressourcen/graphiken/wallpapers \;
find ./build/graphics/wallpapers -type d -exec cp -r {} $(distDir)/httpdocs/ressourcen/graphiken/wallpapers \;
# - icons
mkdir -p $(distDir)/httpdocs/ressourcen/graphiken/icons
find ./graphiken/icons -type f -exec $(LN) {} $(distDir)/httpdocs/ressourcen/graphiken/icons \;
@@ -180,7 +175,7 @@ dist: all
$(LN) ./src/htaccess/heliohost/pages/responsive/.htaccess $(distDir)/httpdocs/pages/responsive/.htaccess
# config files
$(LN) ./configs/heliohost/pages.config.inc.php $(distDir)/httpdocs/pages/responsive/config.php
$(LN) ./configs/localDocker/pages.config.inc.php $(distDir)/httpdocs/pages/responsive/config.php
mkdir -p $(distDir)/.local
$(LN) configs/heliohost/config.json $(distDir)/.local/config.json

View File

@@ -4,6 +4,12 @@ FROM php:8.2-apache
# startup scripts for the image
# - docker-php-ext-install -- install helper script from PHP
RUN docker-php-ext-install pdo pdo_mysql
# install aditional php extensions
# - international time
RUN apt-get -y update \
&& apt-get install -y libicu-dev \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl
# install and add xdebug extension
# @todo What is pecl?

View File

@@ -0,0 +1,25 @@
<?php
/// Die Basisdomain, unter der die Hauptseite zu erreichen ist
$baseDomain = "localhost";
/// Subdomain, unter dem dieses Verzeichnis zu finden ist (falls der Fall gegeben ist)
$subDomain = "";
/// homeverzeichnis auf dem server
$home = "/home/cwsvjudo.de";
/// Basis(/Root)-Verzeichnis auf dem Server (für Dateizugriffe, insbesondere phpIncludes)
/// (ist eigentlich das serve verzeichnis, aka www-data)
$basePath = "/var/www/html";
/// Url zum Zugriff auf "shared Data" unter der Hauptadresse
$baseUrl = "http://" . $baseDomain;
/// Die kanonische Url dieses Verzeichnisses (unter welcher
/// Domainadresse die Seiten dieses Verzeichnisses bevorzugt zu
/// erreichen seien sollen, also entweder eine SubdomainUrl, oder die
/// baseUrl mit dem Verzeichnis angehängt)
/// Achtung: Gedacht für eine einheitliche Bezeichnung bei internem
/// Verlinken. Der canonicalLink im Header ist bei ampSeiten nicht die
/// eigene Adresse, sondern die (kanonische) Adresse der "normalen"
/// Version der Seite.
$canonicalBaseUrl =
"https://" . (empty($subDomain) ? "" : $subDomain . ".") . $baseDomain;
?>

View File

@@ -6,6 +6,7 @@ services:
build:
context: .
dockerfile: PHP.dockerfile
network: host
ports:
# this line maps your pc port to the container port
- "8080:80"

View File

@@ -8,4 +8,5 @@ set ftp:ssl-allow off
# upload:
mirror --verbose --continue --parallel=8 --reverse ./build/dist/heliohost /
put configs/heliohost/db.config.php -o /.local/db.config.php
put configs/heliohost/pages.config.inc.php -o httpdocs/pages/responsive/config.php
# exit

File diff suppressed because it is too large Load Diff

View File

@@ -5,14 +5,14 @@
}
@font-face {
font-family: 'Material Icons';
font-family: "Material Icons";
font-style: normal;
font-weight: 400;
src: url(/ressourcen/fonts/MaterialIcons-Regular.ttf);
}
.material-icons {
font-family: 'Material Icons';
font-family: "Material Icons";
font-weight: normal;
font-style: normal;
font-size: 1em;
@@ -23,7 +23,31 @@
white-space: nowrap;
word-wrap: normal;
direction: ltr;
font-feature-settings: 'liga';
font-feature-settings: "liga";
}
/* fallback */
@font-face {
font-family: "Material Symbols Outlined";
font-style: normal;
font-weight: 400;
src: url(ressourcen/fonts/MaterialIconsOutlined-Regular.otf);
}
.material-symbols-outlined {
font-family: "Material Symbols Outlined";
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-moz-font-feature-settings: "liga";
-moz-osx-font-smoothing: grayscale;
}
/* responsive font sizes */

View File

@@ -0,0 +1,680 @@
.wkKalender {
width: 100%;
max-width: 100%;
/* background-color: #FFAE00; */
margin-bottom: 0;
}
.wkKalender > thead,
.wkKalender > tfoot {
display: none;
}
.wkKalender > tbody {
display: block;
}
.wkKalender > tbody > tr:empty,
.wkKalender > tbody > tr > th:empty {
display: none;
}
.wkKalender > tbody > tr {
display: block;
border: 1px solid #e0e0e0;
border-radius: 2px;
margin-bottom: 1.6rem;
}
.wkKalender th {
display: block;
background-color: #666;
color: #fff;
}
.wkKalender > tbody > tr > td {
display: block;
vertical-align: middle;
text-align: right;
}
.wkKalender > tbody > tr > td:nth-child(odd) {
/* background-color: #FF8100; */
}
.wkKalender > tbody > tr > td[data-title]:before {
content: attr(data-title);
float: left;
font-size: inherit;
font-weight: 400;
color: #757575;
}
.kalenderDatum {
display: flex;
justify-content: flex-end;
}
.kalenderDatum > span:nth-child(4)::after {
content: ", d. ";
white-space: pre;
}
.kalenderDatum > span:nth-child(4) {
order: 1;
}
.kalenderDatum > span:nth-child(3)::after {
content: ". ";
white-space: pre;
}
.kalenderDatum > span:nth-child(3) {
order: 2;
}
.kalenderDatum > span:nth-child(2)::after {
content: " ";
white-space: pre;
}
.kalenderDatum > span:nth-child(2) {
order: 3;
}
.kalenderDatum > span:nth-child(1) {
order: 4;
}
@media screen and (min-width: 1280px) {
.wkKalender > thead {
display: table-header-group;
width: 100%;
}
.wkKalender > tbody > tr {
display: table-row;
width: 100%;
}
.wkKalender > tbody > tr > td {
display: table-cell;
}
.wkKalender > tbody > tr > td[data-title]:before {
display: none;
content: "";
}
.wkKalender > tbody {
display: table-row-group;
}
.wkKalender > tfoot {
display: table-footer-group;
}
.wkKalender > tbody > tr {
border: 1px solid #e0e0e0;
border-radius: 2px;
margin-bottom: 1.6rem;
}
.wkKalender > tbody > tr > td {
vertical-align: middle;
text-align: initial;
}
.wkKalender > tbody > tr:nth-child(odd) {
/* background-color: #FF8100; */
}
.wkKalender > tbody > tr > td:nth-child(odd) {
background-color: inherit;
}
.wkKalender > tbody > tr > td[data-title]:before {
content: initial;
}
.wkKalender tr,
th,
td {
border: 1px solid black;
}
.wkKalender th {
display: table-cell;
}
.kalenderDatum {
flex-direction: column;
align-items: center;
}
.kalenderDatum > span:nth-child(4)::after {
content: initial;
white-space: initial;
}
.kalenderDatum > span:nth-child(4) {
display: none;
}
.kalenderDatum > span:nth-child(3)::after {
content: ".";
white-space: pre;
}
.kalenderDatum > span:nth-child(2)::after {
content: initial;
white-space: initial;
}
/* https://codepen.io/denilsonsa/pen/Etrba */
/****************************************/
/* Styling rules, such as font and colors */
.date-as-calendar {
font-variant: normal;
font-style: normal;
font-weight: normal;
font-family: "Helvetica", "Arial", sans-serif;
/* It seems vertical-align: baseline does not work correctly with display: inline-flex. */
vertical-align: top;
/* margin: 1ex; */
color: black;
background: white;
background: linear-gradient(to bottom right, #fff 0%, #eee 100%);
border: 1px solid #888;
border-radius: 3px;
overflow: hidden;
box-shadow: 2px 2px 2px -2px black;
}
.date-as-calendar .weekday,
.date-as-calendar .day,
.date-as-calendar .month,
.date-as-calendar .year {
text-align: center;
line-height: 1;
}
.date-as-calendar .month {
font-family: "Oswald", sans-serif;
text-transform: uppercase;
background: #b11;
background: linear-gradient(to bottom right, #d66 0%, #a00 100%);
color: white;
}
/****************************************/
/* Layout rules using position: absolute and pixels. */
.position-pixels.date-as-calendar {
display: inline-block;
position: relative;
width: 64px;
height: 64px;
}
.position-pixels.date-as-calendar .weekday,
.position-pixels.date-as-calendar .day,
.position-pixels.date-as-calendar .month,
.position-pixels.date-as-calendar .year {
display: block;
position: absolute;
left: 0;
right: 0;
width: 100%;
height: 1em;
}
.position-pixels.date-as-calendar .month {
top: 0px;
font-size: 12px;
padding: 2px 0;
}
.position-pixels.date-as-calendar .weekday {
top: 16px;
font-size: 10px;
}
.position-pixels.date-as-calendar .day {
top: 26px;
font-size: 24px;
}
.position-pixels.date-as-calendar .year {
top: 50px;
font-size: 14px;
}
/****************************************/
/* Layout rules using position: absolute and relative dimensions using em. */
.position-em.date-as-calendar {
display: inline-block;
position: relative;
width: 4em;
height: 4em;
}
.position-em.date-as-calendar .weekday,
.position-em.date-as-calendar .day,
.position-em.date-as-calendar .month,
.position-em.date-as-calendar .year {
display: block;
position: absolute;
left: 0;
right: 0;
width: 100%;
height: 1em;
}
.position-em.date-as-calendar .month {
top: 0px;
font-size: 0.75em;
padding: 0.1em 0;
}
.position-em.date-as-calendar .weekday {
top: 1.6em;
font-size: 0.6125em;
}
.position-em.date-as-calendar .day {
top: 1.1em;
font-size: 1.5em;
}
.position-em.date-as-calendar .year {
bottom: 0px;
font-size: 0.8775em;
}
/****************************************/
/* Layout rules using display: inline-flex and relative dimensions using em. */
.inline-flex.date-as-calendar {
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: space-between;
width: 4em;
height: 4em;
}
.inline-flex.date-as-calendar .weekday,
.inline-flex.date-as-calendar .day,
.inline-flex.date-as-calendar .month,
.inline-flex.date-as-calendar .year {
display: block;
flex: 1 1 auto;
}
.inline-flex.date-as-calendar .month {
order: 1;
font-size: 0.75em;
padding: 0.1em 0;
}
.inline-flex.date-as-calendar .weekday {
order: 2;
font-size: 0.6125em;
}
.inline-flex.date-as-calendar .day {
order: 3;
font-size: 1.5em;
}
.inline-flex.date-as-calendar .year {
order: 4;
font-size: 0.8775em;
}
/****************************************/
/* Multiple sizes. */
.date-as-calendar.size0_5x {
font-size: 8px;
}
.date-as-calendar.size0_75x {
font-size: 12px;
}
.date-as-calendar.size1x {
font-size: 16px;
}
.date-as-calendar.size1_25x {
font-size: 20px;
}
.date-as-calendar.size1_5x {
font-size: 24px;
}
.date-as-calendar.size1_75x {
font-size: 28px;
}
.date-as-calendar.size2x {
font-size: 32px;
}
.date-as-calendar.size3x {
font-size: 48px;
}
}
/*abgeschaut*/
.shadow-z-1 {
box-shadow:
0 1px 3px 0 rgba(0, 0, 0, 0.12),
0 1px 2px 0 rgba(0, 0, 0, 0.24);
}
/*
* Mit Text overlay-tes Bild
*/
.textoverlayedImage {
position: relative;
display: table;
}
.textoverlayedImage > img {
width: 100%;
height: auto;
}
.textoverlayedImage > div {
z-index: 99;
width: fit-content;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.textoverlayedImage > div > p {
text-align: center;
color: white;
font-weight: lighter;
line-height: 2;
padding: 0 10%;
}
/*
* Die Galerie der Galerien in der wkInfoBox
*/
.wkBoxMediaGallery {
display: flex;
flex-flow: row wrap;
justify-content: space-around;
align-items: center;
}
.wkBoxMediaGallery > * {
flex-basis: 50%;
padding: 5%;
}
/*
* Tooltipps
*/
/* Tooltip container */
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
}
/* Tooltip text */
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: black;
color: #fff;
text-align: center;
padding: 5px 0;
border-radius: 6px;
/* Position the tooltip text - see examples below! */
position: absolute;
z-index: 1;
}
/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
visibility: visible;
}
.wkMonthBar {
display: flex;
flex-flow: wrap;
justify-content: space-evenly;
}
.wkMonthBar > a {
text-align: center;
width: 30%;
display: inline-block;
padding: 0.25em 0.25em 0.25em 0.25em;
margin: 0.25em 0.25em 0.25em 0.25em;
box-shadow: 0.1em 0.1em 0.05em grey;
/* background-color: #FF8100; */
border-radius: 0.5em;
}
@media print {
.wkMonthBar {
display: none;
}
.wkKalender > thead {
display: table-header-group;
width: 100%;
}
.wkKalender > tbody > tr {
display: table-row;
width: 100%;
}
.wkKalender > tbody > tr > td {
display: table-cell;
}
/*qrCode*/
.wkKalender > tbody > tr > td > img {
width: 1cm;
}
.wkKalender > tbody > tr > td:nth-of-type(5) > a {
display: none;
}
.wkKalender > tbody > tr > td[data-title]:before {
display: none;
content: "";
}
.wkKalender > tbody {
display: table-row-group;
}
.wkKalender > tfoot {
display: table-footer-group;
}
.wkKalender > tbody > tr {
border: 1px solid #e0e0e0;
border-radius: 2px;
margin-bottom: 1.6rem;
}
.wkKalender > tbody > tr > td {
vertical-align: middle;
text-align: initial;
}
.wkKalender > tbody > tr:nth-child(odd) {
/* background-color: #FF8100; */
}
.wkKalender > tbody > tr > td:nth-child(odd) {
background-color: inherit;
}
.wkKalender > tbody > tr > td[data-title]:before {
content: initial;
}
.wkKalender tr,
th,
td {
border: 1px solid black;
}
.wkKalender th {
display: table-cell;
}
.kalenderDatum {
flex-direction: column;
align-items: center;
}
.kalenderDatum > span:nth-child(4)::after {
content: initial;
white-space: initial;
}
.kalenderDatum > span:nth-child(4) {
display: none;
}
.kalenderDatum > span:nth-child(3)::after {
content: ".";
white-space: pre;
}
.kalenderDatum > span:nth-child(2)::after {
content: initial;
white-space: initial;
}
/* https://codepen.io/denilsonsa/pen/Etrba */
/****************************************/
/* Styling rules, such as font and colors */
.date-as-calendar {
font-variant: normal;
font-style: normal;
font-weight: normal;
font-family: "Helvetica", "Arial", sans-serif;
/* It seems vertical-align: baseline does not work correctly with display: inline-flex. */
vertical-align: top;
/* margin: 1ex; */
color: black;
background: white;
background: linear-gradient(to bottom right, #fff 0%, #eee 100%);
border: 1px solid #888;
border-radius: 3px;
overflow: hidden;
box-shadow: 2px 2px 2px -2px black;
}
.date-as-calendar .weekday,
.date-as-calendar .day,
.date-as-calendar .month,
.date-as-calendar .year {
text-align: center;
line-height: 1;
}
.date-as-calendar .month {
font-family: "Oswald", sans-serif;
text-transform: uppercase;
background: #b11;
background: linear-gradient(to bottom right, #d66 0%, #a00 100%);
color: white;
}
/****************************************/
/* Layout rules using position: absolute and pixels. */
.position-pixels.date-as-calendar {
display: inline-block;
position: relative;
width: 64px;
height: 64px;
}
.position-pixels.date-as-calendar .weekday,
.position-pixels.date-as-calendar .day,
.position-pixels.date-as-calendar .month,
.position-pixels.date-as-calendar .year {
display: block;
position: absolute;
left: 0;
right: 0;
width: 100%;
height: 1em;
}
.position-pixels.date-as-calendar .month {
top: 0px;
font-size: 12px;
padding: 2px 0;
}
.position-pixels.date-as-calendar .weekday {
top: 16px;
font-size: 10px;
}
.position-pixels.date-as-calendar .day {
top: 26px;
font-size: 24px;
}
.position-pixels.date-as-calendar .year {
top: 50px;
font-size: 14px;
}
/****************************************/
/* Layout rules using position: absolute and relative dimensions using em. */
.position-em.date-as-calendar {
display: inline-block;
position: relative;
width: 4em;
height: 4em;
}
.position-em.date-as-calendar .weekday,
.position-em.date-as-calendar .day,
.position-em.date-as-calendar .month,
.position-em.date-as-calendar .year {
display: block;
position: absolute;
left: 0;
right: 0;
width: 100%;
height: 1em;
}
.position-em.date-as-calendar .month {
top: 0px;
font-size: 0.75em;
padding: 0.1em 0;
}
.position-em.date-as-calendar .weekday {
top: 1.6em;
font-size: 0.6125em;
}
.position-em.date-as-calendar .day {
top: 1.1em;
font-size: 1.5em;
}
.position-em.date-as-calendar .year {
bottom: 0px;
font-size: 0.8775em;
}
/****************************************/
/* Layout rules using display: inline-flex and relative dimensions using em. */
.inline-flex.date-as-calendar {
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: space-between;
width: 4em;
height: 4em;
}
.inline-flex.date-as-calendar .weekday,
.inline-flex.date-as-calendar .day,
.inline-flex.date-as-calendar .month,
.inline-flex.date-as-calendar .year {
display: block;
flex: 1 1 auto;
}
.inline-flex.date-as-calendar .month {
order: 1;
font-size: 0.75em;
padding: 0.1em 0;
}
.inline-flex.date-as-calendar .weekday {
order: 2;
font-size: 0.6125em;
}
.inline-flex.date-as-calendar .day {
order: 3;
font-size: 1.5em;
}
.inline-flex.date-as-calendar .year {
order: 4;
font-size: 0.8775em;
}
/****************************************/
/* Multiple sizes. */
.date-as-calendar.size0_5x {
font-size: 8px;
}
.date-as-calendar.size0_75x {
font-size: 12px;
}
.date-as-calendar.size1x {
font-size: 16px;
}
.date-as-calendar.size1_25x {
font-size: 20px;
}
.date-as-calendar.size1_5x {
font-size: 24px;
}
.date-as-calendar.size1_75x {
font-size: 28px;
}
.date-as-calendar.size2x {
font-size: 32px;
}
.date-as-calendar.size3x {
font-size: 48px;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -1,3 +1,19 @@
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##
# Auf die Fontdatei wird von der Subdomain aus zugegriffen
# - das gesamte ressourcenVerzeichnis wird auf die Maindomain umgeleitet
# - die mainDomain erlaubt aber anscheinend nicht, das fremde domains bei ihr anfragen startet
@@ -12,6 +28,10 @@
# Url-Rewriting aktivieren
RewriteEngine on
# consequently using the non-www version
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# if the requested resource doesn't exist as ...
# - file or ...
RewriteCond %{REQUEST_FILENAME} !-f
@@ -26,7 +46,7 @@ RewriteCond %{REQUEST_URI} !^/pages/responsive/
# Die angeforderte Ressource (als Datei) ist nicht im Rootverzeichnis
RewriteCond %{REQUEST_FILENAME} !-f
# Die angeforderte Ressource (als Verzeichnis) ist nicht im
# Die angeforderte Ressource (als Verzeichnis) ist nicht im
# Rootverzeichnis
RewriteCond %{REQUEST_FILENAME} !-d

View File

@@ -0,0 +1,7 @@
# 404
Die gesuchte Seite wurde nicht gefunden!
Vielleicht kann die [Startseite][startseite] weiterhelfen.
[startseite]: /

View File

@@ -0,0 +1,24 @@
{
"head": {
"meta": {
"title": "404",
"description": "Fehlerseite"
},
"navTargets": [
{
"url": "training",
"caption": "Training",
"title": "Trainingszeiten und -orte der Judoka des Chemnitzer WSV"
}
]
},
"main": {
"wallpapers": {
"root_path": "/ressourcen/graphiken/wallpapers",
"images": ["osae-komi", "nage", "kata"]
},
"sections": [["404.md"]]
},
"footer": {}
}

View File

@@ -10,6 +10,12 @@ $promos = [
"caption"=> "Dojo",
"target"=> "/training#karten-der-trainingsstätten",
"text"=> "Wegbeschreibung zu unserem Dojo"
],
[
"icon"=> "calendar_today",
"caption"=> "Kalender",
"target"=> "/kalender",
"text"=> "Kalender mit anstehenden Wettkämpfen"
]
];
return CwsvJudo\Promo\promos_html($promos);

View File

@@ -1,5 +1,9 @@
{
"head": {
"meta": {
"title": "Wettkampfkalender der Judoka des Chemnitzer Freizeit- und Wohngebiets&shy;sportvereines e.&#x202f;V.",
"description": "Ein Kalender mit Judo-Wettkampfterminen zur Übersicht"
},
"navTargets": [
{
"url": "training",

View File

@@ -1,6 +0,0 @@
<?php
/**
* home directory on the server
* - meaning the users home directory (aka ~) in the environment, not the directory served via http
*/
$home = "/home/cwsvjudo.de";

View File

@@ -1,9 +1,13 @@
<!DOCTYPE html>
<?php
require_once "bootstrap.php";
$page = $_GET["page"] ?? "index";
if (!is_dir(filename: "{$home}/pages/{$page}")) {
header(header: "HTTP/1.0 404 Not Found");
$page = "404";
}
$meta = json_decode(
json: file_get_contents(filename: $home . "/pages/" . $page . "/meta.json"),
associative: true
@@ -106,53 +110,43 @@ class Main
$wallpaper_root_path = $data["wallpapers"]["root_path"];
return new Main(
sections: array_map(
callback: function ($file) use ($root_path): Section {
return Section::create(
file_names: $file,
root_directory: $root_path
);
},
callback: fn($file) => Section::create(
file_names: $file,
root_directory: $root_path
),
array: $data["sections"]
),
wallpapers: array_map(function ($name) use (
$wallpaper_root_path
): Wallpaper {
return Wallpaper::create($name, $wallpaper_root_path);
}, array: $data["wallpapers"]["images"])
wallpapers: array_map(
fn($name) => Wallpaper::create($name, $wallpaper_root_path),
array: $data["wallpapers"]["images"]
)
);
}
}
class Wallpaper
{
private string $src;
private string $data_src;
private string $src_dir;
public function __construct(string $src, string $data_src)
public function __construct(string $src_dir)
{
$this->src = $src;
$this->data_src = $data_src;
$this->src_dir = $src_dir;
}
public function get_html()
{
return "<img" .
' class="lazyload" ' .
' src="' .
$this->src .
'" ' .
' data-src="' .
$this->data_src .
'" ' .
' alt="Wallpaper"' .
">";
$format = "avif"; //"webp";
$widths = [1200, 600, 992, 1200, 2400];
$src_sets = implode(
", ",
array_map(fn($w) => "{$this->src_dir}/1200.{$format}", $widths)
);
// return "<img class=\"lazyload\" src=\"{$this->src}\" data-src=\"{$this->data_src}\" alt=\"Wallpaper\">";
return "<img data-sizes=\"auto\" src=\"{$this->src_dir}/mosaic.svg\" data-src=\"{$this->src_dir}/1200.{$format}\" data-srcset=\"{$src_sets}\" class=\"lazyload\" alt=\"Wallpaper\">";
}
public static function create(string $name, string $root_path)
{
return new Wallpaper(
src: $root_path . "/" . $name . ".svg",
data_src: $root_path . "/" . $name . ".jpg"
);
return new Wallpaper(src_dir: "{$root_path}/{$name}");
}
}
@@ -184,7 +178,7 @@ class Newsboard
"outCharset" => Newsboard::$config["outCharset"],
]
);
if (!is_null($entries)) {
if ($entries !== null) {
foreach ($entries as $entryData) {
$entry = new \CwsvJudo\News\Entry($entryData);
$html .=
@@ -237,6 +231,7 @@ function mainNavTargets($mainNav)
echo "</ul>";
}
?>
<!DOCTYPE html>
<html lang="de">
<head>
@@ -244,12 +239,17 @@ function mainNavTargets($mainNav)
<!-- - materialize Framework -->
<link type="text/css" rel="stylesheet" href="/ressourcen/css/materialize.min.css" media="screen">
<!-- - cwsvJudo adjustments -->
<!---
<link type="text/css" rel="stylesheet" href="/ressourcen/css/cwsvJudo.css">
--->
<style>
<?php include_once "{$basePath}/ressourcen/css/cwsvJudo.css"; ?>
</style>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Judo im Chemnitzer WSV - Kinder- und Erwachsenentraining</title>
<title><?php echo $meta["head"]["meta"]["title"]; ?></title>
<?php require_once "{$home}/shared/favicon.html.inc"; ?>
<meta name="description" content="<?php echo $meta["head"]["meta"][

View File

@@ -2,6 +2,32 @@
use function CwsvJudo\News\filter_integer_range;
function new_strftime($format, $time)
{
$formatter = new IntlDateFormatter(
"de_DE",
IntlDateFormatter::NONE,
IntlDateFormatter::NONE
);
$formatter->setPattern($format);
return $formatter->format($time);
}
setlocale(LC_ALL, "de_DE@euro", "de_DE", "de", "ge");
function toAscii($str, $replace = [], $delimiter = "-")
{
if (!empty($replace)) {
$str = str_replace((array) $replace, " ", $str);
}
$clean = iconv("UTF-8", "ASCII//TRANSLIT", $str);
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", "", $clean);
$clean = strtolower(trim($clean, "-"));
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);
return $clean;
}
class Kalender
{
private static array $config;
@@ -17,6 +43,205 @@ class Kalender
password: $password
);
}
/// Aus einer Liste von Wettkämpfen den htmlCode der Wettkampftabelle bereit stellen
private static function wkList2htmlWkTable(
$aWkList,
array $someOptions = []
) {
setlocale(LC_ALL, "de_DE.utf8");
// @todo bring back
// require_once $GLOBALS["basePath"] .
// "/ressourcen/phpLib/phpqrcode/qrlib.php";
if (empty($aWkList)) {
return "";
}
$htmlWkTableString = "";
$htmlWkTableString .=
"<table class=\"wkKalender\">" .
"<thead>" .
"<tr>" .
"<th>Datum</th>" .
"<th>Veranstaltung</th>" .
"<th>Ort</th>" .
"<th>Altersklasse(n)</th>" .
// "<th>iCal</th>" .
"</tr>" .
"</thead>" .
"<tbody>";
$lastMonthName = "";
foreach ($aWkList as $wk) {
// Zeichensatzkonvertierung
array_walk($wk, function (&$value, $key) {
$value = iconv("ISO-8859-1", "UTF-8", $value);
});
if (
$lastMonthName !=
new_strftime("MMMM yyyy", strtotime($wk["Datum"]))
) {
$lastMonthName = new_strftime(
"MMMM yyyy",
strtotime($wk["Datum"])
);
$htmlWkTableString .=
"<tr id=\"" .
toAscii(new_strftime("MM yyyy", strtotime($wk["Datum"]))) .
"\"><th colspan=\"5\" >" .
$lastMonthName .
"</th></tr><tr class=\"displayNone\" ><th colspan=\"5\"></th></tr>";
}
// @todo reactivate strctured data
// $wkJsonSd = wkArray2jsonSdEvent($wk);
// schlechter Hack solange die Browser nicht von selbst ordentlich trennen
$wk["Veranstaltung"] = str_replace(
"meisterschaft",
"&shy;meisterschaft",
$wk["Veranstaltung"]
);
$wk["Veranstaltung"] = str_replace(
"turnier",
"&shy;turnier",
$wk["Veranstaltung"]
);
$wk["Veranstaltung"] = str_replace(
"pokal",
"&shy;pokal",
$wk["Veranstaltung"]
);
$wk["Veranstaltung"] = str_replace(
"randori",
"&shy;randori",
$wk["Veranstaltung"]
);
$wk["Veranstaltung"] = str_replace(
"spiele",
"&shy;spiele",
$wk["Veranstaltung"]
);
$wk["Veranstaltung"] = str_replace(
"mannschaft",
"mann&shy;schaft",
$wk["Veranstaltung"]
);
$htmlWkTableString .=
// "<a href=\"http://cwsvjudo.bplaced.net/wkKalender/".$wk['lfdeNr']."/".toAscii( html_entity_decode( $wk['Veranstaltung'] ))."-am-".$wk['Datum']."\"><tr>".
"<tr>" .
// "<script type=\"application/ld+json\">" .
// $wkJsonSd .
// "</script>" .
"<td data-title=\"Datum\" class=\"noWrap\">" .
"<a href=\"{https://cwsvjudo.de/kalender/" .
$wk["lfdeNr"] .
"/" .
toAscii(html_entity_decode($wk["Veranstaltung"])) .
"-am-" .
$wk["Datum"] .
"\">" .
"<time class=\"kalenderDatum\" datetime=" .
$wk["Datum"] .
">" .
"<span>" .
new_strftime("yyyy", strtotime($wk["Datum"])) .
"</span>" .
"<span>" .
new_strftime("MMMM", strtotime($wk["Datum"])) .
"</span>" .
"<span>" .
new_strftime("dd", strtotime($wk["Datum"])) .
"</span>" .
"<span>" .
new_strftime("EEEE", strtotime($wk["Datum"])) .
"</span>" .
"</time>" .
"</a>" .
"</td>" .
"<td data-title=\"Ausschreibung\" class=\"hyphenate\">" .
"<a title=\"Ausschreibung " .
$wk["Veranstaltung"] .
"\" href=\"http://cwsvjudo.bplaced.net" .
$wk["Ausschreibung"] .
"\"><span property=\"name\">" .
$wk["Veranstaltung"] .
"</span></a>" .
"</td>" .
"<td data-title=\"Wegbeschreibung\">" .
"<a title=\"Wegbeschreibung " .
$wk["Veranstaltung"] .
"\" href=\"" .
$wk["Routenplaner"] .
"\"><span>" .
$wk["Ort"] .
"</span></a>" .
"</td>" .
"<td data-title=\"Altersklassen\" class=\"tooltip\">" .
$wk["Altersklassen"] .
// @todo reactivate
// "<span class=\"tooltiptext\">" .
// json_encode(akListString2jgArray($wk["Altersklassen"])) .
// "</span>" .
"</td>" .
// "<td data-title=\"iCal\">" .
// "<a title=\"Termin für " .
// $wk["Veranstaltung"] .
// " in Kalender übernehmen\" href=\"/ressourcen/phpLib/calendar.php?wkID=" .
// $wk["lfdeNr"] .
// "\">iCal</a>" .
// "<img class=\"print-only\" alt=\"http://cwsvjudo.bplaced.net/wkKalender/" .
// $wk["lfdeNr"] .
// "/" .
// toAscii(html_entity_decode($wk["Veranstaltung"])) .
// "-am-" .
// $wk["Datum"] .
// "\" height=\"111\" width=\"111\" src=\"http://cwsvjudo.bplaced.net/pages/responsive/wkQrCode.php?id=" .
// $wk["lfdeNr"] .
// "\" />" .
"</td>" .
"</tr>\n";
}
$htmlWkTableString .=
"</tbody>" .
"<tfoot>" .
"<tr>" .
"<th>Datum</th>" .
"<th>Veranstaltung</th>" .
"<th>Ort</th>" .
"<th>Altersklasse(n)</th>" .
// "<th>iCal</th>" .
"</tr>" .
"</tfoot>" .
"</table>";
// @todo evaluate if it should be reactivate
// Für den Fall einer ampSeite müssen die imgTags angepasst werden
// if (check_for_amp_site()) {
// $htmlWkTableString = str_replace(
// "<img",
// // width und height sind gesetzt
// // @todo: es sollte besser gehen!
// // "<amp-img layout=\"responsive\" width=\"".($aNews['promoImg']['width']?$aNews['promoImg']['width']:"200")."\" height=\"".($aNews['promoImg']['height']?$aNews['promoImg']['height']:"133")."\"",
// "<amp-img layout=\"responsive\" ",
// $htmlWkTableString
// );
// $htmlWkTableString = str_replace(
// "/>",
// "></amp-img>",
// $htmlWkTableString
// );
// }
return $htmlWkTableString;
}
public static function get_html()
{
$db_connection = Kalender::$dbHandle->getDbConnection();
@@ -71,7 +296,7 @@ class Kalender
"<li>Datum: <time datetime=" .
$wk["Datum"] .
">" .
strftime("%a, %d. %B %Y", strtotime($wk["Datum"])) .
new_strftime("EEE, d. MMMM yyyy", strtotime($wk["Datum"])) .
"</time></li>" .
"<li>Altersklassen: " .
$wk["Altersklassen"] .
@@ -193,11 +418,11 @@ class Kalender
$siteData["mainContent"] .= htmlWkMonthBar($ergebnis);
$ergebnis = $db_connection->query($query);
$siteData["mainContent"] .= wkList2htmlWkTable($ergebnis);
$siteData["mainContent"] .= Kalender::wkList2htmlWkTable($ergebnis);
$siteData["mainContent"] .=
"<div class=\"fontSizeXxSmall\">Alle Angaben ohne Gewähr! Fehler und Ergänzungen dürfen gerne gemeldet werden.</div>" .
"<a href=\"/downloads/Ausschreibungen/\">Link zum Archiv mit allen Ausschreibungen</a>.";
"<div class=\"fontSizeXxSmall\">Alle Angaben ohne Gewähr!</div>";
// "<a href=\"/downloads/Ausschreibungen/\">Link zum Archiv mit allen Ausschreibungen</a>.";
/* @todo: Wettkampfselektor wieder ergänzen
<hr />
<div class="wkSelektor">
@@ -230,9 +455,7 @@ class Kalender
// die();
}
//var_dump( $siteData['errors'] );
echo $siteData["mainContent"];
return;
return $siteData["mainContent"];
}
}
@@ -246,10 +469,12 @@ function htmlWkMonthBar($aWkList)
$lastMonthName = "";
foreach ($aWkList as $wk) {
if ($lastMonthName != strftime("%b %Y", strtotime($wk["Datum"]))) {
$lastMonthName = strftime("%b %Y", strtotime($wk["Datum"]));
if (
$lastMonthName != new_strftime("MMM yyyy", strtotime($wk["Datum"]))
) {
$lastMonthName = new_strftime("MMM yyyy", strtotime($wk["Datum"]));
$wkMonthBar .=
"<a href=\"#" .
"<a class=\"btn filled rounded\" href=\"#" .
toAscii($lastMonthName) .
"\">" .
$lastMonthName .

View File

@@ -2,35 +2,35 @@
rel="apple-touch-icon"
sizes="180x180"
href="/ressourcen/graphiken/logos/favIcons/apple-touch-icon.png"
/>
>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/ressourcen/graphiken/logos/favIcons/favicon-32x32.png"
/>
>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/ressourcen/graphiken/logos/favIcons/favicon-16x16.png"
/>
>
<link
type="application/manifest+json"
rel="manifest"
href="/ressourcen/graphiken/logos/favIcons/site.webmanifest"
/>
>
<link
rel="mask-icon"
href="/ressourcen/graphiken/logos/favIcons/safari-pinned-tab.svg"
color="#ff8100"
/>
>
<link
rel="shortcut icon"
href="/ressourcen/graphiken/logos/favIcons/favicon.ico"
/>
>
<meta
name="msapplication-config"
content="/ressourcen/graphiken/logos/favIcons/browserconfig.xml"
/>
<meta name="theme-color" content="#ff8100" />
>
<meta name="theme-color" content="#003450" >