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:
Lukas Fleischer 2013-08-04 17:41:39 +02:00
parent 481ff2335c
commit fb76aab8cf

View file

@ -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>