mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
tu_details.php: Display vote result
This adds an field that indicates whether the vote was accepted or rejected, based on the rules specified in the TU Bylaws. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
481ff2335c
commit
fb76aab8cf
1 changed files with 20 additions and 0 deletions
|
@ -3,9 +3,18 @@ $yes = $row["Yes"];
|
||||||
$no = $row["No"];
|
$no = $row["No"];
|
||||||
$abstain = $row["Abstain"];
|
$abstain = $row["Abstain"];
|
||||||
$active_tus = $row["ActiveTUs"];
|
$active_tus = $row["ActiveTUs"];
|
||||||
|
$quorum = $row["Quorum"];
|
||||||
|
|
||||||
$total = $yes + $no + $abstain;
|
$total = $yes + $no + $abstain;
|
||||||
$participation = $total / $active_tus;
|
$participation = $total / $active_tus;
|
||||||
|
|
||||||
|
if ($yes > $active_tus / 2) {
|
||||||
|
$vote_accepted = true;
|
||||||
|
} elseif ($participation > $quorum && $yes > $no) {
|
||||||
|
$vote_accepted = true;
|
||||||
|
} else {
|
||||||
|
$vote_accepted = false;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h2><?= __("Proposal Details") ?></h2>
|
<h2><?= __("Proposal Details") ?></h2>
|
||||||
|
@ -30,6 +39,17 @@ $participation = $total / $active_tus;
|
||||||
<br />
|
<br />
|
||||||
<?= __("End") ?>:
|
<?= __("End") ?>:
|
||||||
<strong><?= gmdate("Y-m-d H:i", $row['End']) ?></strong>
|
<strong><?= gmdate("Y-m-d H:i", $row['End']) ?></strong>
|
||||||
|
<?php if ($isrunning == 0): ?>
|
||||||
|
<br />
|
||||||
|
<?= __("Result") ?>:
|
||||||
|
<?php if (!$quorum): ?>
|
||||||
|
<span><?= __("unknown") ?></span>
|
||||||
|
<?php elseif ($vote_accepted): ?>
|
||||||
|
<span style="color: green; font-weight: bold"><?= __("Accepted") ?></span>
|
||||||
|
<?php else: ?>
|
||||||
|
<span style="color: red; font-weight: bold"><?= __("Rejected") ?></span>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endif; ?>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
Loading…
Add table
Reference in a new issue