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:
root 2022-02-18 16:13:19 +01:00
parent 8a1dab5d15
commit 4056d2f324
3 changed files with 29 additions and 81 deletions

View file

@ -1,13 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de"> <html lang="de">
<?php
try {
include_once '../src/getContent.php';
require_once '../src/getEvent.php';
} catch (Exception $ex) {
print_r($ex)
}
?>
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hackspace, Jena, Technik, Elektronik, <meta name="keywords" content="Hackspace, Jena, Technik, Elektronik,
@ -45,10 +38,14 @@
<div id="headline" class="flex-box row"> <div id="headline" class="flex-box row">
<div id="header-left" class="flex-box row center"> <div id="header-left" class="flex-box row center">
<div id="status-icon" class="icon"> <div id="status-icon" class="icon">
<?php getKrautButton($status); ?> <?php
<!-- <img class="icon-img" try {
alt="Raumstatus Icon - Raum ist geschlossen" include_once '../src/getContent.php';
src="./images/icons/user-times.svg" /> --> getKrautButton($status);
} catch(Exception $ex) {
error_log("$ex", 0);
}
?>
</div> </div>
<div id="banner-div" class="flex-box column"> <div id="banner-div" class="flex-box column">
<a id="banner" href="#" <a id="banner" href="#"
@ -156,24 +153,10 @@
<div class="flex-box column with-aside"> <div class="flex-box column with-aside">
<div> <div>
<h3>Termine</h3> <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 <?php
require_once '../src/getEvents.php';
printEventList(); printEventList();
?> ?>
</div> </div>
<aside class="sidebar"> <aside class="sidebar">

View file

@ -219,6 +219,18 @@ div#map img {
max-width: 100%; max-width: 100%;
} }
section.termin {
margin-top: 2em;
}
p.headline {
margin-bottom: 0.5em;
}
ul.events {
margin-top: 0.5em;
padding-left: 2em;
}
/**** aside ****/ /**** aside ****/

View file

@ -43,60 +43,13 @@ function getStatus(): bool
catch (Error $e) { return false; } 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) function getKrautButton(bool $status)
{ {
if ($status) { if ($status) {
echo <<<END echo '<img alt="Raumstatus Icon - Raum ist geöffnet"
<div id="roombutton" class="krautopen"> class="icon-img" src="./images/icons/users.svg">';
<img src="./img/icons/users.svg" id="roomicon" alt="Person">
<p>Raum ist geöffnet</p>
</div>
END;
} else { } else {
echo <<<END echo '<img alt="Raumstatus Icon - Raum ist geschlossen"
<div id="roombutton" class="krautclose"> class="icon-img" src="./images/icons/user-times.svg">';
<img src="./img/icons/user-times.svg" id="roomicon" alt="niemand">
<p>Raum ist geschlossen</p>
</div>
END;
} }
} }