Commit
This commit is contained in:
parent
3058f8d81b
commit
11cba978b7
@ -1,7 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
if (!isset($focused)) {
|
||||||
|
$focused = FALSE;
|
||||||
|
}
|
||||||
|
?>
|
||||||
<div id="alertBox" class="alert danger hidden" role="alert"></div>
|
<div id="alertBox" class="alert danger hidden" role="alert"></div>
|
||||||
|
|
||||||
|
<?php if ($focused == FALSE): ?>
|
||||||
<h1>Resultater</h1>
|
<h1>Resultater</h1>
|
||||||
<br>
|
<span class="float-right">[ <a class="info" href="?focused=1" target="_blank">Fokusert visning</a> ]</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<noscript>
|
<noscript>
|
||||||
Denne siden krever JavaScript
|
Denne siden krever JavaScript
|
||||||
@ -11,6 +18,16 @@ Denne siden krever JavaScript
|
|||||||
Laster inn...
|
Laster inn...
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.b {
|
||||||
|
animation: coolFlash 1s;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes coolFlash {
|
||||||
|
from { background: lightgreen; }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<script src="<?=$this->config['root_url']?>static/js/ResultService.js"></script>
|
<script src="<?=$this->config['root_url']?>static/js/ResultService.js"></script>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<hr class="hidden">
|
<hr class="hidden">
|
||||||
|
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<small>Kopieringsrettigheter © 2021-2022 <a target="_blank" href="http://willy.club">WillySoft Solutions</a></small>
|
<small>Kopieringsrettigheter © 2021-2022 <a target="_blank" href="http://willy.club">WillySoft Solutions</a>, Kvadraturen Videregående Skole 3ELDEA</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
if (!isset($hide_nav)) {
|
||||||
|
$hide_nav = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($hide_menu)) {
|
||||||
|
$hide_menu = FALSE;
|
||||||
|
}
|
||||||
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
@ -16,42 +25,47 @@
|
|||||||
|
|
||||||
<hr class="hidden">
|
<hr class="hidden">
|
||||||
|
|
||||||
<div id="menu">
|
<?php if ($hide_menu == FALSE): ?>
|
||||||
<small>
|
<div id="menu">
|
||||||
|
<small>
|
||||||
|
|
||||||
<?php if ($this->user->logged_in): ?>
|
<?php if ($this->user->logged_in): ?>
|
||||||
<span><?=htmlspecialchars($this->user->username)?></span>
|
<span><?=htmlspecialchars($this->user->username)?></span>
|
||||||
<a href="<?=$this->config['root_url']?>logout.php">Logg ut</a>
|
<a href="<?=$this->config['root_url']?>logout.php">Logg ut</a>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<span>Ikke pålogget</span>
|
<span>Ikke pålogget</span>
|
||||||
<a href="<?=$this->config['root_url']?>login.php">Logg inn</a>
|
<a href="<?=$this->config['root_url']?>login.php">Logg inn</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<hr class="hidden">
|
<hr class="hidden">
|
||||||
|
|
||||||
<div id="container">
|
<div id="container">
|
||||||
|
|
||||||
<div id="nav">
|
<?php if ($hide_nav == FALSE): ?>
|
||||||
<h4>Felles</h4>
|
<div id="nav">
|
||||||
<ul>
|
|
||||||
<li><a href="<?=$this->config['root_url']?>index.php">Forside</a></li>
|
|
||||||
<li><a href="<?=$this->config['root_url']?>race/results.php">Resultater</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<?php if ($this->user->logged_in): ?>
|
<h4>Felles</h4>
|
||||||
<?php if ($this->user->power_level > 0): ?>
|
<ul>
|
||||||
<h4>Admin</h4>
|
<li><a href="<?=$this->config['root_url']?>index.php">Forside</a></li>
|
||||||
<ul>
|
<li><a href="<?=$this->config['root_url']?>race/results.php">Resultater</a></li>
|
||||||
<li><a href="<?=$this->config['root_url']?>race/configure/index.php">Konfigurer</a></li>
|
</ul>
|
||||||
<li><a href="<?=$this->config['root_url']?>race/configure/simulator.php">Simulator</a></li>
|
|
||||||
</ul>
|
<?php if ($this->user->logged_in): ?>
|
||||||
|
<?php if ($this->user->power_level > 0): ?>
|
||||||
|
<h4>Admin</h4>
|
||||||
|
<ul>
|
||||||
|
<li><a href="<?=$this->config['root_url']?>race/configure/index.php">Konfigurer</a></li>
|
||||||
|
<li><a href="<?=$this->config['root_url']?>race/configure/simulator.php">Simulator</a></li>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<hr class="hidden">
|
<hr class="hidden">
|
||||||
|
|
||||||
|
@ -1,5 +1,17 @@
|
|||||||
<?php $app = require '../../app/inc.php';
|
<?php $app = require '../../app/inc.php';
|
||||||
|
|
||||||
$app->view('template/header', ["title" => "Resultater"]);
|
$focused = filter_input(INPUT_GET, 'focused');
|
||||||
$app->view('pages/race/results');
|
|
||||||
$app->view('template/footer');
|
if ($focused) {
|
||||||
|
$app->view('template/header', [
|
||||||
|
"title" => "Resultater",
|
||||||
|
"hide_nav" => TRUE,
|
||||||
|
"hide_menu" => TRUE
|
||||||
|
]);
|
||||||
|
$app->view('pages/race/results', ["focused" => TRUE]);
|
||||||
|
$app->view('template/footer');
|
||||||
|
} else {
|
||||||
|
$app->view('template/header', ["title" => "Resultater"]);
|
||||||
|
$app->view('pages/race/results');
|
||||||
|
$app->view('template/footer');
|
||||||
|
}
|
||||||
|
@ -14,6 +14,9 @@ class ResultService {
|
|||||||
|
|
||||||
this.hash = 0;
|
this.hash = 0;
|
||||||
|
|
||||||
|
// cool flashy flashy thingy
|
||||||
|
this.prevTableRowsLength = null;
|
||||||
|
|
||||||
this.loop();
|
this.loop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,11 +102,17 @@ class ResultService {
|
|||||||
tableHTML += "<th>Passert</th>";
|
tableHTML += "<th>Passert</th>";
|
||||||
tableHTML += "</tr>";
|
tableHTML += "</tr>";
|
||||||
|
|
||||||
|
let tableRowsLength = tableRows.length;
|
||||||
|
|
||||||
|
if (this.prevTableRowsLength == null) {
|
||||||
|
this.prevTableRowsLength = tableRowsLength;
|
||||||
|
}
|
||||||
|
|
||||||
let iterator = tableRows.length + 1;
|
let iterator = tableRows.length + 1;
|
||||||
tableRows.forEach(row => {
|
tableRows.forEach(row => {
|
||||||
iterator--;
|
iterator--;
|
||||||
|
|
||||||
tableHTML += "<tr>";
|
tableHTML += "<tr" + ((iterator > this.prevTableRowsLength) ? ' class="b"' : '' ) + ">";
|
||||||
tableHTML += "<td>" + iterator + "</td>";
|
tableHTML += "<td>" + iterator + "</td>";
|
||||||
tableHTML += "<td>" + row.team.name + "</td>";
|
tableHTML += "<td>" + row.team.name + "</td>";
|
||||||
tableHTML += "<td>" + row.team.company + "</td>";
|
tableHTML += "<td>" + row.team.company + "</td>";
|
||||||
@ -116,6 +125,9 @@ class ResultService {
|
|||||||
tableHTML += "<table>";
|
tableHTML += "<table>";
|
||||||
|
|
||||||
this.rankingTable.innerHTML = tableHTML;
|
this.rankingTable.innerHTML = tableHTML;
|
||||||
|
|
||||||
|
// used for cool green flashy flashy thingy
|
||||||
|
this.prevTableRowsLength = tableRowsLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user