Handled suggestions -pullrequestreview-749376540

This commit is contained in:
Felix Albrigtsen 2021-09-08 21:29:36 +02:00
parent 9dad49738c
commit fdbbaee175
4 changed files with 18 additions and 12 deletions

View File

@ -3,3 +3,4 @@ $dbDsn = 'sqlite:'.__DIR__.DIRECTORY_SEPARATOR.'pvv.sqlite';
$dbUser = null;
$dbPass = null;
$doorSensorSecret = "OGJiZTdjZDctMmFkNy00ZjZjLTk3OGItOTA3NzU3ZDM2Yjlm";

View File

@ -18,8 +18,8 @@ class Door{
$doorEvents = [];
foreach($statement->fetchAll() as $row){
$doorEvents[] = [
'time' => $row['time'],
'open' => $row['open']
'time' => (int)$row['time'],
'open' => (bool)$row['open']
];
}

View File

@ -153,6 +153,16 @@ nav #usermenu li:first-child:hover {
background: transparent;
}
#doorIndicator {
border-radius: 5px;
padding: 8px 8px;
margin: 4px 4px;
}
#doorIndicator > p > abbr[title] { text-decoration: none; border-bottom: none; cursor: inherit; }
.doorIndicator_OPEN { border: 2px solid green; }
.doorIndicator_CLOSED { border: 2px dotted red; }
.doorStateMobileOnly { display: none; }
@media(max-width: 800px){
nav #menu, nav #menu li.active, nav #menu_toggle, nav #login {
position: absolute;
@ -226,6 +236,9 @@ nav #usermenu li:first-child:hover {
margin-left: 1em !important;
margin-right: 1em !important;
}
.doorStateMobileOnly {
display: inline;
}
}
body {
@ -347,11 +360,3 @@ textarea.boxinput {
resize: vertical;
}
#doorIndicator {
border-radius: 5px;
padding: 8px 8px;
margin: 4px 4px;
}
#doorIndicator > p { display: inline; }
.doorIndicator_OPEN { border: 2px solid green; }
.doorIndicator_CLOSED { border: 2px dotted red; }

View File

@ -70,8 +70,8 @@ if (date("Y-m-d") == date("Y-m-d", $doorEntry->time)) { $doorTime = date("H:i",
<a class="btn focus" href="paamelding/"><li>Bli medlem!</li></a>
<a class="btn" href="https://use.mazemap.com/#config=ntnu&v=1&zlevel=2&center=10.406281,63.417093&zoom=19.5&campuses=ntnu&campusid=1&sharepoitype=poi&sharepoi=38159&utm_medium=longurl">Veibeskrivelse</li></a>
<div id="doorIndicator" class="<?php echo($isDoorOpen ? "doorIndicator_OPEN" : "doorIndicator_CLOSED"); ?>">
<p class="doorStateText">Døren er <b><?php echo($isDoorOpen ? "" : "ikke") ?> åpen</b>.</p>
<p class="doorStateTime">(Oppdatert <?php echo($doorTime) ?>)</p>
<p class="doorStateText"><abbr title="Oppdatert <?php echo($doorTime) ?>">Døren er <b><?php echo($isDoorOpen ? "" : "ikke") ?> åpen</b>.</abbr></p>
<p class="doorStateTime doorStateMobileOnly">(Oppdatert <?php echo($doorTime) ?>)</p>
</div>
</ul>
</div>