Skip to content

Commit 8963d30

Browse files
Updated table to fix movements pt 1
1 parent d78c35a commit 8963d30

3 files changed

Lines changed: 15 additions & 20 deletions

File tree

css/styles.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7363,8 +7363,13 @@ body.tour-active {
73637363
width: 52px;
73647364
}
73657365

7366-
.rankings-panel #rankingsTable th:nth-child(3),
7367-
.rankings-panel #rankingsTable td:nth-child(3) {
7366+
.rankings-panel #rankingsTable th:nth-child(2),
7367+
.rankings-panel #rankingsTable td:nth-child(2) {
7368+
width: 52px;
7369+
}
7370+
7371+
.rankings-panel #rankingsTable th:nth-child(4),
7372+
.rankings-panel #rankingsTable td:nth-child(4) {
73687373
width: 68px;
73697374
}
73707375

php/process.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ function displayRankingsEq3() {
12751275

12761276
echo "<div class='table-responsive'>";
12771277
echo "<table id='rankingsTable' class='table table-striped'>";
1278-
echo "<thead><tr><th>Rank</th><th>Player</th><th>Points</th></tr></thead>";
1278+
echo "<thead><tr><th>Rank</th><th>Move</th><th>Player</th><th>Points</th></tr></thead>";
12791279
echo "<tbody>";
12801280

12811281
// Keep track of the previous rank to identify non-unique ranks
@@ -1514,19 +1514,7 @@ function displayRankingsEq5() {
15141514
$displayRank = '<strong>'. $rank . '</strong>';
15151515
}
15161516

1517-
// Determine if move is upwards, downwards or the same and calculate the difference between current and previous ranking
1518-
if (!$hasRecordedResults) {
1519-
$move = "<span class='text-secondary'>-</span>";
1520-
} elseif ($row["lastpos"] > $row["currpos"]) {
1521-
$diff = $row["lastpos"] - $row["currpos"];
1522-
$move = "<span class='text-success'><i class='bi bi-caret-up-fill'></i>" . $diff . "</span>";
1523-
} elseif ($row["lastpos"] < $row["currpos"]) {
1524-
$diff = $row["currpos"] - $row["lastpos"];
1525-
$move = "<span class='text-danger'><i class='bi bi-caret-down-fill'></i>" . $diff . "</span>";
1526-
} else {
1527-
$diff = 0;
1528-
$move = "<span class='text-secondary'><i class='bi bi-caret-right-fill'></i>" . $diff . "</span>";
1529-
}
1517+
$move = "&nbsp;";
15301518

15311519
// Ensure both name variables begin with upper case letters
15321520
$uppCaseFN = ucfirst($row["firstname"]);
@@ -1539,6 +1527,7 @@ function displayRankingsEq5() {
15391527
// Display the table complete with all data variables
15401528
echo "<tr" . $rowClass . ">";
15411529
echo "<td><span class=''>" . $displayRank . "</span></td>";
1530+
echo "<td><span class=''>" . $move . "</span></td>";
15421531
$playerMeta = trim((string) ($row["location"] ?? ''));
15431532
if ($playerMeta === '' || strcasecmp($playerMeta, 'Prefer Not To Say') === 0) {
15441533
$playerMeta = trim((string) ($row["faveteam"] ?? ''));

rankings.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@
5151
//"lengthMenu": [[3, 10, 20, 30, 40, -1], ["Top 3", "Top 10", "Top 20", "Top 30", "Top 40", "All"]],
5252
"ordering": false, // Disable column sorting
5353
"columnDefs": [
54-
{ "width": "12%", "targets": 0 },
55-
{ "width": "68%", "targets": 1 },
56-
{ "width": "20%", "targets": 2 }
54+
{ "width": "10%", "targets": 0 },
55+
{ "width": "15%", "targets": 1 },
56+
{ "width": "60%", "targets": 2 },
57+
{ "width": "15%", "targets": 3 },
5758
]
5859
});
5960

@@ -88,7 +89,7 @@
8889

8990
const syncRankingsHeadings = function() {
9091
const compact = window.matchMedia('(max-width: 575.98px)').matches;
91-
const labels = compact ? ['RK', 'PLAYER', 'PTS'] : ['RANK', 'PLAYER', 'POINTS'];
92+
const labels = compact ? ['RK', 'MV', 'PLAYER', 'PTS'] : ['RANK', 'MOVE', 'PLAYER', 'POINTS'];
9293

9394
tableHeadings.each(function(index) {
9495
if (labels[index]) {

0 commit comments

Comments
 (0)