Revamp lockdown mode, again. More readable this time.
This commit is contained in:
parent
684139cef0
commit
1b62853120
29
index.php
29
index.php
@ -48,10 +48,10 @@ $hash_to_state = array(
|
|||||||
'86c75c0ad413b06ff8291673162d0b64' => 'unknown',
|
'86c75c0ad413b06ff8291673162d0b64' => 'unknown',
|
||||||
'0' => 'error',
|
'0' => 'error',
|
||||||
);
|
);
|
||||||
|
if (! $DORF_IN_LOCKDOWN){
|
||||||
$img = file_get_contents('https://chaosdorf.de/raumstatus/status.png');
|
$img = file_get_contents('https://chaosdorf.de/raumstatus/status.png');
|
||||||
$hash = md5($img);
|
$hash = md5($img);
|
||||||
$state = $hash_to_state[$hash];
|
$state = $hash_to_state[$hash];
|
||||||
if (! $DORF_IN_LOCKDOWN){
|
|
||||||
$ical = new ICal(false, array(
|
$ical = new ICal(false, array(
|
||||||
'defaultSpan' => 2,
|
'defaultSpan' => 2,
|
||||||
'defaultTimeZone' => 'Europe/Berlin',
|
'defaultTimeZone' => 'Europe/Berlin',
|
||||||
@ -95,6 +95,16 @@ $v = file_get_contents($VISITORS_FILE);
|
|||||||
<nav class="navbar">
|
<nav class="navbar">
|
||||||
<h1 class="text-center">Was geht im Dorf.jetzt?</h1><hr />
|
<h1 class="text-center">Was geht im Dorf.jetzt?</h1><hr />
|
||||||
</nav>
|
</nav>
|
||||||
|
<?php if($DORF_IN_LOCKDOWN): ?>
|
||||||
|
<div class="card mb-3 text-center">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">Das Chaosdorf ist geschlossen</h5>
|
||||||
|
<i class="material-icons" id="state-icn" style="color:red;font-size:16rem;">lock</i>
|
||||||
|
<p class="card-text font-weight-normal">Das Chaosdorf ist als Vorsichtsmaßnahme bis auf Weiteres für Besucher geschlossen.</p>
|
||||||
|
<p class="card-text font-weight-normal">Für weitere Informationen schau bitte auf <a href="https://chaosdorf.de/">den Blog</a>.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
<div class="card mb-3 text-center">
|
<div class="card mb-3 text-center">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">Türstatus</h5>
|
<h5 class="card-title">Türstatus</h5>
|
||||||
@ -103,13 +113,12 @@ $v = file_get_contents($VISITORS_FILE);
|
|||||||
<div class="btn-wrapper">
|
<div class="btn-wrapper">
|
||||||
<a href="https://wiki.chaosdorf.de/Raumstatus" class="btn btn-lg btn-block btn-primary">What's this?</a>
|
<a href="https://wiki.chaosdorf.de/Raumstatus" class="btn btn-lg btn-block btn-primary">What's this?</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card mb-3 text-center">
|
<div class="card mb-3 text-center">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">Events</h5>
|
<h5 class="card-title">Events</h5>
|
||||||
<?php if (! $DORF_IN_LOCKDOWN && !empty($events)) : ?>
|
<?php if (!empty($events)) : ?>
|
||||||
<h6 class="card-subtitle mb-2 text-muted">Nächste Veranstaltung</h6>
|
<h6 class="card-subtitle mb-2 text-muted">Nächste Veranstaltung</h6>
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
<h5 class="font-weight-bold"><?= htmlspecialchars($first_event->summary, ENT_QUOTES, 'UTF-8') ?></h5>
|
<h5 class="font-weight-bold"><?= htmlspecialchars($first_event->summary, ENT_QUOTES, 'UTF-8') ?></h5>
|
||||||
@ -129,24 +138,16 @@ $v = file_get_contents($VISITORS_FILE);
|
|||||||
<a href="https://wiki.chaosdorf.de/Chaosdorf_Wiki:Current_events" class="btn btn-lg btn-block btn-primary">Event-Kalender</a>
|
<a href="https://wiki.chaosdorf.de/Chaosdorf_Wiki:Current_events" class="btn btn-lg btn-block btn-primary">Event-Kalender</a>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<h6 class="card-subtitle mb-2 text-muted">Aktuell keine Veranstaltungen.</h6>
|
<h6 class="card-subtitle mb-2 text-muted">Aktuell keine Veranstaltungen.</h6>
|
||||||
<?php if ($DORF_IN_LOCKDOWN): ?>
|
|
||||||
<p class="card-text">
|
|
||||||
<span class="font-weight-normal">
|
|
||||||
Aktuell finden als Vorsichtsmaßnahme keine öffentlichen Veranstaltungen statt.<br>
|
|
||||||
Bitte beobachte <a href="https://chaosdorf.de">den Blog des Chaosdorf</a> für weitere Informationen.
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
<?php else: ?>
|
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
<span class="font-weight-normal">
|
<span class="font-weight-normal">
|
||||||
Es stehen aktuell keine Veranstaltungen an.
|
Es stehen aktuell keine Veranstaltungen an.
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<footer class="page-footer font-small text-center">
|
<footer class="page-footer font-small text-center">
|
||||||
<div>
|
<div>
|
||||||
Look at the code <a href="https://git.iwonder.name/iwonder/dorf.jetzt">here</a>
|
Look at the code <a href="https://git.iwonder.name/iwonder/dorf.jetzt">here</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user