summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2013-08-04 17:41:39 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2013-08-22 17:48:18 +0200
commitfb76aab8cffbc3d251fb635ae8e986c7138d8d68 (patch)
tree3382dd3fdf966d6b0d1ca6aacf838e9d0f6e44ec /web
parent481ff2335c42ae1be0263eb5529981ad4b73dda0 (diff)
downloadaurweb-fb76aab8cffbc3d251fb635ae8e986c7138d8d68.tar.xz
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>
Diffstat (limited to 'web')
-rw-r--r--web/template/tu_details.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/web/template/tu_details.php b/web/template/tu_details.php
index 61abab7..c09e30c 100644
--- a/web/template/tu_details.php
+++ b/web/template/tu_details.php
@@ -3,9 +3,18 @@ $yes = $row["Yes"];
$no = $row["No"];
$abstain = $row["Abstain"];
$active_tus = $row["ActiveTUs"];
+$quorum = $row["Quorum"];
$total = $yes + $no + $abstain;
$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">
<h2><?= __("Proposal Details") ?></h2>
@@ -30,6 +39,17 @@ $participation = $total / $active_tus;
<br />
<?= __("End") ?>:
<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>