forked from Krautspace/webseite-krautspace
statusbutton und termine per php
statusbutton und termine werden dynamisch aus einem iCalendar gezogen, styling der ausgabe überarbeitet, überflüssige funktionen aus getContent.php entfernt, fehlerbehandlung eingebaut
This commit is contained in:
parent
8a1dab5d15
commit
4056d2f324
3 changed files with 29 additions and 81 deletions
|
@ -1,13 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<?php
|
||||
try {
|
||||
include_once '../src/getContent.php';
|
||||
require_once '../src/getEvent.php';
|
||||
} catch (Exception $ex) {
|
||||
print_r($ex)
|
||||
}
|
||||
?>
|
||||
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="keywords" content="Hackspace, Jena, Technik, Elektronik,
|
||||
|
@ -45,10 +38,14 @@
|
|||
<div id="headline" class="flex-box row">
|
||||
<div id="header-left" class="flex-box row center">
|
||||
<div id="status-icon" class="icon">
|
||||
<?php getKrautButton($status); ?>
|
||||
<!-- <img class="icon-img"
|
||||
alt="Raumstatus Icon - Raum ist geschlossen"
|
||||
src="./images/icons/user-times.svg" /> -->
|
||||
<?php
|
||||
try {
|
||||
include_once '../src/getContent.php';
|
||||
getKrautButton($status);
|
||||
} catch(Exception $ex) {
|
||||
error_log("$ex", 0);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div id="banner-div" class="flex-box column">
|
||||
<a id="banner" href="#"
|
||||
|
@ -156,24 +153,10 @@
|
|||
<div class="flex-box column with-aside">
|
||||
<div>
|
||||
<h3>Termine</h3>
|
||||
<ul>
|
||||
<li>Dienstag, 20:00 Uhr: "Chaostreff"</li>
|
||||
<li>Offene Runde</li>
|
||||
<li>Jitsi: <a href="https://kraut.space/chaostreff"
|
||||
>https://kraut.space/chaostreff</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li>Donnerstag, 20:00 Uhr: "Linux User Group"</li>
|
||||
<li>Linux User Group</li>
|
||||
<li>Jitsi: <a
|
||||
href="https://kraut.space/lug">https://kraut.space/lug</a></li>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
printEventList();
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once '../src/getEvents.php';
|
||||
printEventList();
|
||||
?>
|
||||
</div>
|
||||
|
||||
<aside class="sidebar">
|
||||
|
|
|
@ -219,6 +219,18 @@ div#map img {
|
|||
max-width: 100%;
|
||||
}
|
||||
|
||||
section.termin {
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
p.headline {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
ul.events {
|
||||
margin-top: 0.5em;
|
||||
padding-left: 2em;
|
||||
}
|
||||
|
||||
/**** aside ****/
|
||||
|
||||
|
|
|
@ -43,60 +43,13 @@ function getStatus(): bool
|
|||
catch (Error $e) { return false; }
|
||||
}
|
||||
|
||||
function getKrautButtonColor($status) {
|
||||
if ($status) {
|
||||
echo "<img src='./img/icons/users.svg' id='krauticon'>";
|
||||
} else {
|
||||
echo "<img src='./img/icons/user-times.svg' id='krauticon'>";
|
||||
}
|
||||
}
|
||||
|
||||
function getKrautStatus($status) {
|
||||
if ($status) {
|
||||
echo "Raum ist offen";
|
||||
} else {
|
||||
echo "Raum ist geschlossen";
|
||||
}
|
||||
}
|
||||
|
||||
function getKrautSidebar($status)
|
||||
{
|
||||
if ($status) {
|
||||
echo <<<END
|
||||
<div class="sidebar-heading">
|
||||
<div class="icondiv"><img src="./img/icons/users.svg" class="icon" alt="Person"></div>
|
||||
<h4>Raum ist geöffnet</h4>
|
||||
<p>Schaut einfach vorbei</p>
|
||||
</div>
|
||||
END;
|
||||
|
||||
} else {
|
||||
echo <<<END
|
||||
<div class="sidebar-heading">
|
||||
<div class="icondiv"><img src="./img/icons/user-times.svg" class="icon" alt="niemand"></div>
|
||||
<h4>Niemand ist im Raum</h4>
|
||||
<p>Keine Hackerseele anwesend</p>
|
||||
</div>
|
||||
END;
|
||||
}
|
||||
}
|
||||
|
||||
function getKrautButton(bool $status)
|
||||
{
|
||||
if ($status) {
|
||||
echo <<<END
|
||||
<div id="roombutton" class="krautopen">
|
||||
<img src="./img/icons/users.svg" id="roomicon" alt="Person">
|
||||
<p>Raum ist geöffnet</p>
|
||||
</div>
|
||||
END;
|
||||
|
||||
echo '<img alt="Raumstatus Icon - Raum ist geöffnet"
|
||||
class="icon-img" src="./images/icons/users.svg">';
|
||||
} else {
|
||||
echo <<<END
|
||||
<div id="roombutton" class="krautclose">
|
||||
<img src="./img/icons/user-times.svg" id="roomicon" alt="niemand">
|
||||
<p>Raum ist geschlossen</p>
|
||||
</div>
|
||||
END;
|
||||
echo '<img alt="Raumstatus Icon - Raum ist geschlossen"
|
||||
class="icon-img" src="./images/icons/user-times.svg">';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue