Änderung der Projektstruktur

This commit is contained in:
xoy 2023-04-13 18:44:38 +02:00
parent 7f96ac9b49
commit 33ce7fa41c
43 changed files with 109 additions and 153 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -1,5 +1,5 @@
{ {
"require": { "require": {
"twig/twig": "^3.0" "twig/twig": "^3.5"
} }
} }

2
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "6a6772df2521c6860a448e9115f2793a", "content-hash": "371cfc453eaacca81446019cafa74691",
"packages": [ "packages": [
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",

View File

@ -1,6 +0,0 @@
<nav>
<ul>
<li> <a href="/impressum.html">impressum</a> </li>
<li> <a href="/datenschutz.html">datenschutz</a> </li>
</ul>
</nav>

View File

@ -1,11 +0,0 @@
<nav>
<ul>
<li> <a href="/index.html">home</a> </li>
<li> <a href="/about.html">über uns</a> </li>
<li> <a href="/treff.html">zeiten & location</a> </li>
<li> <a href="/events.html">events</a> </li>
<li> <a href="/kontakt.html">kontakt</a> </li>
<li> <a href="/support.html">support</a> </li>
<li> <a href="/verein.html">verein</a> </li>
</ul>
</nav>

View File

@ -1,12 +1,44 @@
<?php <?php
require_once './vendor/autoload.php';
$loader = new \Twig\Loader\FilesystemLoader('./templates/'); require __DIR__ . '/vendor/autoload.php';
$twig = new \Twig\Environment($loader, [
'cache' => './compilation_cache/',
]);
if (isset($_GET["page"]) && $_GET["page"] != "") { use Twig\Environment;
echo $twig->render('page.html', ['title' => $_GET["page"]]); use Twig\Loader\FilesystemLoader;
$pageloader = new FilesystemLoader(__DIR__ . '/pages');
$templateloader = new FilesystemLoader(__DIR__ . '/templates');
$twig_pages = new Environment($pageloader);
$twig_templates = new Environment($templateloader);
$title = '';
$content = '';
$csspath = '';
$topictreff = $twig_templates->render('topictreff.html.twig');
$nextevents = $twig_templates->render('nextevents.html.twig');
$raumstatus = 'unbekannt';
if(isset($_GET['page'])) {
$page = $_GET['page'];
switch ($page) {
case 'index':
$title = 'index';
$content = $twig_pages->render('index.html.twig', ['raumstatus' => 'unbekannt']);
break;
default:
$content = $twig_pages->render('404.html.twig', ['page' => $_GET['page']]);
break;
} }
} else {
$title = 'index';
$content = $twig_pages->render('index.html.twig', ['raumstatus' => 'unbekannt']);
}
$twig_templates->render('top.html.twig', ['title' => $title, 'csspath' => $csspath]);
echo $content;
$twig_templates->render('bottom.html.twig');
?> ?>

1
pages/404.html.twig Normal file
View File

@ -0,0 +1 @@
<h2>404 Page {{ page }} not found!</h2>

View File

@ -1,25 +1,3 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ctdo - home</title>
<link rel="stylesheet" href="/styles/main.css">
<link rel="stylesheet" href="/styles/home.css">
<link rel="stylesheet" href="/styles/events.css">
</head>
<body>
<div class="newBanner">Rundgang</div>
<header>
<img src="/images/logo_ctdo.svg" alt="ctdo logo">
!NAV
</header>
<main>
<div class="rundgang"> <div class="rundgang">
<a href="https://www.chaostreff-dortmund.de/rundgang/" target="_blank" class="imgLink"> <a href="https://www.chaostreff-dortmund.de/rundgang/" target="_blank" class="imgLink">
<div> <div>
@ -29,26 +7,18 @@
</a> </a>
</div> </div>
!RAUMSTATUS <p>Raumstatus: {{ raumstatus }}</p>
<h2>Hi</h2> <h2>Hi</h2>
<p> <p>
Wir sind eine bunt gemischte Gruppe aus computer-, technikbegeisterten und kreativen Menschen. Wir betreiben den Chaostreff aus Spaß an der Sache und um interessierten Menschen eine Plattform zu bieten, über die man sich austauschen kann.<br> Wir sind eine bunt gemischte Gruppe aus computer-, technikbegeisterten und kreativen Menschen. Wir betreiben den Chaostreff aus Spaß an der Sache und um interessierten Menschen eine Plattform zu bieten, über die man sich austauschen kann.<br>
<br> <br>
Wenn du Lust hast dir das mal anzuschauen, dann komm gerne vorbei. <a href="/treff.php">zeiten & location</a><br> Wenn du Lust hast dir das mal anzuschauen, dann komm gerne vorbei. <a href="/?page=treff">zeiten & location</a><br>
<br> <br>
Egal wer du bist, egal was du machst bei uns sind alle Menschen willkommen. Leider sind unsere Räume aktuell nicht barrierefrei. Egal wer du bist, egal was du machst bei uns sind alle Menschen willkommen. Leider sind unsere Räume aktuell nicht barrierefrei.
Falls du Fragen hast schreibe uns an. <a href="/kontakt.php">kontakt</a><br> Falls du Fragen hast schreibe uns an. <a href="/?page=kontakt">kontakt</a><br>
<br> <br>
Wenn du mehr über uns wissen möchtest, schau hier: <a href="/about.php">über uns</a> Wenn du mehr über uns wissen möchtest, schau hier: <a href="/?page=about">über uns</a>
</p> </p>
<h2>Die nächsten Events</h2> <h2>Die nächsten Events</h2>
!TOPICTREFF
!NEXTEVENTS
</main>
<footer>
!FOOTERNAV
</footer>
</body>
</html>

View File

@ -1,7 +0,0 @@
<?php
function print_file($path) {
print(file_get_contents($path));
}
?>

View File

@ -1,5 +0,0 @@
<?php
function raum_ist_offen() {
return false;
}
?>

View File

View File

@ -0,0 +1,12 @@
</main>
<footer>
<nav>
<ul>
<li> <a href="/?page=impressum">impressum</a> </li>
<li> <a href="/?page=datenschutz">datenschutz</a> </li>
</ul>
</nav>
</footer>
</body>
</html>

View File

@ -1,32 +0,0 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ctdo - {{ title }}</title>
<link rel="stylesheet" href="/styles/main.css">
<link rel="stylesheet" href="/styles/elements_custom.css">
<link rel="stylesheet" href="/styles/event.css">
<link rel="stylesheet" href="/styles/events_custom.css">
</head>
<body>
<div class="newBanner">Rundgang</div>
<header>
<img src="/images/logo_ctdo.svg" alt="ctdo logo">
{{ nav }}
</header>
<main>
<h2> {{ title }} </h2>
{{ content }}
</main>
<footer>
{{ footer }}
</footer>
</body>
</html>

View File

@ -0,0 +1 @@
nextevents

View File

@ -1,31 +0,0 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ctdo - {{ title }}</title>
<link rel="stylesheet" href="/styles/main.css">
<link rel="stylesheet" href="/styles/elements_custom.css">
<link rel="stylesheet" href="/styles/events.css">
</head>
<body>
<div class="newBanner">Rundgang</div>
<header>
<img src="/images/logo_ctdo.svg" alt="ctdo logo">
{{ nav }}
</header>
<main>
<h2> {{ title }} </h2>
{{ content }}
</main>
<footer>
{{ footer }}
</footer>
</body>
</html>

31
templates/top.html.twig Normal file
View File

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ctdo - {{ title }}</title>
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="{{ csspath }}">
</head>
<body>
<div class="newBanner">Rundgang</div>
<header>
<img src="/images/logo_ctdo.svg" alt="ctdo logo">
<nav>
<ul>
<li> <a href="/?page=index">home</a> </li>
<li> <a href="/?page=about">über uns</a> </li>
<li> <a href="/?page=treff">zeiten & location</a> </li>
<li> <a href="/?page=events">events</a> </li>
<li> <a href="/?page=kontakt">kontakt</a> </li>
<li> <a href="/?page=support">support</a> </li>
<li> <a href="/?page=verein">verein</a> </li>
</ul>
</nav>
</header>
<main>

View File

@ -0,0 +1 @@
topictreff

BIN
vendor/.DS_Store vendored Normal file

Binary file not shown.

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php'; require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitf2ee1f9d8036c28086d9e9f2f204db28::getLoader(); return ComposerAutoloaderInitce41dc6e38789c9f43c485905030864d::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInitf2ee1f9d8036c28086d9e9f2f204db28 class ComposerAutoloaderInitce41dc6e38789c9f43c485905030864d
{ {
private static $loader; private static $loader;
@ -24,16 +24,16 @@ class ComposerAutoloaderInitf2ee1f9d8036c28086d9e9f2f204db28
require __DIR__ . '/platform_check.php'; require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInitf2ee1f9d8036c28086d9e9f2f204db28', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInitce41dc6e38789c9f43c485905030864d', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitf2ee1f9d8036c28086d9e9f2f204db28', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInitce41dc6e38789c9f43c485905030864d', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php'; require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitf2ee1f9d8036c28086d9e9f2f204db28::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInitce41dc6e38789c9f43c485905030864d::getInitializer($loader));
$loader->register(true); $loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitf2ee1f9d8036c28086d9e9f2f204db28::$files; $filesToLoad = \Composer\Autoload\ComposerStaticInitce41dc6e38789c9f43c485905030864d::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) { $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload; namespace Composer\Autoload;
class ComposerStaticInitf2ee1f9d8036c28086d9e9f2f204db28 class ComposerStaticInitce41dc6e38789c9f43c485905030864d
{ {
public static $files = array ( public static $files = array (
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@ -45,9 +45,9 @@ class ComposerStaticInitf2ee1f9d8036c28086d9e9f2f204db28
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitf2ee1f9d8036c28086d9e9f2f204db28::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInitce41dc6e38789c9f43c485905030864d::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitf2ee1f9d8036c28086d9e9f2f204db28::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitce41dc6e38789c9f43c485905030864d::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitf2ee1f9d8036c28086d9e9f2f204db28::$classMap; $loader->classMap = ComposerStaticInitce41dc6e38789c9f43c485905030864d::$classMap;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }

View File

@ -1,9 +1,9 @@
<?php return array( <?php return array(
'root' => array( 'root' => array(
'name' => '__root__', 'name' => '__root__',
'pretty_version' => 'dev-master', 'pretty_version' => '1.0.0+no-version-set',
'version' => 'dev-master', 'version' => '1.0.0.0',
'reference' => 'b8f36a8eb43f5717fe9982dba2a852d772b17266', 'reference' => NULL,
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
@ -11,9 +11,9 @@
), ),
'versions' => array( 'versions' => array(
'__root__' => array( '__root__' => array(
'pretty_version' => 'dev-master', 'pretty_version' => '1.0.0+no-version-set',
'version' => 'dev-master', 'version' => '1.0.0.0',
'reference' => 'b8f36a8eb43f5717fe9982dba2a852d772b17266', 'reference' => NULL,
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),

BIN
vendor/symfony/.DS_Store vendored Normal file

Binary file not shown.