diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..accf4b2
Binary files /dev/null and b/.DS_Store differ
diff --git a/composer.json b/composer.json
index 8d8c008..7f408b7 100644
--- a/composer.json
+++ b/composer.json
@@ -1,5 +1,5 @@
{
"require": {
- "twig/twig": "^3.0"
+ "twig/twig": "^3.5"
}
}
diff --git a/composer.lock b/composer.lock
index 4b80c43..a2bc381 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "6a6772df2521c6860a448e9115f2793a",
+ "content-hash": "371cfc453eaacca81446019cafa74691",
"packages": [
{
"name": "symfony/polyfill-ctype",
diff --git a/styles/dashboard.css b/css/dashboard.css
similarity index 100%
rename from styles/dashboard.css
rename to css/dashboard.css
diff --git a/styles/elements_custom.css b/css/elements_custom.css
similarity index 100%
rename from styles/elements_custom.css
rename to css/elements_custom.css
diff --git a/styles/events.css b/css/events.css
similarity index 100%
rename from styles/events.css
rename to css/events.css
diff --git a/styles/events_custom.css b/css/events_custom.css
similarity index 100%
rename from styles/events_custom.css
rename to css/events_custom.css
diff --git a/styles/home.css b/css/home.css
similarity index 100%
rename from styles/home.css
rename to css/home.css
diff --git a/styles/kontakt.css b/css/kontakt.css
similarity index 100%
rename from styles/kontakt.css
rename to css/kontakt.css
diff --git a/styles/main.css b/css/main.css
similarity index 100%
rename from styles/main.css
rename to css/main.css
diff --git a/elements/footer.html b/elements/footer.html
deleted file mode 100644
index 6440473..0000000
--- a/elements/footer.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
\ No newline at end of file
diff --git a/elements/nav.html b/elements/nav.html
deleted file mode 100644
index ee528ee..0000000
--- a/elements/nav.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
\ No newline at end of file
diff --git a/index.php b/index.php
index 01f9c87..2b7bf6c 100644
--- a/index.php
+++ b/index.php
@@ -1,12 +1,44 @@
'./compilation_cache/',
- ]);
+require __DIR__ . '/vendor/autoload.php';
- if (isset($_GET["page"]) && $_GET["page"] != "") {
- echo $twig->render('page.html', ['title' => $_GET["page"]]);
+use Twig\Environment;
+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;
}
-?>
\ No newline at end of file
+} 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');
+
+?>
diff --git a/pages/404.html.twig b/pages/404.html.twig
new file mode 100644
index 0000000..ee8dc80
--- /dev/null
+++ b/pages/404.html.twig
@@ -0,0 +1 @@
+
404 Page {{ page }} not found!
\ No newline at end of file
diff --git a/pages/about.html b/pages/about.html.twig
similarity index 100%
rename from pages/about.html
rename to pages/about.html.twig
diff --git a/pages/datenschutz.html b/pages/datenschutz.html.twig
similarity index 100%
rename from pages/datenschutz.html
rename to pages/datenschutz.html.twig
diff --git a/pages/event.html b/pages/event.html.twig
similarity index 100%
rename from pages/event.html
rename to pages/event.html.twig
diff --git a/pages/events.html b/pages/events.html.twig
similarity index 100%
rename from pages/events.html
rename to pages/events.html.twig
diff --git a/pages/impressum.html b/pages/impressum.html.twig
similarity index 100%
rename from pages/impressum.html
rename to pages/impressum.html.twig
diff --git a/pages/index.html b/pages/index.html.twig
similarity index 53%
rename from pages/index.html
rename to pages/index.html.twig
index adecf1d..bd6c9b7 100644
--- a/pages/index.html
+++ b/pages/index.html.twig
@@ -1,25 +1,3 @@
-
-
-
-
-
-
-
- ctdo - home
-
-
-
-
-
-
-
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. kontakt
+ Falls du Fragen hast schreibe uns an. kontakt
- Wenn du mehr über uns wissen möchtest, schau hier: über uns
+ Wenn du mehr über uns wissen möchtest, schau hier: über uns
-
Die nächsten Events
- !TOPICTREFF
- !NEXTEVENTS
-
-
-
-
\ No newline at end of file
+
Die nächsten Events
\ No newline at end of file
diff --git a/pages/kontakt.html b/pages/kontakt.html.twig
similarity index 100%
rename from pages/kontakt.html
rename to pages/kontakt.html.twig
diff --git a/pages/kontakt/adresse.html b/pages/kontakt/adresse.html.twig
similarity index 100%
rename from pages/kontakt/adresse.html
rename to pages/kontakt/adresse.html.twig
diff --git a/pages/kontakt/irc.html b/pages/kontakt/irc.html.twig
similarity index 100%
rename from pages/kontakt/irc.html
rename to pages/kontakt/irc.html.twig
diff --git a/pages/kontakt/mail.html b/pages/kontakt/mail.html.twig
similarity index 100%
rename from pages/kontakt/mail.html
rename to pages/kontakt/mail.html.twig
diff --git a/pages/kontakt/tel.html b/pages/kontakt/tel.html.twig
similarity index 100%
rename from pages/kontakt/tel.html
rename to pages/kontakt/tel.html.twig
diff --git a/pages/support.html b/pages/support.html.twig
similarity index 100%
rename from pages/support.html
rename to pages/support.html.twig
diff --git a/pages/treff.html b/pages/treff.html.twig
similarity index 100%
rename from pages/treff.html
rename to pages/treff.html.twig
diff --git a/pages/verein.html b/pages/verein.html.twig
similarity index 100%
rename from pages/verein.html
rename to pages/verein.html.twig
diff --git a/php/generator.php b/php/generator.php
deleted file mode 100644
index dbf6e05..0000000
--- a/php/generator.php
+++ /dev/null
@@ -1,7 +0,0 @@
-
\ No newline at end of file
diff --git a/php/raumstatus.php b/php/raumstatus.php
deleted file mode 100644
index 754a987..0000000
--- a/php/raumstatus.php
+++ /dev/null
@@ -1,5 +0,0 @@
-
\ No newline at end of file
diff --git a/php/topictreff.php b/php/topictreff.php
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/bottom.html.twig b/templates/bottom.html.twig
new file mode 100644
index 0000000..d466ab2
--- /dev/null
+++ b/templates/bottom.html.twig
@@ -0,0 +1,12 @@
+
+
+
+