[Funktionsfähigkeit wiederhergestellt]

This commit is contained in:
xoy 2023-10-04 12:30:59 +02:00
parent 6027629fd6
commit 756e8b2931
8 changed files with 82 additions and 45 deletions

View File

@ -1 +0,0 @@
# Event Dokumentation

View File

@ -1,34 +1,29 @@
# README
## Inhaltsverzeichnis
0. [README](https://git.ctdo.de/xoy/ctdo.de/src/branch/master/README.MD) - Übersicht
1. [SCRUMBOARD](https://git.ctdo.de/xoy/ctdo.de/src/branch/master/SCRUMBOARD.MD) - Entwicklungsplan
## Projektstruktur
---
| Name | Pfad |
| --------------------------------- | ---------------- |
| Templates | /templates/ |
| Seiten / Seiteninhalte | /pages/ |
| Events | /events/ |
| Bilder | /images/ |
| Post Bilder | /images/posts/ |
| Post Bilder | /images/events/ |
| CSS | /css/ |
| PHP Scripts | /php/ |
## Struktur
| Name | Pfad |
| --------------------------------- | --------------- |
| Templates | /templates/ |
| Seiten / Seiteninhalte | /pages/ |
| Events | /events/ |
| Bilder | /images/ |
| Post Bilder | /images/posts/ |
| CSS | /css/ |
| PHP Scripts | /php/ |
## Erstellen neuer Events
## Erstellen neuer Events / Blog Posts
Datei im Eventverzeichnis Anlegen:
- Nummerierung beachten!
- *.md* Dateierweiterung verwenden!
```
Blogpost Titel
Blogpost Beschreibung
Blogpost Datum
Blogpost Autor
Titel
Beschreibung
Datum
Autor
------------------------
# Content here!
```
@ -37,10 +32,10 @@ Strukturierung:
- Header
```
Blogpost Titel
Blogpost Beschreibung
Blogpost Datum
Blogpost Autor
Titel
Beschreibung
Datum
Autor
```
- Trenner zwischen Header und Content
@ -57,4 +52,4 @@ Unter dem Trenner kann Markdown verwendet werden.
Bilder für Posts kommen in das Verzeichnis */images/posts/*
[Event Dokumentation](https://git.ctdo.de/xoy/ctdo.de/src/branch/master/EVENT.MD)
Bilder für Events kommen in das Verzeichnis */images/events/*

View File

@ -6,6 +6,7 @@
}
* {
box-sizing: border-box;
word-wrap: break-word;
}

View File

@ -15,10 +15,8 @@ $converter = new CommonMarkConverter([
'allow_unsafe_links' => false,
]);
//$pageloader = new FilesystemLoader(__DIR__ . '/pages');
$templateloader = new FilesystemLoader(__DIR__ . '/templates');
//$twig_pages = new Environment($pageloader);
$twig_templates = new Environment($templateloader);
$title = '';
@ -56,78 +54,96 @@ if(isset($_GET['page'])) {
switch ($page) {
case 'index':
$content = $converter->convert(file_get_contents(__DIR__ . '/pages/index.md'));
$content = $twig_templates->render('index.twig', ['content' => $content, 'topic' => $topic, 'treff' => $treff, 'repaircafe' => $repaircafe, 'brunch' => $brunch, 'events' => generate_event_list() ]);
$filetoedit = "pages/index.md";
$css[] = 'home';
$css[] = 'events';
break;
case 'about':
$content = $converter->convert(file_get_contents(__DIR__ . '/pages/about.md'));
$filetoedit = "pages/about.md";
$css[] = 'about';
break;
case 'treff':
$content = $converter->convert(file_get_contents(__DIR__ . '/pages/treff.md'));
$filetoedit = "pages/treff.md";
break;
case 'blog':
if(!isset($_GET['id'])) {
$content = $twig_templates->render('blog.twig', [ 'posts' => generate_post_list() ]);
$filetoedit = "templates/blog.twig";
$css[] = 'events';
} else {
$content = $converter->convert(get_post_content($_GET['id']));
$filetoedit = "posts/".$_GET['id'].".md";
$css[] = 'event';
}
break;
case 'events':
if(!isset($_GET['id'])) {
$content = $twig_templates->render('events.twig', [ 'topic' => $topic, 'treff' => $treff, 'repaircafe' => $repaircafe, 'brunch' => $brunch, 'events' => generate_event_list() ]);
$filetoedit = "templates/events.twig";
$css[] = 'events';
} else {
$content = str_mass_replace(array('{{ topicdatum }}', 'Chaostreff Dortmund e.V.', '{{ treffdatum }}', '{{ repaircafedatum }}', '{{ brunchdatum }}'), array(get_next_topic()->date, html_link('/?page=treff', '', 'Chaostreff Dortmund e.V.', FALSE), get_next_treff()->date, get_next_repaircafe()->date, get_next_brunch()->date), $converter->convert(get_event_content($_GET['id'])));
$filetoedit = "events/".$_GET['id'].".md";
$css[] = 'event';
}
break;
case 'kontakt':
$content = $twig_templates->render('kontakt.twig');
$filetoedit = "templates/kontakt.twig";
$css[] = 'kontakt';
break;
case 'adresse':
$content = $converter->convert(file_get_contents(__DIR__ . '/pages/kontakt/adresse.md')).'<iframe scrolling="no" marginheight="0" marginwidth="0" src="https://www.openstreetmap.org/export/embed.html?bbox=7.463200986385346%2C51.52693021432671%2C7.4667415022850046%2C51.52841869497588&amp;layer=mapnik&amp;marker=51.52767446073405%2C7.464971244335175" frameborder="0" class="osm"></iframe>';
$filetoedit = "pages/kontakt/adresse.md";
break;
case 'irc':
$content = $converter->convert(file_get_contents(__DIR__ . '/pages/kontakt/irc.md'));
$filetoedit = "pages/kontakt/irc.md";
break;
case 'mail':
$content = $converter->convert(file_get_contents(__DIR__ . '/pages/kontakt/mail.md'));
$filetoedit = "pages/kontakt/mail.md";
break;
case 'tel':
$content = $converter->convert(file_get_contents(__DIR__ . '/pages/kontakt/tel.md'));
$filetoedit = "pages/kontakt/tel.md";
break;
case 'support':
$content = $converter->convert(file_get_contents(__DIR__ . '/pages/support.md'));
$filetoedit = "pages/kontakt/support.md";
break;
case 'verein':
$content = $converter->convert(file_get_contents(__DIR__ . '/pages/verein.md'));
$filetoedit = "pages/verein.md";
break;
case 'impressum':
$title = 'impressum';
$content = $converter->convert(file_get_contents(__DIR__ . '/pages/impressum.md'));
$filetoedit = "pages/impressum.md";
break;
case 'datenschutz':
$title = 'datenschutz';
$content = $converter->convert(file_get_contents(__DIR__ . '/pages/datenschutz.md'));
$filetoedit = "pages/datenschutz.md";
break;
default:
$content = $twig_pages->render('404.twig', ['page' => $_GET['page']]);
$content = $twig_templates->render('404.twig', ['page' => $_GET['page']]);
$filetoedit = "templates/404.twig";
break;
}
} else {
$active_page = 'index';
$title = $active_page;
//$content = $twig_pages->render('index.twig', [ 'posts' => generate_post_list(4) ]);
$content = $converter->convert(file_get_contents(__DIR__ . '/pages/index.md'));
$content = $twig_templates->render('index.twig', ['content' => $content, 'topic' => $topic, 'treff' => $treff, 'repaircafe' => $repaircafe, 'brunch' => $brunch, 'events' => generate_event_list() ]);
$css[] = 'home';
$css[] = 'events';
}
$nav = generate_nav($active_page, $pages, $page_names);
echo $twig_templates->render('default.twig', ['title' => $title, 'css' => $css, 'nav' => $nav, 'raumstatus' => $raumstatus, 'main' => $content]);
echo $twig_templates->render('default.twig', ['title' => $title, 'css' => $css, 'nav' => $nav, 'raumstatus' => $raumstatus, 'main' => $content, 'file_to_edit' => $filetoedit]);
?>

View File

@ -42,6 +42,7 @@
<ul>
<li> <a href="/?page=impressum">impressum</a> </li>
<li> <a href="/?page=datenschutz">datenschutz</a> </li>
<li> <a href="https://git.ctdo.de/xoy/ctdo.de/_edit/main/{{ file_to_edit }}" target="_blank">Seite bearbeiten</a> </li>
</ul>
</nav>
</footer>

View File

@ -5,7 +5,7 @@
{% elseif topic.days == 1 %}
<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>
<p class="topic">Der nächste <a href="/?page=events&id=topictreff">Topictreff</a> findet in {{ topic.days }} Tagen [{{ topic.date }}] statt!</p>
{% endif %}
{% if treff.days == 0 %}
@ -13,7 +13,7 @@
{% 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>
<p class="topic">Der nächste <a href="/?page=events&id=treff">Treff</a> findet in {{ treff.days }} Tagen [{{ treff.date }}] statt!</p>
{% endif %}
{% if repaircafe.days == 0 %}
@ -21,7 +21,7 @@
{% 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>
<p class="topic">Das nächste <a href="/?page=events&id=repaircafe">RepairCafe</a> findet in Tagen {{ repaircafe.days }} [{{ repaircafe.date }}] statt!</p>
{% endif %}
{% if brunch.days == 0 %}
@ -29,7 +29,7 @@
{% 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>
<p class="topic">Der nächste <a href="/?page=events&id=brunch">Brunch</a> findet in {{ brunch.days }} Tagen [{{ brunch.date }}] statt!</p>
{% endif %}
{{ events | raw }}

View File

@ -1,5 +1,37 @@
{{ content | raw }}
<h2>Die nächsten Events:</h2>
{{ topic | raw }}
{{ posts | raw }}
{% if topic.days == 0 %}
<p class="topic">Der nächste <a href="/?page=events&id=topictreff">Topictreff</a> findet heute [{{ topic.date }}] statt!</p>
{% elseif topic.days == 1 %}
<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 }} Tagen [{{ 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 }} Tagen [{{ 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 Tagen {{ 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 }} Tagen [{{ brunch.date }}] statt!</p>
{% endif %}
{{ events | raw }}

View File

@ -1,7 +0,0 @@
<?php
require __DIR__ . '/php/util.php';
$u = new Util();
echo var_dump($u->get_next_brunch());