layout fixes, visitor counting

This commit is contained in:
Christopher Teutsch 2020-02-21 20:28:01 +01:00
parent a55992a7f0
commit 2130199951
Signed by: iwonder
GPG Key ID: 0EE33D788D50130D

View File

@ -61,6 +61,7 @@ $locale = locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
if ($locale !== null){ if ($locale !== null){
setlocale(LC_TIME, $locale); setlocale(LC_TIME, $locale);
} }
$v = file_get_contents('/media/sg/dorf.jetzt_visitors');
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de"> <html lang="de">
@ -76,55 +77,57 @@ if ($locale !== null){
<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>
<div class="card-deck mb-3 text-center"> <div class="card mb-3 text-center">
<div class="card" style="width: 18rem;">
<div class="card-img-top">
</div>
<div class="card-body"> <div class="card-body">
<h5 class="card-title">Türstatus</h5> <h5 class="card-title">Türstatus</h5>
<i class="material-icons" id="state-icn" style="color:<?= $state_map[$state]->color ?>;font-size:16rem;"> <i class="material-icons" id="state-icn" style="color:<?= $state_map[$state]->color ?>;font-size:16rem;">
<?= $state_map[$state]->svg ?> <?= $state_map[$state]->svg ?>
</i> </i>
<p class="card-text"><?= $state_map[$state]->state_string ?></p> <p class="card-text"><?= $state_map[$state]->state_string ?></p>
<a href="https://wiki.chaosdorf.de/Raumstatus" class="btn btn-block btn-lg btn-primary">What's this?</a> <div class="btn-wrapper">
<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 class="card" style="width: 18rem;"> <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>
<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>
<span class="font-weight-normal"><?= $ical->iCalDateToDateTime($first_event->dtstart_array[3])->format('Y-m-d H:i'); ?></span> <span class="font-weight-normal"><?= $ical->iCalDateToDateTime($first_event->dtstart_array[3])->format('Y-m-d H:i'); ?></span>
</p> </p>
<h5 class="card-title">Danach:</h5> <h5 class="card-title">Danach:</h5>
<table class="table"> <table class="table">
<tbody> <tbody>
<?php foreach ($events as $event) : ?> <?php foreach ($events as $event) : ?>
<tr> <tr>
<th scope="row"><?= $ical->iCalDateToDateTime($event->dtstart_array[3])->format('Y-m-d H:i') ?></th> <th scope="row"><?= $ical->iCalDateToDateTime($event->dtstart_array[3])->format('Y-m-d H:i') ?></th>
<td><?= htmlspecialchars($event->summary) ?></td> <td><?= htmlspecialchars($event->summary) ?></td>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
<a href="https://wiki.chaosdorf.de/Chaosdorf_Wiki:Current_events" class="btn btn-block btn-lg 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>
</div> </div>
</div> </div>
</div> </div>
</div> <footer class="page-footer font-small text-center">
<div>
<footer class="page-footer font-small text-center"> Look at the code <a href="https://git.iwonder.name/iwonder/dorf.jetzt">here</a>
<div> </div>
Look at the code <a href="https://git.iwonder.name/iwonder/dorf.jetzt">here</a> <div>
</div> Report issues to <a href="mailto:help@dorf.jetzt">help@dorf.jetzt</a>
<div> </div>
Report issues to <a href="mailto:help@dorf.jetzt">help@dorf.jetzt</a> <div>You are visitor #<?= $v ?>
</div> </footer>
</footer> <script src="assets/js/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="assets/js/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script> <script src="assets/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<script src="assets/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</body> </body>
</html> </html>
<?php
if(!$v) $v=0;
$v++;
file_put_contents('/media/sg/dorf.jetzt_visitors', $v);