Compare commits
No commits in common. "5fd21990db6f801976f73e4a54c14d5488de87a1" and "22936497fd888273e1458167877f19627d23ee26" have entirely different histories.
5fd21990db
...
22936497fd
|
@ -4,7 +4,7 @@ Einmal in der Woche treffen wir uns regulär zum quatschen, basteln, frickeln, p
|
||||||
11:00 - 15:00
|
11:00 - 15:00
|
||||||
Chaostreff Dortmund e.V.
|
Chaostreff Dortmund e.V.
|
||||||
------------------------
|
------------------------
|
||||||
# ChaosBrunch
|
# Treff
|
||||||
|
|
||||||
Alle zwei Wochen an einem Sonntag lädt der CTDO zum **Mitbring-Brunch** in seinen Räume im Kulturzentrum [„Langer August“](/?page=treff) ein!
|
Alle zwei Wochen an einem Sonntag lädt der CTDO zum **Mitbring-Brunch** in seinen Räume im Kulturzentrum [„Langer August“](/?page=treff) ein!
|
||||||
|
|
||||||
|
|
61
index.php
61
index.php
|
@ -22,6 +22,7 @@ $twig_templates = new Environment($templateloader);
|
||||||
|
|
||||||
$title = '';
|
$title = '';
|
||||||
$content = '';
|
$content = '';
|
||||||
|
$head = '';
|
||||||
|
|
||||||
$topictreff = $twig_templates->render('topictreff.html.twig');
|
$topictreff = $twig_templates->render('topictreff.html.twig');
|
||||||
$nextevents = $twig_templates->render('nextevents.html.twig');
|
$nextevents = $twig_templates->render('nextevents.html.twig');
|
||||||
|
@ -42,8 +43,32 @@ if(gettype($raumstatus_b) == "boolean") {
|
||||||
}
|
}
|
||||||
|
|
||||||
$topic = $util->get_next_topic();
|
$topic = $util->get_next_topic();
|
||||||
|
$topiclink = '<a href="/?page=events&id=topictreff">Topictreff</a>';
|
||||||
|
switch ($topic->days) {
|
||||||
|
case 0:
|
||||||
|
$topic_output = '<p class="topic">Der nächste '.$topiclink.' findet heute statt!</p>';
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
$topic_output = '<p class="topic">Der nächste '.$topiclink.' findet morgen statt!</p>';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$topic_output = '<p class="topic">Der nächste '.$topiclink.' findet in '.$topic->days.' Tagen ['.$topic->date.'] statt.</p>';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$treff = $util->get_next_treff();
|
$treff = $util->get_next_treff();
|
||||||
|
$trefflink = '<a href="/?page=events&id=treff">Treff</a>';
|
||||||
|
switch ($treff->days) {
|
||||||
|
case 0:
|
||||||
|
$treff_output = '<p class="topic">Der nächste '.$trefflink.' findet heute statt!</p>';
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
$treff_output = '<p class="topic">Der nächste '.$trefflink.' findet morgen statt!</p>';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$treff_output = '<p class="topic">Der nächste '.$trefflink.' findet in '.$treff->days.' Tagen ['.$treff->date.'] statt.</p>';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$repaircafe = $util->get_next_repaircafe();
|
$repaircafe = $util->get_next_repaircafe();
|
||||||
$repaircafelink = '<a href="/?page=events&id=repaircafe">RepairCafe</a>';
|
$repaircafelink = '<a href="/?page=events&id=repaircafe">RepairCafe</a>';
|
||||||
|
@ -73,8 +98,6 @@ switch ($brunch->days) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$css = ['main'];
|
|
||||||
|
|
||||||
if(isset($_GET['page'])) {
|
if(isset($_GET['page'])) {
|
||||||
$page = $_GET['page'];
|
$page = $_GET['page'];
|
||||||
$active_page = $util->str_mass_replace(array('adresse', 'irc', 'mail'), array('kontakt', 'kontakt', 'kontakt'), $page);
|
$active_page = $util->str_mass_replace(array('adresse', 'irc', 'mail'), array('kontakt', 'kontakt', 'kontakt'), $page);
|
||||||
|
@ -82,77 +105,85 @@ if(isset($_GET['page'])) {
|
||||||
switch ($page) {
|
switch ($page) {
|
||||||
case 'index':
|
case 'index':
|
||||||
$content = $twig_pages->render('index.html.twig', [ 'topic' => $topic_output, 'posts' => $util->generate_post_list(4) ]);
|
$content = $twig_pages->render('index.html.twig', [ 'topic' => $topic_output, 'posts' => $util->generate_post_list(4) ]);
|
||||||
$css[] = 'home';
|
$head = $util->css_link('css/main.css').$util->css_link('css/home.css').$util->css_link('css/events.css');
|
||||||
$css[] = 'events';
|
|
||||||
break;
|
break;
|
||||||
case 'about':
|
case 'about':
|
||||||
$content = $twig_pages->render('about.html.twig');
|
$content = $twig_pages->render('about.html.twig');
|
||||||
$css[] = 'about';
|
$head = $util->css_link('css/main.css').$util->css_link('css/about.css');
|
||||||
break;
|
break;
|
||||||
case 'treff':
|
case 'treff':
|
||||||
$content = $twig_pages->render('treff.html.twig');
|
$content = $twig_pages->render('treff.html.twig');
|
||||||
|
$head = $util->css_link('css/main.css');
|
||||||
break;
|
break;
|
||||||
case 'blog':
|
case 'blog':
|
||||||
if(!isset($_GET['id'])) {
|
if(!isset($_GET['id'])) {
|
||||||
$content = $twig_pages->render('blog.html.twig', [ 'posts' => $util->generate_post_list() ]);
|
$content = $twig_pages->render('blog.html.twig', [ 'posts' => $util->generate_post_list() ]);
|
||||||
$css[] = 'events';
|
$head = $util->css_link('css/main.css').$util->css_link('css/events.css');
|
||||||
} else {
|
} else {
|
||||||
$content = $converter->convert($util->get_post_content($_GET['id']));
|
$content = $converter->convert($util->get_post_content($_GET['id']));
|
||||||
$css[] = 'event';
|
$head = $util->css_link('css/main.css').$util->css_link('css/event.css');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'events':
|
case 'events':
|
||||||
if(!isset($_GET['id'])) {
|
if(!isset($_GET['id'])) {
|
||||||
$content = $twig_pages->render('events.html.twig', [ 'topic' => $topic, 'treff' => $treff, 'repaircafe' => $repaircafe, 'brunch' => $brunch, 'events' => $util->generate_event_list() ]);
|
$content = $twig_pages->render('events.html.twig', [ 'topic' => $topic_output, 'treff' => $treff_output, 'repaircafe' => $repaircafe_output, 'brunch' => $brunch_output, 'events' => $util->generate_event_list() ]);
|
||||||
$css[] = 'events';
|
$head = $util->css_link('css/main.css').$util->css_link('css/events.css');
|
||||||
} else {
|
} else {
|
||||||
$content = $util->str_mass_replace(array('{{ topicdatum }}', 'Chaostreff Dortmund e.V.', '{{ treffdatum }}', '{{ repaircafedatum }}', '{{ brunchdatum }}'), array($util->get_next_topic()->date, $util->html_link('/?page=treff', '', 'Chaostreff Dortmund e.V.', FALSE), $util->get_next_treff()->date, $util->get_next_repaircafe()->date, $util->get_next_brunch()->date), $converter->convert($util->get_event_content($_GET['id'])));
|
$content = $util->str_mass_replace(array('{{ topicdatum }}', 'Chaostreff Dortmund e.V.', '{{ treffdatum }}', '{{ repaircafedatum }}', '{{ brunchdatum }}'), array($util->get_next_topic()->date, $util->html_link('/?page=treff', '', 'Chaostreff Dortmund e.V.', FALSE), $util->get_next_treff()->date, $util->get_next_repaircafe()->date, $util->get_next_brunch()->date), $converter->convert($util->get_event_content($_GET['id'])));
|
||||||
$css[] = 'event';
|
$head = $util->css_link('css/main.css').$util->css_link('css/event.css');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'kontakt':
|
case 'kontakt':
|
||||||
$content = $twig_pages->render('kontakt.html.twig');
|
$content = $twig_pages->render('kontakt.html.twig');
|
||||||
$css[] = 'kontakt';
|
$head = $util->css_link('css/main.css').$util->css_link('css/kontakt.css');
|
||||||
break;
|
break;
|
||||||
case 'adresse':
|
case 'adresse':
|
||||||
$content = $twig_pages->render('kontakt/adresse.html.twig');
|
$content = $twig_pages->render('kontakt/adresse.html.twig');
|
||||||
|
$head = $util->css_link('css/main.css');
|
||||||
break;
|
break;
|
||||||
case 'irc':
|
case 'irc':
|
||||||
$content = $twig_pages->render('kontakt/irc.html.twig');
|
$content = $twig_pages->render('kontakt/irc.html.twig');
|
||||||
|
$head = $util->css_link('css/main.css');
|
||||||
break;
|
break;
|
||||||
case 'mail':
|
case 'mail':
|
||||||
$content = $twig_pages->render('kontakt/mail.html.twig');
|
$content = $twig_pages->render('kontakt/mail.html.twig');
|
||||||
|
$head = $util->css_link('css/main.css');
|
||||||
break;
|
break;
|
||||||
case 'tel':
|
case 'tel':
|
||||||
$content = $twig_pages->render('kontakt/tel.html.twig');
|
$content = $twig_pages->render('kontakt/tel.html.twig');
|
||||||
|
$head = $util->css_link('css/main.css');
|
||||||
break;
|
break;
|
||||||
case 'support':
|
case 'support':
|
||||||
$content = $twig_pages->render('support.html.twig');
|
$content = $twig_pages->render('support.html.twig');
|
||||||
|
$head = $util->css_link('css/main.css');
|
||||||
break;
|
break;
|
||||||
case 'verein':
|
case 'verein':
|
||||||
$content = $twig_pages->render('verein.html.twig');
|
$content = $twig_pages->render('verein.html.twig');
|
||||||
|
$head = $util->css_link('css/main.css');
|
||||||
break;
|
break;
|
||||||
case 'impressum':
|
case 'impressum':
|
||||||
$title = 'impressum';
|
$title = 'impressum';
|
||||||
$content = $twig_pages->render('impressum.html.twig');
|
$content = $twig_pages->render('impressum.html.twig');
|
||||||
|
$head = $util->css_link('css/main.css');
|
||||||
break;
|
break;
|
||||||
case 'datenschutz':
|
case 'datenschutz':
|
||||||
$title = 'datenschutz';
|
$title = 'datenschutz';
|
||||||
$content = $twig_pages->render('datenschutz.html.twig');
|
$content = $twig_pages->render('datenschutz.html.twig');
|
||||||
|
$head = $util->css_link('css/main.css');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$content = $twig_pages->render('404.html.twig', ['page' => $_GET['page']]);
|
$content = $twig_pages->render('404.html.twig', ['page' => $_GET['page']]);
|
||||||
|
$head = $util->css_link('css/main.css');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$active_page = 'index';
|
$active_page = 'index';
|
||||||
$title = $active_page;
|
$title = $active_page;
|
||||||
$content = $twig_pages->render('index.html.twig', [ 'posts' => $util->generate_post_list(4) ]);
|
$content = $twig_pages->render('index.html.twig', [ 'topic' => $topic_output, 'posts' => $util->generate_post_list(4) ]);
|
||||||
$css[] = 'home';
|
$head = $util->css_link('css/main.css').$util->css_link('css/home.css').$util->css_link('css/events.css');
|
||||||
$css[] = 'events';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$nav = $util->generate_nav($active_page, $pages, $page_names);
|
$nav = $util->generate_nav($active_page, $pages, $page_names);
|
||||||
|
|
||||||
echo $twig_templates->render('html5struct.html.twig', ['title' => $title, 'css' => $css, 'nav' => $nav, 'raumstatus' => $raumstatus, 'main' => $content]);
|
echo $twig_templates->render('html5struct.html.twig', ['title' => $title, 'head' => $head, 'nav' => $nav, 'raumstatus' => $raumstatus, 'main' => $content]);
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,35 +1,6 @@
|
||||||
<h1>Events</h1>
|
<h1>Events</h1>
|
||||||
|
{{ topic | raw }}
|
||||||
{% if topic.days == 0 %}
|
{{ treff | raw }}
|
||||||
<p class="topic">Der nächste <a href="/?page=events&id=topictreff">Topictreff</a> findet heute [{{ topic.date }}] statt!</p>
|
{{ repaircafe | raw }}
|
||||||
{% elseif topic.days == 1 %}
|
{{ brunch | raw }}
|
||||||
<p class="topic">Der nächste <a href="/?page=events&id=topictreff">Topictreff</a> findet morgen [{{ topic.date }}] statt!</p>
|
|
||||||
{% else %}
|
|
||||||
<p class="topic">Der nächste <a href="/?page=events&id=topictreff">Topictreff</a> findet in {{ topic.days }} [{{ topic.date }}] statt!</p>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if treff.days == 0 %}
|
|
||||||
<p class="topic">Der nächste <a href="/?page=events&id=treff">Treff</a> findet heute [{{ treff.date }}] statt!</p>
|
|
||||||
{% elseif treff.days == 1 %}
|
|
||||||
<p class="topic">Der nächste <a href="/?page=events&id=treff">Treff</a> findet morgen [{{ treff.date }}] statt!</p>
|
|
||||||
{% else %}
|
|
||||||
<p class="topic">Der nächste <a href="/?page=events&id=treff">Treff</a> findet in {{ treff.days }} [{{ treff.date }}] statt!</p>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if repaircafe.days == 0 %}
|
|
||||||
<p class="topic">Das nächste <a href="/?page=events&id=repaircafe">RepairCafe</a> findet heute [{{ repaircafe.date }}] statt!</p>
|
|
||||||
{% elseif repaircafe.days == 1 %}
|
|
||||||
<p class="topic">Das nächste <a href="/?page=events&id=repaircafe">RepairCafe</a> findet morgen [{{ repaircafe.date }}] statt!</p>
|
|
||||||
{% else %}
|
|
||||||
<p class="topic">Das nächste <a href="/?page=events&id=repaircafe">RepairCafe</a> findet in {{ repaircafe.days }} [{{ repaircafe.date }}] statt!</p>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if brunch.days == 0 %}
|
|
||||||
<p class="topic">Der nächste <a href="/?page=events&id=brunch">Brunch</a> findet heute [{{ brunch.date }}] statt!</p>
|
|
||||||
{% elseif brunch.days == 1 %}
|
|
||||||
<p class="topic">Der nächste <a href="/?page=events&id=brunch">Brunch</a> findet morgen [{{ brunch.date }}] statt!</p>
|
|
||||||
{% else %}
|
|
||||||
<p class="topic">Der nächste <a href="/?page=events&id=brunch">Brunch</a> findet in {{ brunch.days }} [{{ brunch.date }}] statt!</p>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{{ events | raw }}
|
{{ events | raw }}
|
|
@ -6,13 +6,14 @@ class Util {
|
||||||
}
|
}
|
||||||
|
|
||||||
function generate_nav($active_page, $pages, $page_names) {
|
function generate_nav($active_page, $pages, $page_names) {
|
||||||
$output = array();
|
$output = '<nav><ul>';
|
||||||
foreach ($pages as $key => $page) {
|
foreach ($pages as $key => $page) {
|
||||||
if ($page == $active_page)
|
if ($page == $active_page)
|
||||||
$output[] = ['page' => $page, 'name' => $page_names[$key], 'active' => TRUE];
|
$output .= '<li>'.$this->html_link('/?page='.$page, 'active', $page_names[$key], FALSE).'</li>';
|
||||||
else
|
else
|
||||||
$output[] = ['page' => $page, 'name' => $page_names[$key], 'active' => FALSE];
|
$output .= '<li>'.$this->html_link('/?page='.$page, '', $page_names[$key], FALSE).'</li>';
|
||||||
}
|
}
|
||||||
|
$output .= '</ul></nav>';
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
@ -143,7 +144,7 @@ class Util {
|
||||||
$next_topic->add(new DateInterval('P1D'));
|
$next_topic->add(new DateInterval('P1D'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$output->days = $currentDate->diff($next_topic)->days+1;
|
$output->days = $currentDate->diff($next_topic)->days;
|
||||||
$output->date = $next_topic->format('Y-m-d');
|
$output->date = $next_topic->format('Y-m-d');
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
|
|
|
@ -7,27 +7,14 @@
|
||||||
|
|
||||||
<title>ctdo - {{ title }}</title>
|
<title>ctdo - {{ title }}</title>
|
||||||
|
|
||||||
{% for item in css %}
|
{{ head | raw }}
|
||||||
<link rel="stylesheet" href="/css/{{ item }}.css">
|
|
||||||
{% endfor %}
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="newBanner"><a href="https://www.chaostreff-dortmund.de/rundgang/" target="_blank">Rundgang</a></div>
|
<div class="newBanner"><a href="https://www.chaostreff-dortmund.de/rundgang/" target="_blank">Rundgang</a></div>
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<nav>
|
<img src="/images/logo_ctdo.svg" alt="ctdo logo">
|
||||||
<ul>
|
{{ nav | raw }}
|
||||||
{% for item in nav %}
|
|
||||||
<li>
|
|
||||||
{% if item.active %}
|
|
||||||
<a href="?page={{ item.page }}" class="active">{{ item.name }}</a>
|
|
||||||
{% else %}
|
|
||||||
<a href="?page={{ item.page }}">{{ item.name }}</a>
|
|
||||||
{% endif %}
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
|
Loading…
Reference in New Issue